sim workflows is also spelled sim workflow.
These commands accept the global options.
Workflows
List workflows
Options
API request and response schemas: listWorkflows.
Get workflow
Arguments
API request and response schemas: getWorkflow.
Create workflow
Options
The new workflow's draft holds one Start block (start_trigger, named Start): connect the blocks you add from it.
API request and response schemas: createWorkflow.
Update workflow
Arguments
Options
API request and response schemas: updateWorkflow.
Duplicate workflow
Arguments
Options
API request and response schemas: duplicateWorkflow.
Move workflows
Options
API request and response schemas: moveWorkflows.
Move a workflow to a folder
Arguments
API request and response schemas: updateWorkflow.
Delete workflow
This archives the workflow and its run history; restore with workflows restore.
Arguments
Options
API request and response schemas: deleteWorkflow.
Restore an archived workflow
Arguments
API request and response schemas: restoreWorkflow.
Draft state and edits
Get workflow state
Arguments
API request and response schemas: getWorkflowState.
Replace workflow state
OAuth login or personal API key required.
This replaces the entire draft graph and cannot be undone.
Arguments
Options
API request and response schemas: replaceWorkflowState.
Show a workflow’s draft as a compact read-only outline
Arguments
API request and response schemas: getWorkflowOutline.
Edit a workflow’s blocks, connections and settings with a batch of operations
OAuth login or personal API key required.
This edits the draft graph: the batch adds, edits, or deletes blocks and their edges as written.
Arguments
Options
API request and response schemas: applyWorkflowOperations.
Update workflow variables
This applies the listed variable changes; variables omitted from the operations remain unchanged.
Arguments
Options
API request and response schemas: applyWorkflowVariables.
Deployments and versions
Deploy workflow
OAuth login or personal API key required.
Arguments
Options
API request and response schemas: deployWorkflow.
Show a workflow’s current deployment
Arguments
API request and response schemas: getWorkflowDeployment.
Update workflow public API access
OAuth login or personal API key required.
Arguments
Options
API request and response schemas: updateWorkflowPublicApi.
Show the health of every trigger the live deployment serves
Arguments
API request and response schemas: listWorkflowTriggers.
Enable or disable one trigger of the live deployment
Arguments
Options
API request and response schemas: updateWorkflowTrigger.
List workflow versions
Arguments
Options
API request and response schemas: listWorkflowVersions.
Get workflow version
Arguments
API request and response schemas: getWorkflowVersion.
Update workflow version
Arguments
Options
API request and response schemas: updateWorkflowVersion.
Compare workflow versions
Arguments
Options
API request and response schemas: compareWorkflowVersions.
Activate workflow version
OAuth login or personal API key required.
This changes which deployed version runs in production for every API and chat consumer.
Arguments
Options
API request and response schemas: activateWorkflowVersion.
Revert workflow to version
OAuth login or personal API key required.
This overwrites the draft graph with the selected version and cannot be undone.
Arguments
Options
API request and response schemas: revertWorkflowVersion.
Rollback workflow
OAuth login or personal API key required.
This changes which deployed version runs in production for every API and chat consumer.
Arguments
Options
API request and response schemas: rollbackWorkflow.
Take a workflow out of deployment
OAuth login or personal API key required.
This takes the workflow offline for every API and chat consumer, and agents calling its MCP tools lose access until it is deployed again.
Arguments
Options
API request and response schemas: undeployWorkflow.
Run and inspect
Run a deployed workflow, or its saved draft
Arguments
Options
Without --draft (or a flag that implies it) this runs the active deployment; a workflow never deployed has none. --deployment-version <n> runs that deployed version instead (it needs workspace write access, through a full-access API key or an OAuth token with api:write); the child workflows it calls still run their own active deployment. --draft runs the saved draft, as the source loop leaves it, sending its writes.
--dry runs the saved draft without its writes: each call that could change something (a write tool, any MCP call, an HTTP request other than GET/HEAD/OPTIONS, code's other fetches) gets a placeholder (ids like dry_run_row_1, numbers above 900000000) and is listed in sideEffects.stubbed with the request it would have sent; check those payloads. A read that would send a placeholder is held back too (reason placeholder), and an MCP call its server calls read-only says so (reason mcp-read-only). Reads, model calls and code run for real; code in a remote sandbox (shell, Python, imports) runs for real too, its network requests included, and is listed in sideEffects.unchecked. Child workflows run dry too; custom, Human in the loop and Wait blocks are answered whole, so the run never pauses. --allow <block> sends that block's writes for real (use a test resource). --mock <block>=<json> answers a block with fixed output, to steer a branch; --mock-from <runId> with a bare --mock <block> answers it with the output that run recorded. --allow and --mock also name a block of a workflow this one calls as <workflow>.<block>. --allow, --mock and --mock-from imply --dry; --draft sends every write, so it refuses them. Overrides the run never reached are listed in sideEffects.unreached, and mock fields a block never gets in sideEffects.mockFields. The API reference describes each list and refusal.
The result is the run: runId, status (completed, failed, paused or cancelled), error, output (the workflow's final output) and blockOutputs (what --select-output named). It has no success field: branch on status, or on the exit code. With --follow it is the stream's final frame instead: success and output.
A run that failed in a block has next: { command, reason }, the command that reruns the saved draft from that block (or the outermost loop or parallel holding it) with this run as --source-run. A dry run's keeps --dry and --allow, and reads its mocks again with --mock-from; a mock it cannot read again (a child's block, one never reached, or one passed beside --mock-from) is left out and named in nextNote, for you to pass again. A run paused for input has next: the runs resume command.
Exit codes: 0 completed or paused (--async: queued); 1 failed or cancelled (the result is printed first, then the error on stderr), or the command failed; 4 still running when --wait-timeout elapsed.
API request and response schemas: executeWorkflow.
List runs for a workflow
Options
API request and response schemas: listWorkflowRuns.
List runs waiting on human input across the workspace
Options
API request and response schemas: listPausedRuns.
Show run status
Requested outputs are included in JSON or YAML output.
Arguments
Options
API request and response schemas: getWorkflowRun.
Wait until a run finishes or needs input
Arguments
Options
Exit codes: 0 completed, 1 failed, 2 cancelled, 3 needs input, 4 timed out. Time-based pauses continue waiting; a human pause or an unspecified pause kind ends the wait with code 3. Use sim workflows runs resume with the pause context to continue.
API request and response schemas: getWorkflowRun.
Resume a paused run
Output is included in JSON or YAML output.
Arguments
Options
API request and response schemas: resumeWorkflow.
Cancel a running workflow run
Canceling a paused run prevents resuming that run. Starting a new run can repeat side effects already performed.
Arguments
Options
API request and response schemas: cancelWorkflowRun.
Chat deployments
Show a workflow’s chat deployment
OAuth login or personal API key required.
Arguments
API request and response schemas: getWorkflowChatDeployment.
Deploy or replace a workflow chat
OAuth login or personal API key required.
This replaces visitor access settings for the chat deployment. Omitted authentication fields reset to defaults, including the password and allowed-email list; avatar and welcome-message behavior follows their option descriptions.
Omitting --auth-type selects public access: anyone holding the URL can chat. Supply the complete password or allow-list settings again when replacing a restricted deployment.
Arguments
Options
API request and response schemas: replaceWorkflowChatDeployment.
Take a workflow’s chat deployment offline
OAuth login or personal API key required.
This takes the chat offline and frees its identifier. The workflow itself stays deployed and executable.
Arguments
Options
API request and response schemas: deleteWorkflowChatDeployment.
Export and import
Print a workflow as a portable JSON document
The export clears credentials, passwords, and table sub-block values, but it is not a general secret scanner. Inspect literal variables and inline configuration before sharing the document.
Arguments
Options
A table, child workflow, knowledge base or other workspace binding prints as its id; a credential always prints as null. For a copy to share outside this workspace, pass --no-include-workspace-bindings to clear the bindings too.
API request and response schemas: exportWorkflow.
Preview workflow import
Options
API request and response schemas: previewWorkflowImport.
Import workflow
Options
API request and response schemas: importWorkflow.
Folders
List workflow resources and child folders together
Arguments
Options
API request and response schemas: listWorkflows, listWorkflowFolders.
List workflow folders
Also available as sim workflows folders ls.
Options
API request and response schemas: listWorkflowFolders.
Create a workflow folder at a path
Arguments
API request and response schemas: createWorkflowFolder.
Delete workflow folder
This archives the workflow folder and, when recursive, everything inside it.
Arguments
Options
API request and response schemas: deleteWorkflowFolder.
Rename or move a workflow folder
Also available as sim workflows folders mv.
Arguments
API request and response schemas: relocateWorkflowFolder.
Create a workflow directory at a path
Arguments
API request and response schemas: createWorkflowFolder.
Workflows as code
Show a workflow’s draft as TypeScript source with its identity lock
Arguments
Options
Exit codes with --dir: 0 written; 1 the command failed, no workflow or several are named exactly the name given (WORKFLOW_NOT_FOUND, WORKFLOW_NAME_AMBIGUOUS: each candidate is listed with its id), the directory is a workspace source directory (SOURCE_DIR_KIND_MISMATCH, even with --force), or it holds another workflow's source (SOURCE_WORKFLOW_MISMATCH) or edits no apply has saved (SOURCE_LOCAL_EDITS: apply them, get into another directory, or pass --force); 7 the workflow is too large to print as source; 9 rate limited (HTTP 429) after the CLI's retries: wait a minute and run it again; 10 (busy, retry) another sim command is using --dir, or the workspace directory it is a workflow folder of (SOURCE_DIR_BUSY): nothing was read or written, run it again once the other finished; 13 not logged in, the login expired, or the server refused the credential (AUTH_REQUIRED): nothing was read or written, run sim login and the get again.
API request and response schemas: getWorkflowSource.
Show what changed locally and on the server since the directory was read
Options
With --json, plan is what applying would do as apply --dry --allow-delete reports it (its errors and warnings counted the same, a conflict as an error), and next the command to run (with --allow-delete only when the plan deletes something).
Exit codes: 0 clean (nothing to apply, and the server changed nothing since the directory was read); a server that cannot be reached is not a failure: the status shows the local changes only and says so (exit 0 or 11); 1 the command failed; 7 the source is too large for the server to read in one dry run; 9 rate limited (HTTP 429) after the CLI's retries: wait a minute and run it again; 10 (busy, retry) another sim command is using --dir, or the workspace directory it is a workflow folder of (SOURCE_DIR_BUSY): nothing was read or written, run it again once the other finished; 11 local changes only (applying writes them); 12 the server changed since the directory was read: drift (a resource edited, added or deleted there that the directory leaves alone) or a conflict (also changed here, so applying it is refused as stale), with or without local changes; 13 not logged in (AUTH_REQUIRED) or the credential was refused: the status shows the local changes only, then run sim login.
API request and response schemas: planWorkflowSource, getSourceResources.
Create a workflow from a workflow source directory
Options
Exit codes: 0 created (or a clean dry run, or a starter written); 1 the source has errors (each printed as file:line:column with its frame and hint), the workflow name is taken (SOURCE_NAME_TAKEN: pass --name), the --run test run did not complete (the workflow is created; nothing was deployed), or the command failed (a starter is created in the workspace its types were written for unless --workspace or SIM_WORKSPACE names another); 6 the folder is locked; 7 the source is too large; 9 rate limited (HTTP 429) after the CLI's retries, so nothing was created: wait a minute and run it again; 10 (busy, retry) another sim command is using --dir, or the workspace directory it is a workflow folder of (SOURCE_DIR_BUSY): nothing was read or written, run it again once the other finished; 13 not logged in, the login expired, or the server refused the credential (AUTH_REQUIRED): nothing was sent, run sim login (or fix or unset SIM_API_KEY when the key comes from it) and the command again; 14 without --yes and with no terminal to ask: the plan was printed with no errors and nothing was created (run the same command with --yes); 130 interrupted (Ctrl-C): a write already sent is finished and saved into the directory first, waiting up to 60s for its answer, and a second Ctrl-C, or no answer by then, stops at once and prints that it may have been written and how to check.
API request and response schemas: createWorkflowFromSource, getSourceCatalog, getSourceResources, deployWorkflow, getWorkflowDeployment, executeWorkflow.
Apply a workflow source directory to a workflow draft
Arguments
Options
Exit codes: 0 applied (or a clean dry run); 1 the source has errors (each printed as file:line:column with its frame and hint), the workflowId given is not the one .sim/base.json names (SOURCE_WORKFLOW_MISMATCH: the directory holds another workflow's source), the --run test run did not complete (the draft is saved; nothing was deployed), or the command failed; 5 the workflow changed since the directory was read (SOURCE_STALE, on a dry run too: get it again, reapply the edit, retry); 6 the workflow or its folder is locked (E_APPLY_LOCKED; a locked block exits 1, E_APPLY_LOCKED_BLOCK); 7 the source is too large; 9 rate limited (HTTP 429) after the CLI's retries, so nothing was written: wait a minute and run it again; 10 (busy, retry) another sim command is using --dir, or the workspace directory it is a workflow folder of (SOURCE_DIR_BUSY): nothing was read or written, run it again once the other finished; 13 not logged in, the login expired, or the server refused the credential (AUTH_REQUIRED): nothing was sent, run sim login (or fix or unset SIM_API_KEY when the key comes from it) and the command again; 14 without --yes and with no terminal to ask: the plan was printed with no errors and nothing was written (run the same command with --yes to apply it); 130 interrupted (Ctrl-C): a write already sent is finished and saved into the directory first, waiting up to 60s for its answer, and a second Ctrl-C, or no answer by then, stops at once and prints that it may have been written and how to check.
API request and response schemas: applyWorkflowSource, deployWorkflow, getWorkflowDeployment, getSourceResources, executeWorkflow.
Show the block catalog workflow source is checked against
Options
API request and response schemas: getSourceCatalog.
Compile and type-check a workflow source directory locally, without the server
Options
Compiles workflow.ts (and the function files it names) with the compiler the server runs, against the workspace's block catalog the last get or create cached, and prints the findings as the dry run does. No request is made to Sim. It covers the source itself (syntax, builders, params, references, wiring). In a workflow folder of a workspace directory (workflows/<key>), it reads the workspace's .sim/base.json and also checks env names, resource keys and table columns against what the directory declares. The dry run still checks what only the server knows (stored values, deployment), so run it before applying. A check also adds the blocks the source now uses to the CLI's tsconfig.json, so a block the edit added is typed; in a workspace directory it also regenerates .sim/sdk/workspace.d.ts from the files, so each key and workflow input they declare is. Then it type-checks the directory with TypeScript 7.0.2 (the release the declarations are built for) over tsconfig.json. Each type error is an E_TYPE error, its message starting with TypeScript's code. One is left out on a line the compile already reports an error on, and in a file still as the last get or apply wrote it when that file had the same error then (against the declarations as that get or apply left them). The first check installs that release with npm into the CLI's cache, once (none when SIM_TYPESCRIPT_DIR already holds it); when it cannot (offline, no npm), the check warns W_TYPES_UNCHECKED and passes or fails on the compile alone. --no-types skips the type check.
Exit codes: 0 no errors; 1 errors (each printed as file:line:column with its frame and hint), or no cached catalog (run the get once). With --output json, stdout is one document that also lists every finding under diagnostics.
These warnings, which an apply saves as written, fail the check as errors on every block the lock does not bind (a block added since the get, or every block of a new workflow): W_REQUIRED_MISSING, W_UNKNOWN_OPTION, W_UNKNOWN_OUTPUT_PATH, W_VALUE_KIND, W_OUT_OF_RANGE, W_LITERAL_SECRET, W_TABLE_UNKNOWN_COLUMN, W_CHILD_INPUT_UNKNOWN, W_CHILD_RESULT_PATH, W_BRANCH_UNWIRED, W_UNRESOLVED_REF, W_REF_OUT_OF_SCOPE, W_LOOP_CONDITION_SYNTAX. --strict fails on them in every block, except W_BRANCH_UNWIRED on a block the lock binds (the stored workflow may hold it, and the server then stays quiet); --no-strict fails on none of them. In every mode, as the server refuses them: W_REF_OUT_OF_SCOPE is the error E_APPLY_REF_OUT_OF_SCOPE in any file of a block the edit added or changed; W_LOOP_CONDITION_SYNTAX is the error E_APPLY_LOOP_CONDITION_SYNTAX in any file of a block the edit added or changed; W_UNKNOWN_OPTION is the error E_APPLY_INVALID_SUBBLOCK_FIELD in workflow.ts on a block the edit added or changed; W_UNKNOWN_OUTPUT_PATH is the error E_APPLY_UNRESOLVED_REF in workflow.ts on a block the edit added or changed; W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in workflow.ts on a block the edit added or changed; W_UNKNOWN_BLOCK_TYPE is the error E_APPLY_INVALID_BLOCK_TYPE in workflow.ts on a block the edit added or changed; W_TYPE_NOT_ADDABLE is the error E_APPLY_TYPE_NOT_ADDABLE in workflow.ts on a block the edit added or changed; W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in a function file changed since the get; W_UNKNOWN_OUTPUT_PATH is the error E_APPLY_UNRESOLVED_REF in a function file changed since the get; W_CODE_FILE_REF_SYNTAX is the error E_APPLY_CODE_FILE_REF_SYNTAX in a function file changed since the get. A block counts as changed when the lock does not bind it, when the source moved it into another container, or when it compiles differently than in the source the last get or apply printed (.sim/stored-edges.json records a digest of each block). That last comparison needs the catalog the source was printed with in the cache: without it, a bound block that did not move counts as unchanged, so the server may refuse what the check passes. A $ref in a function file to a block the lock binds that the source no longer declares stays a warning, unless a warning cap left findings out: the server may infer that block was renamed and rewrite the reference, and refuses it otherwise. W_JSON_REF_UNTYPED is reported, as the server reports it, only on a field the edit made store the reference anew: one whose text differs from what the printed source stored, through block renames, or where the reference was typed then, as when an edit elsewhere (a Start input, a Function's code) changes its type. Without the record or that catalog, it is reported on every block the edit added or changed; with --strict, on every block.
Exit 10 (busy, retry): another sim workspaces source or workflows source command is using this directory or a workflow folder in it (SOURCE_DIR_BUSY); nothing was read or written. Run this one again once it finished.
Show the content of the changes in a workflow source directory
Arguments
Options
Without --server, each file created, edited or deleted since the directory was read is shown against the text it was read at. The CLI records only each file's digest, so that text is the server's current text where it still matches the digest; a file the server changed since is named instead (compare it with --server). A binary file is shown by its sizes. Paths filter by file or folder (and in a workspace directory by kind:key, such as table:leads). Exit codes: 0 the differences were shown, whether or not there were any; 7 the source is too large for the server to read; 1 the command failed.
API request and response schemas: getWorkflowSource.
Print a block's declaration, edges and readers with line numbers
Offline.
Arguments
Options
Prints each block the name matches, read from the directory alone (no request is made): its declaration in workflow.ts with line numbers, its function file, the wiring statements of its incoming and outgoing edges, and every block that reads its outputs (a param, a branch, or a function file's $ref), each as file:line. <block> is a block name (Security Score), its key (securityscore) or its identifier (securityScore); with no exact match, every block whose name contains it is printed (at most 20). Run it from a workflow source directory, or pass --dir. When the source does not compile, readers are left out (JSON output carries compiles: false).
Exit codes: 0 printed; 1 no block matches (the closest name is suggested), or the directory is not a workflow source directory.
Print a builder's params and outputs from the cached block catalog
Offline.
Arguments
Options
Prints a builder in brief (an example call, the required params with types, the optional ones by name, the gate field that picks which others apply, and the outputs), from the block catalog the last get, create or check cached. --full prints every param with its type, enum, default and doc. A legacy builder names the one that replaces it. No request is made. <builder> is the dotted builder path as source writes it: table.upsertRow, agent, trigger.schedule, slack.sendMessage (slack.tool.sendMessage names the same builder). A namespace (gmail, trigger.gmail) lists its builders; a block type prints the builder written for it (function is fn) or lists them (table_v2); a construct core.d.ts declares (loop, parallel, t, env) prints its declaration. Run it from a workflow or workspace source directory, or pass --dir.
Exit codes: 0 printed; 1 no builder or namespace of that name (the closest one is named), or no cached catalog (run a get once).
List the tables, knowledge bases, credentials, workflows, skills, custom tools, MCP servers and env names source can name
API request and response schemas: getSourceResources.