> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chatflows.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Advanced steps: delays, conditions and API calls

> Control what happens next in your chatbot by adding decisions, delays, actions, and connections to other systems.

These steps make an automation smart. The **Advanced** category steps control what your chatbot does behind the scenes. Use them to wait before replying, choose different paths, update contact details, connect with other systems, or start another flow.

![Flow Builder showing a flow that uses Advanced steps — a Start Trigger on the keywords hi and hello leading to an Ask Question and a Get Input, then a Condition that splits into two paths, each running an Update Contact and an Assign Label before joining a closing Text Message](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/advanced-flow-steps.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=f7af771e18cd92beeb6fb9b620a45359)

## Waiting

### Delay

**What it does.** Pauses the flow for a specified time before moving to the next step.

**When to use it.** Use it whenever you want to wait before the next step. For example, send a follow-up after a day or remind customers about an abandoned cart after an hour.

* Hours, Minutes and Seconds all start at 0; set at least one of them to make the step wait.

![Delay settings with a note explaining the flow pauses for a fixed amount of time and then continues on its own, separate Hours, Minutes and Seconds boxes, and a running total below them](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/delay-settings.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=3c3964d89abf764f557e86d439447080)

**Example.** A **Delay** of 24 hours, then a **Text Message**: "Just checking in — did you have any questions about the quote?"

![A Start Trigger set to exact match on the keywords hi and hello, connected to a WhatsApp Template step, then a Delay step, then a Text Message following up about pricing questions](https://mintcdn.com/chatflows-docs/8QSpoWsCTFEf5plZ/automation/img/advance/delay.png?fit=max\&auto=format\&n=8QSpoWsCTFEf5plZ\&q=85\&s=5434d9c9a2841362e85dd1828c409097)

### Wait Timer

**What it does.** Adds a very short delay before the flow continues. The delay is set in **milliseconds**, and the equivalent time in **seconds** is shown as you type.

**When to use it.** Use it when you need a very short pause between steps, such as making sure two messages are sent in the correct order. For longer delays, use **Delay** instead.

**Required fields**

* **Wait Duration (ms)** is required, and must be at least 1.

![Wait Timer settings with a note explaining it is a short technical pause measured in milliseconds, a Wait Duration box set to 2000, and the equivalent time shown below it as 2 seconds](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/wait-timer-settings.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=317938cda9822be8934e2dac5774c960)

**Example.** Send the welcome text, a **Wait Timer** of 2000 ms, then send the button menu.

![A Start Trigger set to exact match on the keywords hi and hello, connected to a welcome Text Message, then a Wait Timer of 2 seconds, then a second Text Message asking how we can help](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/wait-timer.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=133b6cc6c906a89b92e7d0db0755436b)

### Wait for Reply

**What it does.** Waits for the customer's next message, saves it, and then continues the flow. Unlike **Delay**, it waits for a customer reply instead of a set amount of time.

**When to use it.** Use it when you want to save the customer's next reply without asking a question. If you want to ask a question and validate the answer, use **Ask Question** instead.

**Required fields**

* **Store Reply In** is required. Use lowercase letters, numbers, and underscores, starting with a letter — for example `user_provided_id`.

![Wait for Reply settings with a note explaining the flow pauses until the contact sends their next message and then saves it, and a Store Reply In box holding a variable name](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/wait-for-reply-settings.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=cf822247e739e6432d1c48b6fbae882c)

**Example.** A **Text Message** asking for the order ID, a **Wait for Reply** saving it to `order_id`, then a **Text Message** confirming it back with \{\{vars.order\_id}}.

![A Start Trigger set to exact match on the keywords hi and hello, connected to a Text Message asking the customer to send their Order ID, then a Wait for Reply step storing it, then a Text Message confirming the received Order ID using a merge field](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/wait-for-reply.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=a560a9164efeda933ebdf181a0665094)

***

## Branching

### Condition

**What it does.** Checks one value and splits the flow into two paths — **YES** if the condition is met, or **NO** if it isn't.

**When to use it.** Use it when there are only two possible outcomes. For example, check whether the customer replied **yes**, or whether they are a returning customer.

**How to set it up.** Choose the **Operator** — **Contains**, **Equals**, **Starts with**, **Ends with** or **Regex** — then type the **Value** you want to check against. On the step itself, the green dot on the right is the **YES** path, and the red dot below it is the **NO** path. Connect each dot to the step that should run next.

**Required fields**

* **Operator** and **Value** are both required. Operator defaults to **Contains**.

![Condition settings with an Operator set to Equals, a Value of yes, and a note explaining that the YES branch is the green handle at the top right and the NO branch is the red handle at the bottom right](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/condition-settings.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=d4f4d4aeab6e773c8266668675c1303c)

**Example**

> **Operator:** Contains
> **Value:** yes

Connect the green **YES** dot to the booking steps, and the red **NO** dot to a polite "No problem, we're here whenever you need us."

![A Start Trigger on the keywords hi and hello, connected to a Text Message asking whether the customer would like to book an appointment, then a Wait for Reply, then a Condition whose two branches each lead to a different Text Message — one starting the booking and one saying no problem](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/condition.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=9e3a356216f40aa81e63cfe40099f5c7)

### Logic Control

**What it does.** Checks a value against a set of rules and sends the flow down a different path for each one. It works like **Condition**, but it isn't limited to two paths.

**When to use it.** Use it when a value can lead to more than two outcomes, such as sending a different reply for each order status.

**How to set it up.** First pick what to check: the **last message**, a **flow variable** you saved earlier, a **contact custom field**, or an **API response value**. Then add a rule for each outcome you want, and connect each one to the step that should run next.

The operators are **Contains**, **Equals**, **Starts with**, **Ends with**, **Regex**, **Is empty** and **Is not empty**, plus **>**, **\<**, **≥** and **≤** for comparing numbers.

**Required fields**

* You need at least **one rule**.
* Every rule needs a **field** to check.
* Every rule needs a **value**, except when the operator is **Is empty** or **Is not empty**.

Rules are checked from top to bottom and the first one that matches wins. Each rule has its own connection point on the right, in the same order. Below them is a grey **Fallback** point, which runs when none of the rules match — connect it so customers still get a reply when their answer doesn't fit any of your rules.

![Logic Control settings with two rules, each checking the contact's last message with a Contains operator — one for Laptop and one for Mobile — an Add Rule button, and a note explaining that rules match top handles in order and no match goes to the bottom grey Fallback handle](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/logic-control-settings.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=3180817dba70e962b26d589639e5845d)

**Example**

Check the flow variable `party_size`:

* **≤** 4 → send the standard table confirmation.
* **>** 4 → send "For larger groups we'll call you to confirm" and tag the contact for follow-up.

![A Start Trigger on the keywords hi and hello, connected to a Text Message asking which product the customer is interested in, then a Wait for Reply, then a Logic Control listing a Laptop rule, a Mobile rule and a Fallback, with the two rules each connected to a different Text Message about that product's stock](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/logic-control.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=3f7a1390757ad1293e778ba928f39264)

***

## Updating the contact

### Update Contact

**What it does.** Saves information to the contact's main record. You can update their **First Name**, **Last Name**, **Display Name**, **Email**, **Phone**, **Relation Type**, **Status** and **Source**.

**When to use it.** Use it after you've asked the customer for information, so it's saved to their record permanently. For example, ask for their name, then save it so every future message can greet them by it.

Leave a field blank to keep whatever is already saved. The **Relation Type**, **Status** and **Source** dropdowns each start on **No Change** for the same reason.

![Update Contact settings with First Name, Last Name, Display Name, Email and Phone boxes that each accept a merge field, the Email box filled in, and Relation Type, Status and Source dropdowns all set to No Change](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/update-contact-settings.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=29fa7a284bc3d0df68381fab849593b1)

**Example.** After an **Ask Email**, use Update Contact to set **Email** to `{'{{vars.email}}'}`.

![A Start Trigger on the keywords hi and hello, connected to an Ask Email step, then an Update Contact step, then a Text Message confirming the email has been saved](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/update-contact.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=c951b9c77667b9d0c9a1818b2ee51fde)

### Update Custom Field

**What it does.** Sets one of your own [customer fields](https://docs.chatflows.io/core-setup/custom-fields.md) on the contact.

**When to use it.** Use it to store information that's specific to your business, such as a membership number, a preferred branch, customer ID, or vehicle number.

**How to set it up.** Choose the **Custom Field** from the list, then type the **Value**, using **@** to insert a [merge field](https://docs.chatflows.io/messaging/merge-fields.md).

**Required fields**

* **Custom Field** and **Value** are both required.

![Update Custom Field settings with a Custom Field dropdown set to Company Name and a Value box holding a merge field](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/update-custom-field-settings.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=f6b0c36732bb04b7fe665dff10078a1e)

**Example.** After an **Ask Question** collecting the company name, set the **Company Name** custom field to `{'{{vars.company_name}}'}`.

![A Start Trigger on the keywords hi and hello, connected to an Ask Question asking for the company name, then an Update Custom Field step set to Company Name, then a Text Message confirming it has been saved](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/update-custom-field.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=004adfbb2a67152e789b6762f8c2ddc3)

### Assign Label

**What it does.** Adds a [customer tag](https://docs.chatflows.io/core-setup/labels.md) to the contact. If the label you need doesn't exist yet, you can create it here without leaving the flow.

**When to use it.** Use it to automatically label customers based on their conversation. For example, add the `Hot Lead` label when someone asks about pricing, then send a [campaign](https://docs.chatflows.io/messaging/campaigns.md) to everyone with that label.

**Required fields**

* A **Label** must be selected.

![Assign Label settings with a Label dropdown set to New customer, and a Create new label box with a Create button below it](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/assign-label-settings.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=1de4ff3f637280831b19e351a7a93f18)

**Example.** On a **First message** trigger, add the `New customer` label so you can follow up with everyone who has just found you.

![A Start Trigger set to First message, connected to an Assign Label step that adds the New customer label](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/assign-label.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=be00c85db621a5324b577857ba894e38)

### Assign Group

**What it does.** Adds the contact to a [customer group](https://docs.chatflows.io/core-setup/groups.md). If the group you need doesn't exist yet, you can create it here without leaving the flow.

**When to use it.** Use it to build an audience as people come through your chatbot, such as a `Newsletter` group or a `Diwali Offer Interested` group.

**Required fields**

* A **Group** must be selected.

![Assign Group settings with a Group dropdown set to Sales group, and a Create new group box with a Create button below it](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/assign-group-settings.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=702bf158c53e72279ef2c1e32bf43855)

**Example.** On a **First message** trigger, add the contact to your `Sales group` so the team can pick the conversation up.

![A Start Trigger set to First message, connected to an Assign Group step that adds the contact to the Sales group](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/assign-group.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=c28d2818650093366260f3c96c79bcee)

***

## Talking to other systems

### API Request

**What it does.** Gets information from another system, such as your website, CRM, or order system, and makes it available for the rest of the flow. This step doesn't send a message to the customer.

**When to use it.** Use it when your flow needs information from another system, such as an order status, whether an item is in stock, or a delivery date.

**How to set it up.** Enter the **URL** you want to call, then choose the **Method** and the **Format** (**JSON** or **Form**). Add **Body Params** and headers if the other system needs them. Type **@** in any field to insert a merge field — for example, to put the contact's phone number into the URL.

**Required fields**

* **URL** is the only required field.
* **Method**, **Format**, **Body Params** and headers are all optional. The default settings work for most API requests, so you only need to change them if your API requires it.

The response is only kept for the rest of that run. Add a **Save Response** step next to pull the values you need out of it.

![API Request settings with a note explaining the response is kept for this run and a Save Response step is needed to pull values out of it, a URL box containing a merge field, Method set to GET, Format set to JSON, and an empty Headers row with an Add Header button](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/api-request-settings.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=b509ca7162d7713ed36964c51b86c44f)

**Example**

> **URL:** `https://api.example.com/orders/{'{{vars.order_number}}'}`
> **Method:** GET
> **Format:** JSON

![A Start Trigger set to First message, connected to a Text Message asking for the order number, then a Wait for Reply storing it, then an API Request step calling the order API with that number in the URL](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/api-request.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=92743cdf04dc971a8906a56ceab57831)

### Save Response

**What it does.** Saves information returned by an **API Request**, such as an **order status**, **tracking number**, or **delivery date**, so you can use it in later messages or steps.

**When to use it.** Add this step after an **API Request** to save the information you need. Once saved, you can use it in later messages, conditions, and other flow steps.

**How to set it up.**

1. In the **Source API Request Node** box, choose the API Request step you added earlier in the flow.
2. Add a mapping. The **Source Path** points to the piece of information you want, written with a dot between each level — for example `data.status`. The **Variable Name** is the name you'll use to insert it later.
3. In any later message, type **@** and select the saved variable to insert its value.

**Required fields**

* **Source API Request Node** is required.
* You need at least **one mapping**, and each one needs both a **Source Path** and a **Variable Name**.

![Save Response settings with a note explaining the step turns values from an API Request response into merge fields, a Source API Request Node dropdown, and a mapping with a Source Path of data.order\_number and a Variable Name of order\_number](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/save-response-settings.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=7bd0711bdcb51bfa1a5a0d46951e6069)

**Example**

Map `data.tracking_url` to the variable `tracking_url`, then send:

> Your order is on its way! Track it here: \{\{vars.tracking\_url}}

![Flow builder example showing a List Message with a Track My Order option, leading to an Ask Question step, an API Request step, a Save Response step mapping the order status, and a Text Message step sending the order status and tracking URL](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/save-response.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=2ef34dab0d3ed61798620246a2997e59)

***

## Connecting flows

### Connect Flow

**What it does.** Continues the conversation in another automation flow.

**When to use it.** Use it when the same set of steps is needed in multiple flows. Build it once, then reuse it wherever you need it.

**How to set it up.** Choose the **Target Flow**, then set **On Completion** to decide what happens when that flow finishes. **Resume parent flow** comes back and carries on from here, and **End parent flow** stops the conversation there.

**Required fields**

* **Target Flow** is required.
* **On Completion** has a default, so you only change it if you want the other behaviour.

![Connect Flow settings with a Target Flow dropdown to choose the flow to continue in, and an On Completion dropdown to choose whether the parent flow resumes or ends](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/connecting-flows-settings.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=39d8c3987c5cfc8ffa16a2c729a538e4)

**Which flows you can choose.** The **Target Flow** list only shows flows you can actually connect to:

* The flow must be **Active**. Drafts and inactive flows don't appear in the list.
* It must be a **different flow**, because a flow can't connect to itself.
* It must be on the **same channel type**. A WhatsApp flow can only connect to another WhatsApp flow, and a Messenger flow to another Messenger flow.

If the list is empty, you'll see a message saying there are no other flows available — create and activate a second flow on the same channel type first.

![Flow builder example showing a Button Message with Store Hours and Contact Support options, where Store Hours connects to a Connect Flow step targeting the Store Hours flow](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/connect-flow-example.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=eea8752aeb697bba7ea63bbd8c038f3f)

### Sequence

**What it does.** Sends a series of follow-up messages automatically over a period of time. You set the gap before each message in **Minutes**, **Hours**, **Days** or **Weeks**.

**When to use it.** Use it when you want to follow up more than once over several days, such as a three-message welcome series across a week, or a set of reminders after someone leaves items in their cart.

**How to set it up.** Give the sequence a name, then add each message in turn. For every message, set how long to wait before it's sent and choose how you want to send it.

**Required fields**

* You need at least **one message** in the sequence.
* Each message needs a **Delay** of at least 1.
* Each message needs its content — the **message text**, or a selected **template** if you're sending it as one.
* **Sequence Name** is optional.

![Sequence settings showing a Sequence Name field and Step 1 with a Delay of 1 Minutes, Send as set to Message, and a Message Text box](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/sequence-settings.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=eacbadcbe6b8c92767f50bea80076a4d)

**Example**

> **Step 1** — after 1 day: "🎉 Enjoy 10% off your next order with code SAVE10."
> **Step 2** — after 3 days: "🔥 Don't miss our latest deals! Shop now and save on your favorites."

![Flow builder example showing a Button Message asking if the contact wants special offers, with a Yes, notify me option leading to two chained Sequence steps](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/sequence-example.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=45f8f24e68dcbfcf33d748c9170e3dd8)

***

## A worked example

An online shop handles "where is my order?":

1. **Start Trigger** — When message contains `order`, `track`, `where is my`.
2. **Ask Question** (Text) — "Sure! What's your order number?" → `order_number`
3. **API Request** — GET your order API with `{'{{vars.order_number}}'}` in the URL.
4. **Save Response** — map `data.status` to `order_status` and `data.tracking_url` to `tracking_url`.
5. **Logic Control** — check `order_status`:
   * **Equals** `shipped` → **Text Message** with the tracking link.
   * **Equals** `processing` → **Text Message** saying it ships within 24 hours.
   * **Is empty** → **Assign Label** `Needs human help`, then a message saying the team will reply.

![Flow builder example showing the full order-tracking flow: Start Trigger, Ask Question, API Request, Save Response, Logic Control routing by order status, and two Text Message replies for shipped and not-found orders](https://mintcdn.com/chatflows-docs/wJMcyFv6gdBNOsVY/automation/img/advance/worked-example.png?fit=max\&auto=format\&n=wJMcyFv6gdBNOsVY\&q=85\&s=c603c33c076551586bec77eb76f60275)

## What's next

> [card] [Integrations](https://docs.chatflows.io/automation/flow-steps/integrations.md)
>
> Write to Google Sheets or create Google Calendar events.

> [card] [Merge Fields](https://docs.chatflows.io/messaging/merge-fields.md)
>
> Everything you can insert with the @ key.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.