Skip to content

Step: User Approval

  • Key: user-approval
  • Category: Workflow Control
  • Description: Pause Flow execution and wait for an approve or reject decision.

Inputs

  • message (long-text, required): Approval message shown to the user. Template variables are supported.

Resume Context

When the user decides, the Flow resumes with an approval object in context:

  • approval.decision: approve or reject.
  • approval.decidedAt: Decision timestamp.
  • approval.decidedBy: User name when available.
  • approval.message: Approval message shown during the pause.

Branching

  • Approve follows the step's default nextStepId.
  • Reject follows rejectNextStepId when configured. If no reject branch is configured, reject falls back to the default nextStepId.

Outputs

The step definition exposes these approval fields for downstream use:

  • decision (string): User decision.
  • decidedAt (date): Decision time.
  • decidedBy (string): User who made the decision.

In practice, use the approval.* context values after resume.

Notes

  • This step intentionally interrupts execution with a waiting state.
  • Programmatic executions can resume the waiting run with POST /v1/flowrun/resume/:appRunId and a body such as { "decision": "approve" }.
  • Peer/chat executions normally resume through the message approval UI.

Example

text
Message: Approve sending the quote for { {totalAmount} } to { {customer.email} }?

Approve branch: send email
Reject branch: final response saying the quote was not sent

Built with VitePress