---
title: "oz0 job save-as-flow"
description: "Usage and flags for oz0 job save-as-flow."
canonical_url: "https://docs.oz0.ai/reference/cli/oz0/job/save-as-flow"
---
# oz0 job save-as-flow

> Usage and flags for oz0 job save-as-flow.

For: Operators and developers looking up a command.

Turn a job that worked into a draft flow in your workspace draft of a plugin: each tool call that succeeded becomes a tool step with its recorded arguments, and each child agent job an agent step.

Values the job was given become the flow's inputs (its input_schema, which holds their names and types, never their values); values an earlier step returned become references to that step (${{ steps.\<id>.\<field> }}); text the model wrote becomes an agent step that writes it again at each run; every other value is kept and listed for you to review. One job shows one path, so the draft has no conditions.

Values of these shapes are never kept: email addresses, phone numbers, IBANs, payment card numbers, Swedish personal numbers, IP addresses, the tenant's secrets, and text written like a flow expression (${{ }}), including such map keys; they become inputs and are flagged. Names, street addresses and other free text are not recognised, so review every kept value.

For a job about a data subject, every text and number becomes an input, and so does every map with a key other than a lowercase field name such as order_id. The manifest gets the flow and a flow tool for it (tools: [{id, flow}]); list the tool in an agent's tools to offer it. Nothing is a revision until you save one in the studio or with `oz0 workspace save`.

The draft becomes plugin source, which every reader of the workspace reads: look at it with --preview first, then write it with --confirm-shared. A job about a data subject needs --confirm-subject, and a chat's turn is never saved. The tenant's admins with the content permission may; it is audited. --dir writes into a plugin folder on disk instead.

## Usage

```bash
oz0 job save-as-flow JOB --into PLUGIN [flags]
```

## Flags

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --confirm-shared
      </code>
    </td>
    
    <td>
      bool
    </td>
    
    <td>
      
    </td>
    
    <td>
      you know the draft becomes plugin source that every reader of the workspace reads (required to write it)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --confirm-subject
      </code>
    </td>
    
    <td>
      bool
    </td>
    
    <td>
      
    </td>
    
    <td>
      save a data subject's job: you looked at the draft and what it lifted
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --dir
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      write into this plugin folder on disk instead of your workspace draft
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --into
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      the plugin (workspace folder) the flow goes into (required)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --name
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        &lt;agent>-flow
      </code>
    </td>
    
    <td>
      the flow's name
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --preview
      </code>
    </td>
    
    <td>
      bool
    </td>
    
    <td>
      
    </td>
    
    <td>
      only show the draft; nothing is written
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --tenant
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        default
      </code>
    </td>
    
    <td>
      tenant
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --tool
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        &lt;plugin>_flows, or the first free &lt;plugin>_flows_N
      </code>
    </td>
    
    <td>
      the flow tool's ID
    </td>
  </tr>
</tbody>
</table>

## Inherited flags

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --context
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        $OZ0_CONTEXT or &lt;config dir>/orchestrator-zero/context.json
      </code>
    </td>
    
    <td>
      CLI context file written by server init
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --log-level
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        info
      </code>
    </td>
    
    <td>
      log level: debug, info, warn or error
    </td>
  </tr>
</tbody>
</table>

See [all `oz0` commands](https://docs.oz0.ai/reference/cli/oz0) and the [global flags](https://docs.oz0.ai/reference/cli/oz0#global-flags).


## Sitemap

See the full [sitemap](https://docs.oz0.ai/sitemap.md) for all pages.
