# Wait and resume a flow

import { Steps, TabItem, Tabs } from "@astrojs/starlight/components"

Wait-and-resume is not a separate **Flow** step. You insert a **Resume** value (**Resume execution ID** or **Resume
webhook URL**) into a **service** step’s **Input**. That step pauses the run until something calls Mindflow’s resume
endpoint—often a person clicking a link or a button in Slack, email, or another tool. Screenshots on this page use a
sample Slack approval so you can see the Resume picker and a dashed link to the next step.

## When to use

- A person must approve, choose, or confirm before the flow continues.
- An external system finishes asynchronously and can POST (or GET/PUT) back to Mindflow when ready.
- Prefer [Pause with Wait](../wait/) when you only need a fixed delay and nothing will “call back.”
- Prefer [Handle timeout](../../reach-out-to-services/handle-timeout/) for ordinary HTTP step timeouts; resume timeout
  is separate (**Resume timeout in seconds**).

Before you begin, open the flow in the designer with permission to edit it. Use a **service** step (integration, HTTP
Request, or SMTP email)—not a script or built-in Flow step other than those service operations.

## Guide

### Insert a Resume value

In the data picker, **Flow** → **Resume** offers two pills. Inserting either one makes the service step asynchronous:
the outgoing canvas link becomes dashed, and **Settings** shows **Resume timeout in seconds**.

<ol>
<li>

**Select the service step** that should pause (for example Slack **Send a message** or an HTTP request that notifies
another system). Open the **Input** tab on the field that should carry the resume value (message text, blocks, URL
query, and so on).

</li>
<li>

**Open Resume.** In the data picker, choose **Flow**, then **Resume**. The panel lists **Resume execution ID** and
**Resume webhook URL**, and shows your tenant **Resume endpoint URL** for copy.
<div class="docs-screenshot-compact">

![Service step Input with Resume picker showing Resume execution ID and Resume webhook URL](./assets/service-step-input-resume-picker-showing.png)

</div>

</li>
<li>

**Insert one Resume pill** into the field (see the tabs below). Deploy and run the full flow so the pause can take
effect—design-time placeholders are not live resume targets.
<div class="docs-screenshot-compact">

![Slack Blocks field with Resume picker open over the message payload](./assets/slack-blocks-field-resume-picker-open.png)

</div>

</li>
<li>

**Set Resume timeout in seconds** on the step **Settings** tab (minimum **180**; default **300**). If nobody resumes
before the timeout, the step follows **On failure** (**Stop execution** or **Continue execution**).

</li>
</ol>
### Choose how the run resumes

**Resume webhook URL** generates a per-run HTTPS URL. Put it in a message or email so a person (or system) can open or
call it. Supported methods include **GET**, **POST**, and **PUT**.

<ol>
<li>

**Insert Resume webhook URL** into the field the recipient will use (link in Slack text, email body, ticket comment).

</li>
<li>

**Run the flow.** At run time the pill becomes a concrete URL for that execution (design time shows a placeholder).

</li>
<li>

**Resume** by requesting that URL. The run continues to the next step after the paused service step.

</li>
</ol>
**Resume execution ID** is an identifier the third party includes in an HTTP call to your tenant resume endpoint (query
parameter, header, or body). Use it when the other system owns the webhook shape and cannot open a Mindflow URL
directly.

<ol>
<li>

**Insert Resume execution ID** where the integration expects an opaque id (for example a Slack Block Kit `block_id`,
or a field your HTTP client will echo back).
<div class="docs-screenshot-compact">

![Field mapped to Resume execution ID for a Slack interactive message](./assets/field-mapped-resume-execution-id-slack.png)

</div>

</li>
<li>

**Note the Resume endpoint URL** from the **Resume** panel (tenant-specific). At run time, call that endpoint with the
execution id in a query parameter, a header value, or the body. Methods include **GET**, **POST**, and **PUT**.
<div class="docs-screenshot-compact">

![Run showing Resume execution ID available at execution time](./assets/run-showing-resume-execution-id-available.png)

</div>

</li>
<li>

**Confirm the pause.** After the service step runs, the flow waits until the resume call arrives (or the resume
timeout fires).
<div class="docs-screenshot-compact">

![Run waiting after the Slack message until a Yes or No action resumes it](./assets/run-waiting-after-slack-message-until.png)

</div>

</li>
</ol>
## Example

A flow named **Coffee approval** sends a Slack interactive message (“Do you want a coffee?”) with **Resume execution
ID** in the action payload, then continues only after someone chooses **Yes** or **No**.

1. **Add** the Slack send-message step and build the interactive message (question + actions).
2. **Insert Resume execution ID** into the field Slack uses to correlate the button click (for example `block_id`).
3. **Add** the next steps after the Slack step (the link appears dashed while Resume is present).
4. **Set Resume timeout in seconds** and **On failure** for what should happen if nobody answers.
5. **Run** the flow, answer in Slack, and confirm the run continues.

<div class="docs-screenshot-compact">

![Slack message Do you want a coffee with Yes and No buttons](./assets/slack-message-do-you-want-coffee.png)

</div>

## Keep in mind

- Resume pills work on **service** steps only—not on scripts or most built-in Flow steps.
- Design-time placeholders are not callable; you must run the flow to get a live URL or id.
- **Resume timeout in seconds** is not the same as HTTP **Timeout**—see
  [Handle timeout](../../reach-out-to-services/handle-timeout/).
- Copy the **Resume endpoint URL** from Studio for your tenant; do not hard-code an old hostname from older docs.

Related: [Pause with Wait](../wait/),
[Handle timeout](../../reach-out-to-services/handle-timeout/),
[Send emails](../../reach-out-to-services/send-emails/),
[Scripts, errors, and run control](../).
