Pause a flow until someone responds
Some flows need an answer from outside before they continue: a manager approves a request, a payment provider confirms a payment, or another system finishes a job. The Wait For Webhook action pauses the run until a unique URL is called, then carries on with whatever was sent to it.
This guide builds an approval: the flow posts the request to Slack, waits, and continues according to the answer.
How it works
Every run gets its own callback URL for each Wait For Webhook step. The flow sends that URL to whoever needs to answer before it reaches the Wait step. When they call the URL, the run resumes, and the data they sent becomes the Wait step's output.
Build message ─▶ Send to Slack ─▶ Wait For Webhook ─▶ Path
(includes URL) ⏸ paused
▲
approver ── POST {"approved": true}1. Add the Wait step
- Where the flow should pause, click Add Step, open Built-in, choose Wait, then Wait For Webhook.
- Set HTTP Method to POST.
- Rename the step Wait for approval, so its URL is easy to find in the
$list.
2. Build a message containing the URL
The callback URL is only filled in when it's the whole value of a field, so you can't put it straight into the middle of a Slack message. Build the message in a Code step first:
Before the Wait step, add Built-in › Code › Run JavaScript. Rename it Build approval message.
In Input Params, add a key
callbackUrl. For its value, type$, open Execution and choose Callback URL for Wait for approval. Leave nothing else in the value.In Code, write:
jsreturn `New expense request needs approval. Approve or reject it here: ${callbackUrl}`;
3. Send it
Add Apps › Slack › Send Message between the Code step and the Wait step. Pick your Slack credential and Channel ID, and set Message Text to the Code step's output, Build approval message.results.
4. Answer the request
Whoever approves calls the URL with a POST and a JSON body. For example, from an approval tool, a script, or another flow's HTTP step:
curl -X POST "<callback URL>" \
-H "Content-Type: application/json" \
-d '{"approved": true, "comment": "Looks fine"}'The run resumes immediately.
5. Continue according to the answer
The body sent to the URL is in the Wait step's data output. Add a Path after the Wait step:
- Field:
Wait for approval.data, then type.approvedafter it. The full reference is$.<Wait step ID>.output.data.approved. - Operator: Boolean: Is True
Put the "approved" steps on that branch, and the "rejected" steps on a Fallback branch. The comment is at data.comment.
Good to know
- Treat the URL like a password. Anyone who has it can resume the run, so send it only to the people or systems that should answer.
- Each run has its own URL. A URL from an earlier run won't resume a new one.
- Opening the URL in a browser sends a
GETrequest with no body. If you want approvers to just click a link, set HTTP Method to GET. Clicking then resumes the run, but it can't say approve or reject. - Waiting doesn't last forever. If the URL isn't called within 30 days, the run stops with the status Timed out. You'll see it in Executions. See Limits.