Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
df75c6b
fix(workflow-code): a rename's reference rewrite is no edit for W_JSO…
waleedlatif1 Nov 20, 2026
06bae71
fix(sim-cli): source status lists the findings its plan counts
waleedlatif1 Nov 20, 2026
23ad3c9
fix(sim-cli): workflows deploy accepts -y/--yes as a no-op
waleedlatif1 Nov 20, 2026
312eb3a
docs(blocks): name the condition branch handles in its best practices
waleedlatif1 Nov 20, 2026
816c07c
fix(workflows): an edit's params.parentId moves the block into or out…
waleedlatif1 Nov 20, 2026
5ca8a66
fix(workflow-code): a dangling $ref the edit wrote into a function fi…
waleedlatif1 Nov 20, 2026
88296d2
fix(workflows): an edit's parentId never places a container inside it…
waleedlatif1 Nov 20, 2026
54e3dca
fix(workflows): an edit's parentId resolves a container the same batc…
waleedlatif1 Nov 20, 2026
a778b9e
fix(workflows): moving a block out of a nested container keeps its ca…
waleedlatif1 Nov 20, 2026
01e7371
fix(sim-cli): source status keeps the marker that its findings were t…
waleedlatif1 Nov 20, 2026
d243ec5
fix(workflow-code): a rename's reference rewrite applies every rename…
waleedlatif1 Nov 20, 2026
c2832a5
fix(sim-cli): an offline check treats a renamed function file as uned…
waleedlatif1 Nov 20, 2026
8c0c516
Merge remote-tracking branch 'origin/staging' into fix/workflow-code-…
waleedlatif1 Nov 20, 2026
3fb1f54
fix(workflow-code): a restored inactive value takes a chain or swap o…
waleedlatif1 Nov 20, 2026
82c37c6
fix(workflows): insert_into_subflow never places an existing containe…
waleedlatif1 Nov 20, 2026
77dde8a
Merge remote-tracking branch 'origin/staging' into fix/workflow-code-…
waleedlatif1 Nov 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions apps/docs/content/docs/cli/reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7746,7 +7746,7 @@ sim workflows operations apply <workflowId> [options]
| --- | --- | --- |
| `--dry-run` | No | Validate and lint without writing, auditing, or notifying collaborators. Returns the same validation, preparation warnings, lint findings, and ID-ownership conflicts (`409`) as a committed write. `needsRedeployment` describes the pre-write state. For semantic operations, `mintedBlockIds` is empty; `previewBlockIds` contains provisional IDs with a warning, since committing mints new IDs. |
| `--no-dry-run` | No | Send --dry-run as false. |
| `--operations <json\|@file>` | Yes | Edits to apply, in a single batch, keyed by operation_type: [&#123;"operation_type":"add","block_id":"my-fn","params":&#123;"type":"function","name":"My Fn","inputs":&#123;"code":"return &#123;ok:true&#125;"&#125;&#125;&#125;,&#123;"operation_type":"edit","block_id":"&lt;uuid&gt;","params":&#123;"name":"Renamed","connections":&#123;"success":"my-fn"&#125;&#125;&#125;,&#123;"operation_type":"delete","block_id":"&lt;uuid&gt;"&#125;]. Also extract_from_subflow, whose params carry &#123;"subflowId":"&lt;loop-id&gt;"&#125;, and insert_into_subflow, which creates a block and so takes an add’s params plus that subflowId (JSON, or @path / @- to read a file or stdin). |
| `--operations <json\|@file>` | Yes | Edits to apply, in a single batch, keyed by operation_type: [&#123;"operation_type":"add","block_id":"my-fn","params":&#123;"type":"function","name":"My Fn","inputs":&#123;"code":"return &#123;ok:true&#125;"&#125;&#125;&#125;,&#123;"operation_type":"edit","block_id":"&lt;uuid&gt;","params":&#123;"name":"Renamed","connections":&#123;"success":"my-fn"&#125;&#125;&#125;,&#123;"operation_type":"delete","block_id":"&lt;uuid&gt;"&#125;]. Also extract_from_subflow, whose params carry &#123;"subflowId":"&lt;loop-id&gt;"&#125;, and insert_into_subflow, which creates a block and so takes an add’s params plus that subflowId. To move an existing block into a loop or parallel (keeping its id), edit it with params &#123;"parentId":"&lt;loop-id&gt;"&#125;; &#123;"parentId":null&#125; moves it out (JSON, or @path / @- to read a file or stdin). |
| `--atomic` | No | Fail the whole batch when any operation is declined or any block input would be dropped. The default applies what it can and reports the rest in `skipped` and `inputValidationErrors`; `true` writes nothing and answers `409` instead. |
| `--no-atomic` | No | Send --atomic as false. |
| `--layout <value>` | No | Whether to reposition blocks the batch touched. `targeted` (default) nudges only the affected subgraph; `none` leaves every position exactly as supplied. Accepted values: `targeted`, `none`. |
Expand Down Expand Up @@ -8368,6 +8368,7 @@ sim workflows deploy <workflowId> [options]
| --- | --- | --- |
| `--name <value>` | No | Optional label for the deployment version. |
| `--description <value>` | No | Optional release note for the deployment version. |
| `-y, --yes` | No | Accepted and ignored: this command needs no confirmation. |

</CommandTable>

Expand Down Expand Up @@ -8639,7 +8640,7 @@ Compiles workflow.ts (and the function files it names) with the compiler the ser

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_BRANCH_UNWIRED, W_UNRESOLVED_REF. --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 never fails on a warning. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.
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_BRANCH_UNWIRED, W_UNRESOLVED_REF. --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 a function file changed since the get, W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in every mode, as the server refuses it. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.

### sim workflows source status

Expand Down Expand Up @@ -10017,7 +10018,7 @@ Compiles every workflows/&lt;key&gt;/workflow.ts (and the function files each na

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_BRANCH_UNWIRED, W_UNRESOLVED_REF. --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 never fails on a warning. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.
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_BRANCH_UNWIRED, W_UNRESOLVED_REF. --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 a function file changed since the get, W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in every mode, as the server refuses it. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.

Exit 10 (busy, retry): another sim workspaces source command is using this directory (SOURCE_DIR_BUSY); nothing was read or written. Run this one again once it finished.

Expand Down
5 changes: 3 additions & 2 deletions apps/docs/content/docs/cli/workflows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ sim workflows operations apply <workflowId> [options]
| --- | --- | --- |
| `--dry-run` | No | Validate and lint without writing, auditing, or notifying collaborators. Returns the same validation, preparation warnings, lint findings, and ID-ownership conflicts (`409`) as a committed write. `needsRedeployment` describes the pre-write state. For semantic operations, `mintedBlockIds` is empty; `previewBlockIds` contains provisional IDs with a warning, since committing mints new IDs. |
| `--no-dry-run` | No | Send --dry-run as false. |
| `--operations <json\|@file>` | Yes | Edits to apply, in a single batch, keyed by operation_type: [&#123;"operation_type":"add","block_id":"my-fn","params":&#123;"type":"function","name":"My Fn","inputs":&#123;"code":"return &#123;ok:true&#125;"&#125;&#125;&#125;,&#123;"operation_type":"edit","block_id":"&lt;uuid&gt;","params":&#123;"name":"Renamed","connections":&#123;"success":"my-fn"&#125;&#125;&#125;,&#123;"operation_type":"delete","block_id":"&lt;uuid&gt;"&#125;]. Also extract_from_subflow, whose params carry &#123;"subflowId":"&lt;loop-id&gt;"&#125;, and insert_into_subflow, which creates a block and so takes an add’s params plus that subflowId (JSON, or @path / @- to read a file or stdin). |
| `--operations <json\|@file>` | Yes | Edits to apply, in a single batch, keyed by operation_type: [&#123;"operation_type":"add","block_id":"my-fn","params":&#123;"type":"function","name":"My Fn","inputs":&#123;"code":"return &#123;ok:true&#125;"&#125;&#125;&#125;,&#123;"operation_type":"edit","block_id":"&lt;uuid&gt;","params":&#123;"name":"Renamed","connections":&#123;"success":"my-fn"&#125;&#125;&#125;,&#123;"operation_type":"delete","block_id":"&lt;uuid&gt;"&#125;]. Also extract_from_subflow, whose params carry &#123;"subflowId":"&lt;loop-id&gt;"&#125;, and insert_into_subflow, which creates a block and so takes an add’s params plus that subflowId. To move an existing block into a loop or parallel (keeping its id), edit it with params &#123;"parentId":"&lt;loop-id&gt;"&#125;; &#123;"parentId":null&#125; moves it out (JSON, or @path / @- to read a file or stdin). |
| `--atomic` | No | Fail the whole batch when any operation is declined or any block input would be dropped. The default applies what it can and reports the rest in `skipped` and `inputValidationErrors`; `true` writes nothing and answers `409` instead. |
| `--no-atomic` | No | Send --atomic as false. |
| `--layout <value>` | No | Whether to reposition blocks the batch touched. `targeted` (default) nudges only the affected subgraph; `none` leaves every position exactly as supplied. Accepted values: `targeted`, `none`. |
Expand Down Expand Up @@ -396,6 +396,7 @@ sim workflows deploy <workflowId> [options]
| --- | --- | --- |
| `--name <value>` | No | Optional label for the deployment version. |
| `--description <value>` | No | Optional release note for the deployment version. |
| `-y, --yes` | No | Accepted and ignored: this command needs no confirmation. |

</CommandTable>

Expand Down Expand Up @@ -1443,7 +1444,7 @@ Compiles workflow.ts (and the function files it names) with the compiler the ser

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_BRANCH_UNWIRED, W_UNRESOLVED_REF. --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 never fails on a warning. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.
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_BRANCH_UNWIRED, W_UNRESOLVED_REF. --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 a function file changed since the get, W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in every mode, as the server refuses it. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.

### Show the content of the changes in a workflow source directory

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/cli/workspaces.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ Compiles every workflows/&lt;key&gt;/workflow.ts (and the function files each na

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_BRANCH_UNWIRED, W_UNRESOLVED_REF. --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 never fails on a warning. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.
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_BRANCH_UNWIRED, W_UNRESOLVED_REF. --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 a function file changed since the get, W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in every mode, as the server refuses it. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.

Exit 10 (busy, retry): another sim workspaces source command is using this directory (SOURCE_DIR_BUSY); nothing was read or written. Run this one again once it finished.

Expand Down
8 changes: 7 additions & 1 deletion apps/docs/openapi-v2-workflows.json
Original file line number Diff line number Diff line change
Expand Up @@ -11980,7 +11980,7 @@
}
}
],
"description": "Patch only supplied fields: `inputs`, `name`, `connections`, `removeEdges`, `nestedNodes`, `retry`, `triggerMode`, and `advancedMode`. `inputs` maps sub-block ids directly to values, never through `subBlocks`. Keep `retry`, `triggerMode`, and `advancedMode` beside `inputs`. `connections` maps source handles to target ids, `{ block, handle }`, or arrays; `success` aliases `source`. Re-sending `connections` replaces outgoing edges; use `removeEdges` to delete selected edges."
"description": "Patch only supplied fields: `inputs`, `name`, `connections`, `removeEdges`, `nestedNodes`, `retry`, `triggerMode`, `advancedMode`, and `parentId`. `inputs` maps sub-block ids directly to values, never through `subBlocks`. Keep `retry`, `triggerMode`, and `advancedMode` beside `inputs`. `connections` maps source handles to target ids, `{ block, handle }`, or arrays; `success` aliases `source`. Re-sending `connections` replaces outgoing edges; use `removeEdges` to delete selected edges. `parentId` moves the block, keeping its id, into the loop or parallel it names, or with `null` out of its container."
}
},
"required": ["operation_type", "block_id", "params"],
Expand Down Expand Up @@ -18918,6 +18918,7 @@
"W_APPLY_CATALOG_MOVED",
"W_APPLY_PROBABLE_RENAME",
"E_APPLY_LINT",
"E_APPLY_UNRESOLVED_REF",
"W_APPLY_LINT",
"W_TABLE_UNKNOWN_COLUMN",
"E_APPLY_INVALID_SCHEDULE",
Expand Down Expand Up @@ -19362,6 +19363,7 @@
"W_APPLY_CATALOG_MOVED",
"W_APPLY_PROBABLE_RENAME",
"E_APPLY_LINT",
"E_APPLY_UNRESOLVED_REF",
"W_APPLY_LINT",
"W_TABLE_UNKNOWN_COLUMN",
"E_APPLY_INVALID_SCHEDULE",
Expand Down Expand Up @@ -20323,6 +20325,7 @@
"W_APPLY_CATALOG_MOVED",
"W_APPLY_PROBABLE_RENAME",
"E_APPLY_LINT",
"E_APPLY_UNRESOLVED_REF",
"W_APPLY_LINT",
"W_TABLE_UNKNOWN_COLUMN",
"E_APPLY_INVALID_SCHEDULE",
Expand Down Expand Up @@ -25365,6 +25368,7 @@
"W_APPLY_CATALOG_MOVED",
"W_APPLY_PROBABLE_RENAME",
"E_APPLY_LINT",
"E_APPLY_UNRESOLVED_REF",
"W_APPLY_LINT",
"W_TABLE_UNKNOWN_COLUMN",
"E_APPLY_INVALID_SCHEDULE",
Expand Down Expand Up @@ -25931,6 +25935,7 @@
"W_APPLY_CATALOG_MOVED",
"W_APPLY_PROBABLE_RENAME",
"E_APPLY_LINT",
"E_APPLY_UNRESOLVED_REF",
"W_APPLY_LINT",
"W_TABLE_UNKNOWN_COLUMN",
"E_APPLY_INVALID_SCHEDULE",
Expand Down Expand Up @@ -26340,6 +26345,7 @@
"W_APPLY_CATALOG_MOVED",
"W_APPLY_PROBABLE_RENAME",
"E_APPLY_LINT",
"E_APPLY_UNRESOLVED_REF",
"W_APPLY_LINT",
"W_TABLE_UNKNOWN_COLUMN",
"E_APPLY_INVALID_SCHEDULE",
Expand Down
1 change: 1 addition & 0 deletions apps/sim/blocks/blocks/condition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const ConditionBlock: BlockConfig = {
bestPractices: `
- Write the conditions using standard javascript syntax except referencing the outputs of previous blocks using <> syntax, and keep them as simple as possible. No hacky fallbacks.
- Can reference workflow variables using <blockName.output> syntax as usual within conditions.
- Branch handles (a connection's source handle in workflow operations): \`if\` for the first condition, \`else-if-0\`, \`else-if-1\`, … for each else-if in order, and \`else\`. Workflow source names each branch by its key instead (\`x.<key>.to(...)\`).
`,
docsLink: 'https://docs.sim.ai/workflows/blocks/condition',
bgColor: '#FF752F',
Expand Down
6 changes: 4 additions & 2 deletions apps/sim/lib/api/contracts/v2/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3908,8 +3908,10 @@ const v2WorkflowOperationParamsSchema = z
)
.describe(
'Patch only supplied fields: `inputs`, `name`, `connections`, `removeEdges`, `nestedNodes`, ' +
`\`retry\`, \`triggerMode\`, and \`advancedMode\`. ${WORKFLOW_OPERATION_PARAM_ENVELOPE} ` +
'Re-sending `connections` replaces outgoing edges; use `removeEdges` to delete selected edges.'
`\`retry\`, \`triggerMode\`, \`advancedMode\`, and \`parentId\`. ${WORKFLOW_OPERATION_PARAM_ENVELOPE} ` +
'Re-sending `connections` replaces outgoing edges; use `removeEdges` to delete selected edges. ' +
'`parentId` moves the block, keeping its id, into the loop or parallel it names, or with ' +
'`null` out of its container.'
)

const v2AddWorkflowBlockParamsSchema = z
Expand Down
Loading
Loading