Workflow approvals let you pause a workflow at a specific step and wait for a human to approve it before continuing. This is useful for deployment gates, compliance reviews, content approval, and any process that requires human judgment.Documentation Index
Fetch the complete documentation index at: https://docs.strait.dev/llms.txt
Use this file to discover all available pages before exploring further.
How Approvals Work
- Step Configuration: A workflow step is configured with
type: "approval"and a list of authorized approvers. - Approval Request: When the workflow engine reaches that step, it creates a
WorkflowStepApprovalrecord and pauses the step inwaiting_for_approvalstatus. - Timeout: If
approval_timeout_secsis configured, the approval automatically expires if no action is taken within the window. - Human Action: An authorized approver calls the approve API endpoint.
- Resumption: Once approved, the step completes and the workflow engine triggers downstream dependent steps.
Defining an Approval Step
When creating a workflow, add a step withtype: "approval":
Approval Step Fields
| Field | Type | Required | Description |
|---|---|---|---|
step_ref | string | Yes | Unique reference name for the step |
type | string | Yes | Must be "approval" |
approval_approvers | string[] | Yes | List of authorized approver identifiers |
approval_timeout_secs | int | No | Timeout in seconds (0 = no timeout) |
depends_on | string[] | No | Steps that must complete before this step |
Approving a Step
When a workflow reaches an approval step, call the approve endpoint:Request Body
approver field is required and must identify the person or system approving the step.
Response
Approval Data Model
TheWorkflowStepApproval record tracks the full approval lifecycle:
| Field | Type | Description |
|---|---|---|
id | string | Unique approval ID |
workflow_run_id | string | Parent workflow run |
workflow_step_run_id | string | The step run waiting for approval |
approvers | string[] | Authorized approver list (from step config) |
status | string | pending, approved, or rejected |
approved_by | string | Who approved (empty until approved) |
requested_at | timestamp | When the approval was requested |
approved_at | timestamp | When it was approved (null until acted on) |
expires_at | timestamp | When the approval times out (null if no timeout) |
error | string | Error message if rejected or timed out |
Approval Timeouts
Ifapproval_timeout_secs is set, the approval automatically expires after the specified duration:
- The approval status is set to
rejectedwith a timeout error message - The step run transitions to
failed - The workflow follows its normal failure handling (which may include step retry logic)
Multiple Approval Gates
You can have multiple approval steps in a single workflow:Monitoring Approvals
Check Pending Approvals
List workflow runs with steps waiting for approval:Webhook Notifications
When a step enters thewaiting_for_approval state, a workflow run webhook event is published. Configure your notification system (Slack, email, PagerDuty) to listen for these events and alert the appropriate approvers.
Approval steps do not require a
job_id since they don’t execute any job. They exist purely as workflow control flow gates.Event Trigger Integration
Approval steps automatically create a parallel Event Trigger when the workflow engine starts them. This means approvals can be resolved via either:- The approve API endpoint (legacy):
POST /v1/workflow-runs/{id}/steps/{ref}/approve - The event trigger API:
POST /v1/events/{eventKey}/sendwith the approval’s event key
- Real-time SSE streaming of approval status
- Webhook notifications when the approval is resolved
- Integration with external approval systems via the standard event API
Event trigger creation for approval steps is non-fatal. If the trigger creation fails (e.g., duplicate event key), the approval step still works normally via the legacy approve endpoint.
Best Practices
- Use descriptive step refs: Name approval steps clearly (e.g.,
security-review,prod-deploy-gate) so approvers understand what they are approving - Set reasonable timeouts: Avoid indefinite waits in production workflows. Set timeouts and handle the failure case
- Limit approver lists: Keep the approver list small and specific. Anyone in the list can approve
- Combine with conditions: Use step conditions to skip approval gates in low-risk scenarios (e.g., skip prod approval for hotfixes)
- Monitor pending approvals: Set up alerts for approvals that have been pending beyond a reasonable threshold
- Consider event triggers for complex approvals: For multi-party or external system approvals, use
wait_for_eventsteps instead ofapprovalsteps for more flexibility