> Every page of the Heythere docs is listed in https://heythere.io/docs/llms.txt: fetch it to find a page instead of guessing its URL.

# Steps: what a WhatsApp automation can do

> Ask questions, send messages, use AI, wait, save values, and call your other tools, one step of an automation at a time.

When Camille asks whether her bike is ready, the repair shop's automation checks its repair software, asks her for a pickup time, and hands her to a member when she wants one. Each of those is a step, one node of an [automation](https://heythere.io/docs/concepts/automations)'s graph. A [run](https://heythere.io/docs/concepts/runs) executes one step at a time, then follows its transition to the next.

| `type`          | Does                                                                                                                                                          |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `send_text`     | Sends a text.                                                                                                                                                 |
| `send_link`     | Sends a text with a button that opens a link.                                                                                                                 |
| `send_template` | Sends a [template](https://heythere.io/docs/concepts/message-templates), even outside the reply window.                                                                          |
| `ask_text`      | Asks for a `text`, `number`, or `email`, and can save it.                                                                                                     |
| `ask_buttons`   | Asks the contact to tap one of 1 to 3 reply buttons.                                                                                                          |
| `ask_list`      | Asks the contact to pick one of at most 10 rows.                                                                                                              |
| `ai_agent`      | Converses with an [AI](https://heythere.io/docs/concepts/ai) agent, saves values, and picks its exit.                                                                            |
| `classify`      | Takes the category [AI](https://heythere.io/docs/concepts/ai) finds in the conversation.                                                                                         |
| `condition`     | Takes the first branch whose conditions hold, or its `onElse`.                                                                                                |
| `wait`          | Waits for a duration, a date, the opening of a [schedule](https://heythere.io/docs/concepts/variables), a [webhook](https://heythere.io/docs/concepts/webhook-sources) request, or a polled answer. |
| `set_value`     | Writes values to the run or to the contact, fixed, computed, or generated.                                                                                    |
| `handover`      | Ends the run and hands the conversation to the members in a [live chat](https://heythere.io/docs/concepts/live-chats).                                                           |
| `http_request`  | Calls another service, such as Slack or a CRM, and saves values of its response.                                                                              |

A run ends at a step with nothing after it. A `handover` sends nothing itself, so a `send_text` before it tells the contact a member will answer.

Publishing refuses a message other than a `send_template` that could go out after the [reply window](https://heythere.io/docs/concepts/conversations#when-does-a-conversation-s-reply-window-close-) closes. That happens after a `wait` until a date or a schedule's opening, or when waits and question timeouts add up to 24 hours since the contact's latest message.

## Where do steps keep values?

A step saves a value to the run, as `run.<variable>`, which lasts as long as the run, or to the contact, as an [attribute](https://heythere.io/docs/concepts/attributes) that later runs read too. A message inserts a value with a placeholder, such as `{{contact.first_name}}`, or a workspace [variable](https://heythere.io/docs/concepts/variables), such as `{{workspace.shop_address}}`.

## How does a question work?

Each reply button or list row leads to its own next step. The contact answers by text or voice note, and taps or names a choice. Heythere's [AI](https://heythere.io/docs/concepts/ai) reads a reply the usual formats do not, such as "thirty-one" or "around 3pm" for "Afternoon"; `readsRepliesWithAi` false turns that off. An unclear reply asks again; the fifth in a row takes the optional `timeout`, as silence past it does, or ends the run.

## How does a `set_value` step compute a value?

It evaluates a JavaScript expression, such as `run.price * run.quantity`, that reads `contact.<field>`, `run.<variable>`, and `trigger.<field>` by name, with the methods of texts, numbers, lists, and dates. An expression never calls an API. One that throws, such as `run.total.trim()` on a number, writes none of the step's values and fails the [run](https://heythere.io/docs/concepts/runs).

## How does a `condition` step choose a branch?

It takes the first branch whose conditions all hold, or `onElse`. A condition compares a field, as an [audience](https://heythere.io/docs/concepts/audiences) does, is a boolean expression, such as `run.age >= 18`, or is a statement [AI](https://heythere.io/docs/concepts/ai) judges.

## How does an `http_request` step call another service?

It sends its request when the run reaches it, reading placeholders such as `{{run.email}}` into its URL, headers, and JSON body, and credentials from workspace [secrets](https://heythere.io/docs/concepts/secrets), as `{{secret.crm_token}}`.

A 2xx response saves the values `responseValues` names, such as `body.lead.id` to `contact.crm_id`, and the run takes `next`. Any other outcome takes `onError`, or fails the run without it.

It reaches only public addresses.
