const step = run.data.steps.find((s) => s.status === "waiting");
await run.resume(step.id, { approved: true, note: "Checked the figures." });
// Downstream steps can read {{steps.<id>.output.approved}}step = next(s for s in run.data["steps"] if s["status"] == "waiting")
run.resume(step["id"], {"approved": True, "note": "Checked the figures."})
# Downstream steps can read {{steps.<id>.output.approved}}stepIdstringrequiredThe waiting step.
dataobject{}Becomes the step's output, readable by the rest of the chain.
Why human steps exist
A workflow runs with nobody watching, so those three cannot be asked about during the run. The approval is required in the graph instead, and a definition without it is refused when it is saved.
The data is part of the chain
It is not just a yes. A reviewer can change a subject line, pick a recipient, choose a branch — and the steps after it read those values through templates, the same as any other step's output.
// The human step
{ id: "approve", type: "human", config: { title: "Send this?" } }
// A step after it
{ id: "send", type: "mail.send", config: {
box: "ops@example.com",
to: "{{steps.approve.output.recipient}}",
subject: "{{steps.approve.output.subject}}",
text: "{{steps.draft.output.text}}" } }# The human step
{"id": "approve", "type": "human", "config": {"title": "Send this?"}}
# A step after it
{"id": "send", "type": "mail.send", "config": {
"box": "ops@example.com",
"to": "{{steps.approve.output.recipient}}",
"subject": "{{steps.approve.output.subject}}",
"text": "{{steps.draft.output.text}}"}}Errors
| Code | When |
|---|---|
| run_not_waiting | The run is not stopped at a human step. |
| step_not_found | No such step in this run. |
It can be approved from anywhere
getRun(runId) gives a full run object from the identifier alone — so an approval interface needs nothing but the id.