Workflows and Webhook Triggers
Build step-driven jobs with HTTP steps, webhook waits, approval gates, and public trigger URLs.
TrigRun supports two step-driven job kinds:
workflowfor schedule-driven multi-step jobswebhook_triggerfor multi-step jobs that start from an inbound POST instead of a schedule
These jobs use steps[] rather than the top-level request block used by standard cron, recurring, scheduled, and one-time jobs.
When to use them
| Kind | Starts from | Best for |
|---|---|---|
workflow | A saved schedule | Multi-step API orchestration, approval flows, fan-out/fan-in jobs |
webhook_trigger | POST /v1/triggers/:token | Inbound webhooks that need validation, transformation, and downstream calls |
If you only need one outbound HTTP call on a schedule, stay with a normal job from the Jobs guide.
Supported step types
| Step type | What it does |
|---|---|
http | Makes an outbound HTTP request |
wait_for_webhook | Parks the execution until a callback resumes it |
approval | Parks the execution until someone approves or rejects it |
Every step needs a stable id. TrigRun stores per-step execution records under step_executions so you can see what happened at each stage.
Create a scheduled workflow
This example runs every hour, enriches a record, waits for approval, then writes the approved payload downstream.
Create an inbound webhook-triggered job
webhook_trigger jobs do not use a schedule. TrigRun generates a secret webhook_token for the job, and every inbound POST creates an execution with structured trigger_input.
The job response includes:
webhook_tokenwebhook_secret_configured
To fire the job:
If the token does not exist, TrigRun returns 200 { "received": true } to avoid token enumeration. If the shared secret is configured and does not match, TrigRun returns 401 unauthorized.
Template variables inside workflow steps
Workflow steps use a different template context than standard request jobs.
context.*
Values extracted by earlier steps are available under context.
trigger.*
Webhook-triggered jobs expose inbound request data under trigger.
Available roots are:
contexttrigger
For standard request jobs, use the execution-scoped variables documented in Request Templates and Response Matching.
Extracting and persisting data
http, wait_for_webhook, and approval steps can all extract data.
| Field | Scope |
|---|---|
extract | Stores values in the in-memory workflow context for the current execution |
extract_to_context | Persists values to the cross-run job context store |
The persisted store is available at:
GET /v1/jobs/:id/contextPATCH /v1/jobs/:id/context
PATCH /v1/jobs/:id/context accepts a simple object of string keys to string-or-null values. Setting a key to null deletes it.
Waiting for external input
wait_for_webhook
This step parks the execution and exposes a generated resume_url in the execution's waiting_payload.
The public resume endpoint is:
If the waiting token is still valid, the callback payload becomes the step input and the workflow continues.
approval
This step parks the execution and exposes:
review_urlapprove_urlreject_url
Public approval endpoints:
Approval notifications can target the on_approval_required event documented in Notifications.
Concurrency, time limits, and callbacks
| Field | Meaning |
|---|---|
max_concurrent_executions | Caps parallel executions for the job. 0 means unlimited. Step-driven jobs default to 1. |
max_workflow_duration_seconds | Maximum total workflow runtime. Default 1800, max 7200. |
on_success_url | Optional callback fired after a successful execution |
on_failure_url | Optional callback fired after a failed execution |
Success and failure callbacks receive the execution result after the workflow finishes. They are separate from notification channels.
Execution details you can inspect
Step-driven executions expose more fields than standard jobs:
step_executionstrigger_inputwaiting_reasonwaiting_payloadwaiting_expires_atfinal_output
Fetch them with:
Current interface coverage
The REST API and OpenAPI spec expose the full step-driven surface.
The current CLI and MCP tooling focus on standard request-based jobs, executions, secrets, notifications, and monitors. For workflows and inbound webhook-triggered jobs today, use the API directly.