Human-in-the-Loop

Approval Workflows

Pause automated execution and wait for human approval before proceeding. Ideal for sensitive actions like sending emails, publishing content, or triggering downstream systems.

How It Works

When a workflow reaches an Approval node, the runner marks the task as pending_approval and stops execution. The task remains in this state until a user explicitly approves or rejects it via the UI or API. Upon approval, execution resumes from the next step. Upon rejection, the task is marked as rejected and no further steps run.

Pending Approval

Task status becomes pending_approval. The step result includes requiresApproval: true.

Paused Execution

No subsequent steps run until a decision is made. Previous step outputs are preserved.

Resume or Reject

Approval resumes execution from the next step. Rejection marks the task as rejected.

Approval Node Configuration

The approval node requires a message displayed to the approver.

approval-node.json
{
  "type": "approval",
  "approvalMessage": "Approve sending the weekly report to 500 customers?",
  "stepId": "approve_send_email"
}

Approval API

POST/api/tasks/:id/approve

Approve a pending_approval task. Execution resumes from the next step.

POST/api/tasks/:id/reject

Reject a pending_approval task. The task status becomes rejected and execution stops.

POST/api/tasks/:id/resume

Resume a paused task. Used after approval to continue execution.

Task States

pending_approvalWorkflow paused at an approval node, waiting for human decision.
rejectedApproval was rejected. Task ends without executing remaining steps.

UI Behavior

  • Tasks with status pending_approval appear in the Tasks page with an approval action button.
  • The task detail view shows the approval message and the step that requested approval.
  • After approval, the runner picks up the resumed task and continues from the next step.