Skip to content

Commit c7bd750

Browse files
committed
docs(workflow-code): status asks with a plan read, and a paused v2 run names the run to resume in paused
1 parent ef19cfb commit c7bd750

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎apps/docs/content/docs/workflows/blocks/human-in-the-loop.mdx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ HITL blocks are excluded from the selected-output picker because pause data is i
7676

7777
## Resume with the v2 API
7878

79-
A v2 execute call can return `data.status: "paused"`. Read `contextId` from `data.output.data._resume` and the paused run's ID from `data.runId`:
79+
A v2 execute call can return `data.status: "paused"`. Read the run to resume from `data.paused.runId`, and the `contextId` of a waiting `human` point from `data.paused.points`:
8080

8181
```bash
8282
curl -X POST 'https://www.sim.ai/api/v2/workflows/WORKFLOW_ID/runs/RUN_ID/resume' \
@@ -102,12 +102,13 @@ For an originally synchronous run, the response waits for the resumed execution
102102
"error": null,
103103
"startedAt": "2026-10-13T10:00:00.000Z",
104104
"endedAt": "2026-10-13T10:00:01.234Z",
105-
"durationMs": 1234
105+
"durationMs": 1234,
106+
"paused": null
106107
}
107108
}
108109
```
109110

110-
A later Human block can pause the resumed run again, returning new pause data. The resumed attempt has its own `runId`.
111+
A later Human block can pause the resumed run again. The response then has `status: "paused"` and new `paused.points`, and `paused.runId` names the run to resume next: the run you resumed, not the attempt's own `runId`.
111112

112113
### Asynchronous and originally streaming runs
113114

‎apps/docs/content/docs/workflows/code/edit.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ sim workflows source status --dir ./support-triage
4646
sim workflows source diff --dir ./support-triage
4747
```
4848

49-
`status` lists the files you created, edited, or deleted, asks the server (with a dry run that saves nothing) whether the workflow changed since the `get`, and ends with the one command to run next. It exits `0` when nothing changed, `11` when only your edits are unsaved, and `12` when the workflow changed in the workflow builder since the `get` (a conflict, if you edited it too). Without a connection it shows your edits only and says so; `--offline` skips the server. `diff` prints each edit as a unified diff, and `diff --server` compares the directory with the workflow as it is saved now. Both take `--json` (or `--output json`).
49+
`status` lists the files you created, edited, or deleted, asks the server (with a plan read that saves nothing) whether the workflow changed since the `get`, and ends with the one command to run next. It exits `0` when nothing changed, `11` when only your edits are unsaved, and `12` when the workflow changed in the workflow builder since the `get` (a conflict, if you edited it too). Without a connection it shows your edits only and says so; `--offline` skips the server. `diff` prints each edit as a unified diff, and `diff --server` compares the directory with the workflow as it is saved now. Both take `--json` (or `--output json`).
5050

5151
## 4. Dry run
5252

‎apps/docs/content/docs/workflows/code/how-it-works.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Sim also stores each block's `const` name, its order in the file and its comment
5757
- the same: the apply goes ahead;
5858
- different: someone saved the workflow since you read it. The apply is refused as stale with exit `5`, on a dry run too, and nothing is written; [Troubleshooting](/workflows/code/troubleshooting#exit-5) has the steps.
5959

60-
The check is made again inside the write's transaction, so two applies that race cannot both win. `status` asks the same question with a dry run and reports it as drift (exit `12`) before you apply.
60+
The check is made again inside the write's transaction, so two applies that race cannot both win. `status` asks the same question with a plan read that saves nothing and reports it as drift (exit `12`) before you apply.
6161

6262
The base also records the block catalog you read against. When a compile fails and the catalog changed since, for example after a block gained a setting, the apply adds `W_APPLY_CATALOG_MOVED`: run `get` again to pick up the new types.
6363

0 commit comments

Comments
 (0)