Concepts

Human approval

Pause a run at any step until a person approves or rejects it — then branch on the decision.


How it works

Drop an Approval node (logic.approval) where a person should decide — before a refund, an outgoing email, a contract going out. When the run reaches it, the run pauses and waits.

The node has two outputs, approved and rejected, so the rest of the workflow branches on the decision. Both carry { approved, note, input } — the reviewer’s note and the data that arrived at the node.

Getting someone’s attention

Set Notify webhook URL — for example a Slack or Discord incoming webhook — and the node POSTs this the moment the run pauses:

json
{
  "event": "approval.pending",
  "executionId": "<execution-id>",
  "nodeId": "<node-id>",
  "message": "Approve refund of 120 EUR?"
}

The Message parameter supports expressions, so it can quote the data being approved. A failed notification is logged and never blocks the wait.

Approving or rejecting

In DirectStudio, a paused run’s execution page shows an Approve / Reject card. From a script or another system:

bash
curl -X POST https://api.directos.dev/api/executions/<execution-id>/nodes/<node-id>/resume \
  -H "authorization: Bearer $DIRECTOS_KEY" \
  -H 'content-type: application/json' \
  -d '{"approved": true, "note": "Checked with finance"}'

Deciding needs an editor role. GET /executions/:id/pending-approvals lists the nodes a run is currently waiting on.