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

# Logic & Timing

> Branch your automation with conditions and business hours, wait with delays, jump ahead, or hand off to another automation.

## What is this?

**Logic** steps don't send anything to the customer. They decide **which way the automation goes** next, or **when** it continues. Think of them as the road signs and traffic lights of your flow.

\[SCREENSHOT: automation-steps-logic-branches — A Condition Logic step with its Success and Fail outputs connected to two different messages]

## What can I do here?

| Step                                  | Decides                                     | Paths                           |
| ------------------------------------- | ------------------------------------------- | ------------------------------- |
| [Condition Logic](#condition-logic)   | Yes or no, from one or more rules           | **Success**, **Fail**           |
| [Condition Branch](#condition-branch) | One of many, by matching a value            | One per value, plus **Default** |
| [Working Hours](#working-hours)       | Are you open right now?                     | **Open**, **Closed**            |
| [Delay](#delay)                       | Wait before continuing                      | One                             |
| [Jump To](#jump-to)                   | Skip straight to another step               | None needed                     |
| [Switch](#switch)                     | Hand the conversation to another automation | One                             |

## How to use it

### Condition Logic

**What it does:** checks one or more rules and follows **Success** if they pass, or **Fail** if they don't.
**When to use it:** "Is the customer's city Mumbai?", "Did they leave the budget empty?", "Does their message contain *refund*?"

Each rule has:

* **Comparator Source** — what to look at: the **Last Message Received**, or a **Contact/Custom Field**.
* **Operator** — **Equals**, **Not Equals**, **Greater Than**, **Less Than**, **Contains**, **Starts With**, **Ends With**, **Is Empty**, or **Is Not Empty**.
* **Value** — what to compare against, as **Free Text** or another **Custom/Contact Field**.

Click **Add Condition** to add more rules, and choose **AND** (all must pass) or **OR** (any can pass) to combine them.

### Condition Branch

**What it does:** compares **one** thing against several values and sends the customer down the matching path.
**When to use it:** menus and statuses — an order status of *shipped*, *delivered*, or *cancelled*, or a language choice.

* **Comparator Source** — the **Last Message Received** or a **Contact/Custom Field**.
* **Branch Values** — click **Add Branch** and give each a **Label** (for your eyes) and a **Value** to match.
* **Enable Default branch** — a catch-all path for anything that matches none of your values. Turn this on so no customer is left stuck.

### Working Hours

**What it does:** checks whether it's currently within business hours and follows **Open** or **Closed**.
**When to use it:** "We'll reply now" during the day, and "We're closed, back at 9am" at night.

* **Use channel business hours** (recommended) — uses the schedule you set next to the channel switcher, shared by WhatsApp, Web Chat, Facebook, and Instagram.
* Or set a **custom schedule** for this step: pick a **Timezone**, then for each day mark it **Closed all day** or set **Open** and **Close** times, with optional **Break Start** and **Break End**.
* **Holiday Dates (Optional)** — dates that always route to **Closed**.
* **Fallback When Schedule Missing** — where to go if there's no schedule.

### Delay

**What it does:** waits, then continues.
**When to use it:** follow-ups ("Wait 2 days, then check in"), or a short pause between messages.

* **Delay** — a **Value** and a **Unit** (**Minutes**, **Hours**, or **Days**). The minimum is 1 minute and the maximum is 6 months (180 days).

### Jump To

**What it does:** jumps straight to another step in the same automation, skipping the normal lines.
**When to use it:** going back to an earlier menu or tidying up a flow with too many crossing lines.

* **Target Node** (required) — the step to jump to. No output connection is needed.

### Switch

**What it does:** starts a **different automation** for the same contact and conversation.
**When to use it:** right after a button or list choice — "Sales" runs the Sales automation, "Support" runs the Support one — without rebuilding each branch here.

* **Automation to Trigger** (required) — another automation. You can't pick the one you're editing, so it can't loop.

## Troubleshooting / Technical Notes

* **Nothing matched and the customer got no reply.** Turn on **Enable Default branch** in Condition Branch, and connect **Fail** in Condition Logic.
* **Working Hours always says Closed.** Check the timezone and that the day isn't marked **Closed all day** or listed as a holiday.
* **The delay is too short or too long.** The range is 1 minute to 180 days; for a series of timed messages use [Sequences](/workspace/automation/steps/sequences).
* **Switch shows no automations.** You need at least one other automation on the channel.

## Related docs

* [Builder Steps overview](/workspace/automation/steps/overview)
* [Sequences](/workspace/automation/steps/sequences)
* [Actions](/workspace/automation/steps/actions)
* [Manage Live Flows](/workspace/automation/manage-live-flows)
