Skip to main content
Not every workflow should run end-to-end without a human checkpoint. You might need a content reviewer to approve a draft before it gets published, a manager to sign off on an automated decision, or a developer to verify a generated migration script before it runs. dagraph provides two node types for human-in-the-loop control: 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

1

Start the run

Run the workflow with your input. The DAG executes the draft node, then pauses at review.
The CLI prints the run ID and exits, noting the gate is awaiting approval:
2

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.
3

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.
4

Resume the run

Once approved, resume execution from where it paused. dagraph skips all already-completed nodes and picks up at social_post:
You can also use the shorthand resume command:

Approval decision as a template variable

When a gate is approved, dagraph writes a JSON artifact to the review node containing the decision metadata. Downstream nodes can reference this via {{ review }}:
Use this in a downstream prompt to include reviewer context:

Gate timeouts

Set timeout_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:
When the scheduler resumes a run and discovers the gate has expired, it marks the gate as 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: Respond to a paused user_input node:
Then resume the run as normal:

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.