# Cascade dispatch

Cascading sends a single message through multiple channels. If the message is not delivered, not read, or the client does not respond within a given time, ChatRex Lite moves to the next step of the script.

The cascade can be launched:

- automatically via **Digital Pipeline**
- as the action **Salesbot**;
- manually by phone number from the transaction card or contact amoCRM.

## What to prepare

Before launch:

1. Connect to ChatRex Lite at least two channels you want to use sequentially.
2. Create and include a cascade script.
3. Create and enable a message template or prepare your own text for manual submission.

Disabled scripts and templates cannot be selected in amoCRM.

## Creating a cascade scenario

Open the ChatRex Lite settings and go to **Temples> Scenarios Cascades**. The list displays the name, sequence of channels, status and actions available.

To create a script:

1. Press **Add script**.
2. Enter a clear title, such as “Remembering”.
3. Enable the status **Active**.
4. Add two or more steps.
5. Place the steps in the right order by dragging.
6. Save the script.

For each step shall be specified:

- **Channel** is one of the connected channels of the account.
- **Transition condition** - when to proceed to the next step;
- **Wait time** - from one minute, in minutes or hours.

Available transition conditions:

- if the message is not delivered;
- if the message is not read;
- If the message is not delivered or read;
- if the customer didn't respond.

The message is sent in steps from top to bottom. If the channel is disabled, it cannot be added to the new scenario.

## Creating a message template

Open **Temples>Message Templates** and press **Add template**.

Fill in:

- **Name of the template**;
- **Text of the message**;
- a way to bypass anti-spam filters;
- status **Active**.

AmoCRM fields can be used in the text. Enter `@` and select the desired field - when sending ChatRex Lite will substitute the value from the transaction or contact.

!!!
The same prepared text is used on all steps of the selected cascade.
!!!

## Launching with Digital Pipeline or Salesbot

1. Open the automation setting in amoCRM.
2. Add the ChatRex Lite action.
3. Enable **Cascading send**.
4. Select the active **cascade scenario**.
5. Select **Message Template**.
6. Save action and automation.

When the cascade is turned on, the channels, their order, transition conditions and waiting time are taken from the script. Text and anti-spam processing are taken from the template, so you do not need to choose a channel in the form of Salesbot or Digital Pipeline separately.

If you created or modified a script, click the update icon next to the list. The list is updated without reloading the page. If a previously selected script or template has been disabled or removed, select another.

When the cascading sending is turned off, the action works in normal mode: select one channel and a template or **Your text** option.

## Manual launch from amoCRM card

1. Open the transaction or contact card.
2. Click on the customer's phone number.
3. Select **Cascading send**.
4. Check the phone number.
5. Choose an active cascade scenario.
6. Select a message template or **Your text**.
7. Press **Send**.

If you select **Your text**, fill in the message manually. To substitute the amoCRM field, type `@` and select it from the list.

After successful launch, a notification **Cascading is launched** will appear.

## When the cascade ends

ChatRex Lite will stop sending if:

- the condition of successful delivery of the current step is fulfilled;
- The customer responded in any channel;
- All the steps of the script have ended.
- Launch cancelled by the system;
- There was a critical error.

After completion, the cascade result is added to the amoCRM as a note. You can check the result of the shipment.

## If the cascade doesn't start

Check it out.

- script and template active;
- There are steps in the script.
- Selected channels are connected and available.
- in automation, both a script and a template are selected;
- the card has the correct phone number and a transaction or contact is determined;
- Your own text is not left empty.

To configure normal automatic messages without a cascade, use the instruction [**Automate messages**](./automation.md).
