approval_gate pauses the run until someone explicitly approves or rejects, and user_input pauses to collect a free-form response. This guide covers both.
The approval_gate node
An approval_gate node pauses the entire run at that point. The workflow writes all upstream artifacts, then exits with status paused. No downstream nodes execute until a human approves (or rejects) the gate via the CLI.
Here is the complete approval_flow.yaml example — an AI drafts an announcement, a human reviews it, and a second agent condenses it into a social post only after approval:
Full approval walkthrough
Start the run
Run the workflow with your input. The DAG executes the The CLI prints the run ID and exits, noting the gate is awaiting approval:
draft node, then pauses at review.Inspect the draft
Read the upstream artifact before deciding:This prints the full text of the
draft node’s output so you can review it before approving.Approve or reject
To approve the draft:To reject with a reason:
A rejection sets the
review node to failed, which also fails any downstream nodes that depend on it — including social_post. The run ends at that point. Fix and re-run with a new run ID to start fresh.Approval decision as a template variable
When a gate is approved, dagraph writes a JSON artifact to thereview node containing the decision metadata. Downstream nodes can reference this via {{ review }}:
Gate timeouts
Settimeout_seconds on any approval_gate to automatically fail the gate if it hasn’t been acted on within the window. This prevents workflows from sitting paused indefinitely in production:
failed and the run ends.
Collecting free-form input with user_input
Use a user_input node when you want to inject a human-provided value into the DAG rather than a binary approve/reject decision. The workflow pauses until someone responds via the CLI.
input_type accepts three values:
| Type | Description |
|---|---|
text | Any string |
select | One of the values in options |
confirm | A yes/no boolean (yes, no, true, false, y, n) |
user_input node:
Parallel agents
Build fan-out/fan-in DAGs that run multiple agents simultaneously.
Scheduling and webhooks
Trigger approval-gated workflows on a schedule or via HTTP webhook.