> This page is for Cloud Call Center.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.hams.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.hams.ai/_mcp/server.

# After-call sequences

> Run nodes automatically after a call ends, such as a WhatsApp message or a workflow.

An after-call sequence is a second part of a call flow. It runs after the caller hangs up. Use it for work that does not need the caller on the line.

For example, send a WhatsApp message to callers who did not get an answer.

Only administrators can edit call flows. For the basics of the builder, see [Call flows](/cloud-call-center/call-flows).

![The After call view: a trigger condition, a wait, a WhatsApp follow-up message, and a workflow run.](/_fern-img/b4fe533acad2b362e1c9ddb31fca53deadad35e87cff2e821f1a0adbfb831042.webp)

## Add an after-call sequence

#### Open the call flow

Go to **Call Flows**. Open the flow. The builder shows the **On the call** view.

#### Open the After call view

Click **After call**. The view starts at the **After Call Ended** trigger.

#### Set the trigger

Select **After Call Ended**. Add conditions to choose which calls run the sequence. See [The trigger](#the-trigger).

#### Add nodes

Click the **+** below the trigger. Pick a node. Set the node in the side panel. Add more nodes in the order that you need them.

#### Publish the flow

Click **Publish**. The sequence runs for calls that end after you publish.

The sequence is part of the same call flow. **Publish**, **Stop**, and **Resume** apply to both views. A run that already started keeps the sequence that it started with. A later publish or stop does not change it.

## The trigger

The trigger decides which calls run the sequence. The system checks it at the moment the caller hangs up. The conditions use the final values of the `call.*` variables. See [Call variables](/cloud-call-center/call-flows#call-variables).

The value of `call.outcome` is the view of the flow. For a call that entered a queue, it can differ from call history. The flow does not know what the queue did.

Set **Run the sequence when** to **All conditions match** or **Any condition matches**. Click **Add condition** to add a condition. If you add no condition, every call runs the sequence.

For example, use the condition `call.outcome` **Equals** `no_answer`. The sequence then runs for missed calls only.

## The nodes

| Node                         | What it does                                                                        |
| ---------------------------- | ----------------------------------------------------------------------------------- |
| **Set variable**             | Writes one or more variables. Later nodes read them. It also works during the call. |
| **Send WhatsApp message**    | Sends a WhatsApp message through Omni Channel. It also works during the call.       |
| **Wait**                     | Pauses the sequence for a set time, from 1 second to 10 days.                       |
| **Run workflow**             | Starts a manual Omni Channel workflow for the contact. It ends the sequence.        |
| **Branch**                   | Branches on conditions that you define.                                             |
| **Business hours**           | Branches on whether the current time is inside a weekly schedule.                   |
| **Distribute by percentage** | Splits runs across branches by percentage.                                          |
| **Jump**                     | Continues at an earlier node, up to 10 times.                                       |
| **HTTP request**             | Calls an external API and saves values from the response.                           |

Nodes that use the caller line, such as **Answer**, **Play sound**, and **Queue**, are not available. The caller has already left.

A sequence can have up to 50 nodes. It can loop only through a **Jump** node.

### Send WhatsApp message

The node sends a message from a WhatsApp inbox in Omni Channel. Set these fields:

* **WhatsApp inbox**: the inbox that sends the message.
* **Send as**: the kind of message to send. See the table below.
* **Message**: the text. It can be up to 4096 characters and can use variables.
* **Template**: the approved template. Some modes need a template.
* **Send to**: the number that receives the message. Leave it empty to send to the number that called.

| **Send as**                               | What the node sends                                                                    |
| ----------------------------------------- | -------------------------------------------------------------------------------------- |
| **Text, template once the window closes** | The text while the 24-hour reply window is open. The template after the window closes. |
| **Text only**                             | The text. The message fails if the window is closed.                                   |
| **Template always**                       | The template, always.                                                                  |

The node has 2 outcomes, **Sent** and **Failed**. **Sent** means that Omni Channel accepted the message. It does not mean that the caller received it.

When the message fails, the reason is in `{{ vars.$message_error }}`. The value is one of `window_closed`, `template_missing`, `invalid_number`, `inbox_unavailable`, `not_manual`, `contact_conflict`, `channel_error`, or `omni_unconfigured`. To handle each case, add a **Branch** node that tests the value.

### Run workflow

The node hands the contact to a workflow in Omni Channel. The workflow must have the **Manual** trigger. Set these fields:

* **Workflow**: the workflow to run.
* **Inbox**: where the conversation of the workflow lives. The default is **The call's own inbox**.
* **Contact number**: the number that the workflow runs for. Leave it empty to use the number that called.
* **Variables**: up to 20 values that the workflow reads as `vars.*`. For example, name `call_outcome` with the value `{{ call.outcome }}`.

If the call has only the Phone inbox, the node starts no workflow. The timeline shows **Workflow did not start** and the reason **no chat thread to run in**. To avoid this case, choose a WhatsApp inbox in **Inbox**.

The timeline can show one of these reasons when the workflow does not start:

* **not a published manual workflow**: the workflow does not have the **Manual** trigger, or you did not publish it.
* **no chat thread to run in**: the inbox is the Phone inbox.
* **conditions did not match**: the contact does not match the conditions of the workflow.
* **already enrolled**: the contact is already in a run of this workflow.
* **subscription ended**: the subscription of the Omni Channel account ended.
* **the inbox could not take it**, **the channel did not answer**, **no Omnichannel account linked**: Omni Channel could not accept the request.

The node ends the sequence. The workflow handles everything that the contact does next. See [Workflows](/omni-channel/workflows).

### Wait

The node pauses the sequence. Set **Wait for** and **Unit**: seconds, minutes, hours, or days. The default is 10 minutes. The longest wait is 10 days.

The run continues after a restart. A pause does not use a phone line.

### Set variable

The node writes up to 20 variables. The system writes them in order, so a later value can read an earlier value. For example, set `first_name` and then use it in a message.

## Variables in a sequence

An after-call sequence sees the final `call.*` values, for example `call.outcome` and `call.talk_seconds`. It also gets a copy of the `vars.*` variables at the end of the call.

Sensitive variables do not carry over. In the sequence they are empty. This applies to a value that you collected with **Treat as sensitive**.

## Retries

The system saves its place after every node. If a run stops in the middle, the system continues it. A node can therefore run again. The Omni Channel nodes and the **HTTP request** node send a key that is unique for each run and node. The receiver can use the key to drop a repeat.

If a run cannot finish after several attempts, the run stops. The timeline shows **After-call sequence stopped**.

## See the result

Open the call in [Call history and recordings](/cloud-call-center/call-history). The timeline of the call has an **After call** divider. The events below it show the sequence.

| Timeline event                        | What it means                                                                                                  |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| **After-call sequence started**       | The trigger matched, and the run started. The event is `after_call.started`.                                   |
| **Paused until** a time               | A **Wait** node holds the run. The event is `after_call.waiting`.                                              |
| **WhatsApp message sent to** a number | A **Send WhatsApp message** node sent a message. The event is `message.sent`.                                  |
| **WhatsApp message not sent**         | The node failed. The event shows the reason.                                                                   |
| **Workflow started**                  | A **Run workflow** node started the workflow. The event is `workflow.started`.                                 |
| **Workflow did not start**            | The node did not start the workflow. The event shows the reason.                                               |
| **Web request**                       | An **HTTP request** node made a call. A failed call shows **Web request failed**. The event is `http.request`. |
| **After-call sequence finished**      | The run reached its end. The event is `after_call.ended`.                                                      |

## Related

* [Call flows](/cloud-call-center/call-flows) explains the builder, the call variables, and publish.
* [Workflows](/omni-channel/workflows) explains how to build a workflow that you can start from a call flow.
* [Call history and recordings](/cloud-call-center/call-history) explains the call timeline.