Long Delays & Callbacks
Pause workflows for hours or days, or until an external system responds.
Some workflows need to wait. A drip campaign sends three follow-up emails over a week. An approval flow blocks until a human clicks Approve in Slack. A scheduled retry kicks back in four hours after a flaky external API failed.
FlowTrux has two building blocks for these patterns. Both put the run into Paused: it waits without counting as a running execution, it is kept safely however long the wait, and it continues by itself at the right moment.
TL;DR
| Pattern | When to use | Action types |
|---|---|---|
| Long Delay | "Wait N seconds/minutes/hours/days, then continue" - clock-based | One Action node, type delay |
| Callback | "Wait until this URL is hit, then continue" - event-based | Two Action nodes: generate_callback → notify → wait_for_callback |
Both pause the run with status Paused. Both continue from exactly where they left off, with everything the run had so far ({{steps.*}}, {{global.*}}, {{trigger.*}}, loop context).
Long Delay
A Delay / Wait Action just waits. Set Duration (a number) and Unit (Milliseconds, Seconds, Minutes, Hours). Maximum 7 days; a longer delay fails the node.
Waits of a few seconds happen in place. Anything longer puts the run into Paused until the time is up. Either way the next node runs after the requested time.
Output
A short delay:
{
"delayed": true,
"durationMs": 3000,
"requested": { "duration": 3, "unit": "s" }
}
A delay that paused the run, after it continues:
{
"delayed": true,
"longDelay": true,
"durationMs": 3600000,
"resumedAt": "2026-04-30T15:00:00.000Z"
}
When to use a long delay
- Drip campaigns - send → wait 24h → send → wait 3d → send.
- Cool-downs after a failure - set the node to Continue with an empty result (On error), branch on
{{steps.<id>.output._meta.failed}}, wait 30 minutes, then try once more. (For quick retries, the node's own Retry attempts are simpler.) - Scheduled follow-ups - created a ticket → wait 7 days → check whether it's still open and ping the owner.
When not to use a long delay
- You're waiting for an external event (a user click, an inbound webhook, a 3rd-party callback). Use the Callback pattern below instead - Long Delay can't be triggered early.
- You want a recurring schedule (every Monday at 9am). Use a Schedule trigger instead.
Callbacks (Wait for external input)
The Callback pattern pauses a workflow until an external system POSTs to a URL the workflow itself generated. Two cooperating Action types:
generate_callback
Generates a unique callback URL and token for the current run. Place it before the notification that sends the URL out.
Config:
| Field | Default | Notes |
|---|---|---|
| Timeout | 3600 (1 hour) | Seconds the workflow will wait, 60 to 86,400 (24 hours). |
Output:
{
"callbackUrl": "https://app.flowtrux.com/api/webhooks/callback/<token>",
"token": "<token>",
"timeout": 3600,
"expiresAt": "2026-04-30T16:00:00.000Z"
}
wait_for_callback
Pauses the workflow until the URL is hit. The run shows Paused until then, or until the expiresAt of the matching generate_callback passes.
Config:
| Field | Notes |
|---|---|
| Token | Reference the upstream node's token: {{steps.<generate-callback-id>.output.token}}. It must come from a Generate Callback URL node of the same run. |
Output (after resume):
{
"resumed": true,
"callbackData": { "...": "the JSON or form body the caller POSTed" },
"resumedAt": "2026-04-30T15:12:00.000Z"
}
The flow
Trigger
└─> generate_callback ← creates URL + token
└─> Slack/Gmail ← sends URL to approver, embedded in a button or link
└─> wait_for_callback ← workflow PAUSES here
└─> branch on callbackData.action == "approve" / "reject"
└─> notify result, finish
generate_callbackproduces the URL + token for this run.- The notification node embeds
callbackUrlinto a Slack message, an email, an SMS, or anywhere else the approver will see it. wait_for_callbackpauses the run.- When the caller POSTs to the URL (an approval button wired to submit a POST, or an external system calling it programmatically), the workflow picks back up from its saved state.
- If the timeout fires before the URL is hit, the run fails with a timeout error.
The endpoint
POST /api/webhooks/callback/<token>
- POST only. A plain link click in a browser issues a GET and will not resume the run - wire the approval so the click results in a POST (an HTML form button, an intermediary page, or the external system calling the URL directly).
- Accepts JSON or form-encoded body.
- The body becomes
callbackDatain the wait node's output; URL query parameters land incallbackData._query. A body that isn't JSON or form data arrives ascallbackData._raw. Keys starting with_in the body are dropped. - No signature needed. The URL itself is the credential - it is unguessable and works only for the one paused run, so share it only with the person or system that should answer.
- Only the first POST resumes the run. A later POST, or one after the timeout, gets
404/410with{ "error": "Invalid or expired callback token" }. - A successful call answers
{ "success": true, "resumed": true, "executionId": "…" }.
Slack-approval example
Trigger (manual)
→ generate_callback (timeout: 86400)
→ slack.send_blocks (channel: ops, blocks: [
{type: "section", text: "Deploy v1.42 to production?"},
{type: "actions", elements: [
{type: "button", text: "Approve",
url: "{{steps.cb.output.callbackUrl}}?action=approve"},
{type: "button", text: "Reject",
url: "{{steps.cb.output.callbackUrl}}?action=reject"}
]}
])
→ wait_for_callback (token: {{steps.cb.output.token}})
→ if-else (condition: {{steps.wait.output.callbackData._query.action}} === "approve")
true → http.post (https://ci/deploy)
false → slack.send_message (channel: ops, text: "Deploy cancelled by {{...}}")
The query-string trick (?action=approve) lets a single callback URL carry the user's choice - no separate URLs per button. The workflow reads callbackData._query.action after resume.
Note: the callback endpoint expects a POST. Slack
url:buttons open the link in a browser (GET), so in practice point the buttons at a small approval page/handler that POSTs the callback URL with the chosen action - or have the approving system call the URL directly.
When to use a callback
- Approval flows - Slack/email/Teams "Approve / Reject" buttons that drive a workflow.
- Manual review checkpoints - pause a pipeline until QA hits a "ship it" link.
- Two-system handoffs - your workflow kicks off work in an external system and wants to wait for that system's "done" callback before continuing.
- OTP / 2FA-style waits - generate a magic link, send it, wait for the click.
When not to use a callback
- You want to wait exactly N hours, not "until something happens". Use Long Delay.
- The external system has to be asked for its status rather than calling you. Use a Long Delay before each check.
- The wait is longer than 24 hours - the callback timeout is at most 86,400 seconds. For multi-day approval windows, split the work into two workflows (the approver's answer can start the second one through its webhook).
Comparing the two
| Long Delay | Callback | |
|---|---|---|
| Trigger to resume | Time elapsed | External POST |
| Can resume early? | No | Yes (any time before timeout) |
| Max wait | 7 days | 24 hours |
| Carries data on resume? | No | Yes - callbackData |
| Number of nodes | 1 (delay) | 2 (generate_callback + wait_for_callback) |
Both share: the Paused status, the full run context kept across the wait, and a single entry in the execution history.
Related
- Node Types -
delay,generate_callback,wait_for_callbackAction types - Webhooks - starting workflows from outside
- Templates - ready-made descriptions the assistant builds workflows from