# Handle timeout

import { Steps } from "@astrojs/starlight/components"

A **timeout** limits how long Mindflow waits before it stops a run or a step. The **flow** timeout caps the whole run.
Each **service step** can also set its own timeout for that call. When a timeout is reached, Mindflow ends that scope
and records a failure.

## When to use

- A vendor API is slow and the default step timeout is too short.
- A long flow needs more than the default five-minute run window.
- Prefer raising only the step that talks to the slow API when the rest of the flow is already fast enough.

Before you begin, open the flow in the designer and unlock it if needed.

## Guide

### Set the flow timeout

The flow **Settings** panel includes **Timeout** for the whole run. The default is **300** seconds (5 minutes). The
maximum is one week (**604800** seconds).

<ol>
<li>

**Open flow Settings.** In the designer, open the flow inspector **Settings** tab (gear on the flow title area).

</li>
<li>

**Set Timeout.** Enter the maximum run duration in seconds (default **300**).
<div class="docs-screenshot-compact">

![Flow Settings tab with Timeout set to 300 and Email notifications No notifications](./assets/flow-settings-tab-timeout-set-300.png)

</div>

</li>
</ol>
### Set a step timeout

Most HTTP and native integration steps expose **Timeout (in seconds)** on the step **Settings** tab. The default for a
new service step is **30**. Studio clamps the value between **1** and **480** seconds (8 minutes).

<ol>
<li>

**Open the step Settings.** Select the service step, then open **Settings**.

</li>
<li>

**Set Timeout (in seconds).** Enter how long Mindflow should wait for that step (default **30**, maximum **480**).
<div class="docs-screenshot-compact">

![Service step Settings with Timeout in seconds 30, Resume timeout 300, On failure Stop execution](./assets/service-step-settings-timeout-seconds-30.png)

</div>

</li>
</ol>
:::note
Built-in **Send email** (Mindflow-hosted) does not expose a step timeout — only **On failure** (and resume timeout when
wait-and-resume applies). **HTTP Request** and **Send email over SMTP** do expose a step timeout.
:::

## Example

A flow that polls a slow ticket API keeps the flow **Timeout** at **300** and raises the HTTP step **Timeout (in
seconds)** to **120** so only that call waits longer.

## Keep in mind

- Flow timeout and step timeout are independent. A step can time out before the flow does; the flow can also end while a
  step is still waiting if the flow limit is lower.
- Step timeout maximum is **480** seconds. Raise the flow timeout when the whole run needs more than five minutes.
- **Resume timeout in seconds** (when shown) applies to wait-and-resume paths, not to ordinary HTTP wait time. See
  [Wait and resume a flow](/guides/build/control-flow-execution/wait-and-resume-playbook/).

## Related

[Send raw HTTP requests](../send-raw-http-requests/) ·
[Handle step errors](../../control-flow-execution/error-handling/) ·
[Reach out to services](../)
