Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .agents/skills/add-integration/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ If creating V2 versions (API-aligned outputs):
- [ ] Verified `tools.config.params` correctly maps and coerces all param types
- [ ] Verified every tool output and `transformResponse` path against documented or live-verified JSON responses
- [ ] If any response schema remained unknown, explicitly told the user instead of guessing
- [ ] Ran the block in a workflow with `sim workflows run <workflowId> --dry`: each write is in `sideEffects.stubbed` (at most 50 entries; the rest are counted in `sideEffects.omitted.stubbed`) with the documented request where `request` is not `null` (null: the run could not vouch it was free of secrets, or could not build it once they were masked), and each read ran for real; a write absent from `stubbed` counts only if its block ran (not on an untaken branch or `--mock`ed) (send one write for real only with `--allow <block>` against a test resource)
- [ ] `{Service}BlockMeta` exported with at least 7 templates, each having `icon`, `title`, `prompt`, `modules`, `category`, and `tags`

## File Handling
Expand Down
14 changes: 14 additions & 0 deletions .agents/skills/add-tools/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,20 @@ search that returns no email or phone, and an email verifier.
`read`, fails the audit unless the `effect` line carries `// tool-effect: <reason>` on one of the
two lines above it; use it only for a genuine exception such as a GET that writes in `postProcess`.
- A factory that builds tools from definitions takes `effect` per definition and passes it through.
- Prove the labels with a dry run, against a test account or test resource (a `read` runs for real,
so a write mislabelled `read` is sent): put the block in a workflow and run
`sim workflows run <workflowId> --dry --input '{…}'`. Each `write` call must appear in the result's
`sideEffects.stubbed` with the request you expect (an HTTP tool's `method`, `url` and `body`, or an
Comment thread
waleedlatif1 marked this conversation as resolved.
Resolved
in-process operation's input, credentials redacted), and each `read` must run for real and return
live data; a read listed there is labelled `write`. A write missing from `stubbed` may not have
been reached (an untaken branch, or a block answered by `--mock`), so first confirm its block ran
in the trace: a reached write is absent only when its block was `--allow`ed and sent it for real,
so a reached, unallowed write missing from `stubbed` is labelled `read`. `stubbed` keeps at most
50 entries and counts the rest in `sideEffects.omitted.stubbed`, so a write past the cap is
counted, not missing: test one tool per run, or few enough to fit. An entry's `request` is `null`
when the run cannot vouch that no secret remains in it, or cannot build it once secrets are
masked (a URL that is wholly a secret); then check the tool label alone and compare the request
fields only on entries that carry one.

## Critical Rules for Parameters

Expand Down
6 changes: 6 additions & 0 deletions .agents/skills/validate-integration/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ For **every** tool file, check:
`add-tools` → Declaring the effect)
- [ ] Any `// tool-effect: <reason>` sits on a genuine verb/label exception, and
`bun run check:tool-effects` passes
- [ ] A dry run (`sim workflows run <workflowId> --dry --input '{…}'` on a workflow using the
block) lists every write operation in `sideEffects.stubbed` (at most 50 entries; the rest
are counted in `sideEffects.omitted.stubbed`) with the request the API docs expect where
`request` is not `null`, and every read runs for real; a write absent from `stubbed` counts
only if its block ran (not on an untaken branch or `--mock`ed) (rules: `add-tools` →
Declaring the effect)

### Params
- [ ] All required API params are marked `required: true`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,20 @@ Apply without `dryRun`. Set `atomic: true` in the body to write nothing when any

## 7. Test the draft [#test-run]

Run the saved draft with `run.source: "manual"`. Manual runs are synchronous or streamed, never `async`.
Run the saved draft with `run.source: "manual"` and `run.dry: true`. A dry run sends no writes: every tool call not declared `read` (table writes, sends, HTTP calls, custom and MCP tools) returns a placeholder shaped like the tool's output, and the result lists it under `sideEffects.stubbed` with the request it would have sent, credentials, secrets and password fields redacted. Check those payloads instead of cleaning up test data. Reads and model calls run for real, child workflows run dry too, and custom blocks are answered whole. Code runs for real (a Function block's, a Condition's expressions, a While or Do While loop's condition, or code an Agent's model writes) and is listed under `sideEffects.unchecked`. A dry run keeps nothing beyond its own log, which is under the `test` trigger: Agents read their memory but write none, and it raises no workspace event and does not count as a run of the workflow. Human in the loop and Wait blocks are answered whole, so a dry run never pauses, and a test run is never resumed. A failed dry run still returns its `sideEffects`, and only another dry run can use it, or a workflow test's run, as `run.entry.sourceRunId`. Allowing an Agent with `run.allowBlocks` sends only its own tool calls, not a workflow or custom block it calls. A mock is data: it cannot replace a locked block or set a field the run's execution, trace or billing reads (such as `cost`, `tokens`, `model` or a field starting with `_`), and the run records only which blocks were mocked, so a rerun passes `run.mocks` again, while the run's log shows a mocked block's output like any other block's. `run.mocks` names at most 50 blocks. Manual runs are synchronous or streamed, never `async`; a dry run is synchronous only.

<Tabs items={['curl', 'CLI']}>
<Tab value="curl">
```bash
curl -sS --fail-with-body -X POST \
"$BASE_URL/api/v2/workflows/$WORKFLOW_ID/execute" \
-H "X-API-Key: $SIM_API_KEY" -H 'Content-Type: application/json' \
-d '{"run": {"source": "manual"}, "input": {"ticketId": "T-123"}}'
-d '{"run": {"source": "manual", "dry": true}, "input": {"ticketId": "T-123"}}'
```
</Tab>
<Tab value="CLI">
```bash
sim workflows run "$WORKFLOW_ID" --manual --input '{"ticketId": "T-123"}'
sim workflows run "$WORKFLOW_ID" --dry --input '{"ticketId": "T-123"}'
```
</Tab>
</Tabs>
Expand All @@ -193,6 +193,9 @@ Narrow a test run with these options:
| Stop after one block | `run.stopAfterBlockId` | `--stop-after <blockId>` |
| Rerun from a block, reusing an earlier run's upstream outputs | `run.entry: {type: "block", blockId, sourceRunId}` | `--from-block <blockId> --source-run <runId>` |
| Rerun one block only | Block entry plus `stopAfterBlockId` naming the same block | `--from-block` and `--stop-after` with the same block |
| Send one block's writes for real during a dry run | `run.allowBlocks: ["<block>"]` | `--allow <block>` |
| Answer a block with a fixed output during a dry run, to steer a branch | `run.mocks: {"<block>": {...}}` | `--mock <block>='{...}'` |
| Run everything for real | omit `run.dry` | `--manual` |

`stopAfterBlockId` cannot name a block inside a loop or parallel. A run that routes away from the stop block fails as soon as that is decided.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/cli/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ b8c0d247-9e13-4a86-97f5-2ad4e1638c09 Weekly digest /Reporting no 18
sim workflows run 3a9e21d8-5f47-4c0b-b2ea-91d7c6034ef8 --input '{"ticketId":"T-4821"}'
```

Ordinary execution runs the active deployment. Deploy from the workflow builder or with `sim workflows deploy <workflowId>`. To execute the current saved workflow state, use `sim workflows run <workflowId> --manual`.
Ordinary execution runs the active deployment. Deploy from the workflow builder or with `sim workflows deploy <workflowId>`. To execute the current saved workflow state, use `sim workflows run <workflowId> --manual`. To test it without sending its writes, use `--dry`: each write is answered with a placeholder and listed with its request under `sideEffects` in the result.

## How commands are shaped

Expand Down
7 changes: 6 additions & 1 deletion apps/docs/content/docs/cli/reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8516,6 +8516,9 @@ sim workflows run <workflowId> [options]
| `--base64-max-bytes <value>` | No | Maximum total bytes of file content to inline as base64, lowering but never raising the server limit of 16 MiB. Rejected when `async` is true. |
| `--run-id <value>` | No | One-shot identifier for this run; NOT an idempotency key — reusing a claimed value fails with RUN_ID_CONFLICT instead of replaying the first result, and a fresh value starts another run. |
| `--manual` | No | Run the current saved workflow state instead of the active deployment. |
| `--dry` | No | Dry run of the saved draft (implies --manual): writes are not sent but answered with placeholders and listed with their request payloads in sideEffects; reads, model calls and code run for real. Logged as a test run. Not with --follow, --async or --wait-timeout. |
| `--allow <block>` | No | Send this block's writes for real during a --dry run (its id, display name or key); for an Agent, only its own tool calls, not a workflow or custom block it calls; repeatable. |
| `--mock <block>=<json\|@file>` | No | Answer this block with the given JSON object instead of running it during a --dry run (its id, display name or key), to steer a branch or give a stubbed write a realistic result. Not a locked block; data only, so no cost, tokens, model or other field the run’s trace or billing reads, and no field starting with _. The run records only which blocks were mocked, so a rerun passes it again (its log shows the output like any other block’s); repeatable. |
| `--trigger <blockId>` | No | Enter the run through this runnable trigger, by its block id; runs the current saved workflow state (implies --manual). |
| `--mock-payload` | No | Use the selected trigger's server-derived mock payload; runs the current saved workflow state (implies --manual). |
| `--from-block <block>` | No | Rerun the saved draft from this block (its id, display name or key), reusing the outputs --source-run produced before it; a failed run prints this command as next. |
Expand All @@ -8531,9 +8534,11 @@ sim workflows run <workflowId> [options]

Without --manual (or a flag that implies it) this runs the active deployment; a workflow never deployed has none. --manual runs the saved draft, as the source loop leaves it.

--dry runs the saved draft without its side effects: every tool call not declared read (sends, table writes, HTTP calls, custom and MCP tools) returns a placeholder and is listed in sideEffects.stubbed with the request it would have sent; check those payloads. Code (a Function block's, a Condition's expressions, a While or Do While loop's condition, or code an Agent's model writes) runs 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. Agents read memory but write none, and the run raises no workspace event. --allow &lt;block&gt; sends that block's writes for real (use a test resource); allowing an Agent sends only its own tool calls, not a workflow or custom block it calls. --mock &lt;block&gt;=&lt;json&gt; answers a block with fixed output, to steer a branch; a locked block cannot be mocked, and a mock is data, so it cannot set a field the run's execution, trace or billing reads (such as cost, tokens, model or a field starting with _). A dry run is the --source-run only of another dry run, and is never resumed.

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: the command that reruns the saved draft from that block (or from the outermost loop or parallel holding it) with this run as --source-run, so after a fix only that block and those after it run again. Add --stop-after &lt;block&gt; to stop after a block; naming the block next starts from reruns only it.
A run that failed in a block has next: the command that reruns the saved draft from that block (or from the outermost loop or parallel holding it) with this run as --source-run, so after a fix only that block and those after it run again; a dry run's keeps --dry and --allow. The run records only which blocks were mocked, so pass each --mock again; its log shows a mocked block's output like any other. Add --stop-after &lt;block&gt; to stop after a block; naming the block next starts from reruns only it.

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.

Expand Down
7 changes: 6 additions & 1 deletion apps/docs/content/docs/cli/workflows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,9 @@ sim workflows run <workflowId> [options]
| `--base64-max-bytes <value>` | No | Maximum total bytes of file content to inline as base64, lowering but never raising the server limit of 16 MiB. Rejected when `async` is true. |
| `--run-id <value>` | No | One-shot identifier for this run; NOT an idempotency key — reusing a claimed value fails with RUN_ID_CONFLICT instead of replaying the first result, and a fresh value starts another run. |
| `--manual` | No | Run the current saved workflow state instead of the active deployment. |
| `--dry` | No | Dry run of the saved draft (implies --manual): writes are not sent but answered with placeholders and listed with their request payloads in sideEffects; reads, model calls and code run for real. Logged as a test run. Not with --follow, --async or --wait-timeout. |
| `--allow <block>` | No | Send this block's writes for real during a --dry run (its id, display name or key); for an Agent, only its own tool calls, not a workflow or custom block it calls; repeatable. |
| `--mock <block>=<json\|@file>` | No | Answer this block with the given JSON object instead of running it during a --dry run (its id, display name or key), to steer a branch or give a stubbed write a realistic result. Not a locked block; data only, so no cost, tokens, model or other field the run’s trace or billing reads, and no field starting with _. The run records only which blocks were mocked, so a rerun passes it again (its log shows the output like any other block’s); repeatable. |
| `--trigger <blockId>` | No | Enter the run through this runnable trigger, by its block id; runs the current saved workflow state (implies --manual). |
| `--mock-payload` | No | Use the selected trigger's server-derived mock payload; runs the current saved workflow state (implies --manual). |
| `--from-block <block>` | No | Rerun the saved draft from this block (its id, display name or key), reusing the outputs --source-run produced before it; a failed run prints this command as next. |
Expand All @@ -848,9 +851,11 @@ sim workflows run <workflowId> [options]

Without --manual (or a flag that implies it) this runs the active deployment; a workflow never deployed has none. --manual runs the saved draft, as the source loop leaves it.

--dry runs the saved draft without its side effects: every tool call not declared read (sends, table writes, HTTP calls, custom and MCP tools) returns a placeholder and is listed in sideEffects.stubbed with the request it would have sent; check those payloads. Code (a Function block's, a Condition's expressions, a While or Do While loop's condition, or code an Agent's model writes) runs 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. Agents read memory but write none, and the run raises no workspace event. --allow &lt;block&gt; sends that block's writes for real (use a test resource); allowing an Agent sends only its own tool calls, not a workflow or custom block it calls. --mock &lt;block&gt;=&lt;json&gt; answers a block with fixed output, to steer a branch; a locked block cannot be mocked, and a mock is data, so it cannot set a field the run's execution, trace or billing reads (such as cost, tokens, model or a field starting with _). A dry run is the --source-run only of another dry run, and is never resumed.

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: the command that reruns the saved draft from that block (or from the outermost loop or parallel holding it) with this run as --source-run, so after a fix only that block and those after it run again. Add --stop-after &lt;block&gt; to stop after a block; naming the block next starts from reruns only it.
A run that failed in a block has next: the command that reruns the saved draft from that block (or from the outermost loop or parallel holding it) with this run as --source-run, so after a fix only that block and those after it run again; a dry run's keeps --dry and --allow. The run records only which blocks were mocked, so pass each --mock again; its log shows a mocked block's output like any other. Add --stop-after &lt;block&gt; to stop after a block; naming the block next starts from reruns only it.

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.

Expand Down
4 changes: 3 additions & 1 deletion apps/docs/content/docs/workflows/code/coding-agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ Point the agent at `.sim/AGENTS.md` before it edits.
3. Run one chained command, then fix whatever it reports in the next step:

```bash
sim workflows source check --dir <dir> && sim workflows source apply --dir <dir> --yes && sim workflows run <workflowId> --manual --input '{...}'
sim workflows source check --dir <dir> && sim workflows source apply --dir <dir> --yes && sim workflows run <workflowId> --dry --input '{...}'
```

A non-zero exit code stops the chain at the first failure. `apply` compiles the source and compares it with the saved draft again, so an agent can skip `--dry-run`. `check` also type-checks the directory, so the chain needs no separate `tsc`. People and CI use `apply --dry-run` to review the plan, and `status` shows what changed and what to run next.

`run --dry` tests the saved draft without sending its writes: each write returns a placeholder and is listed under `sideEffects` with the request it would have sent, so the agent checks payloads instead of cleaning up rows or messages. `--allow <block>` sends one block's writes for real against a test resource, and `--manual` runs everything for real.

For a whole workspace, use `sim workspaces source` with the same steps; see [Manage a workspace as code](/workflows/code/workspace).

## Look things up
Expand Down
Loading
Loading