> For the complete documentation index, see [llms.txt](https://docs.suvvy.ai/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.suvvy.ai/en/main-settings/dopolnitelnye-nastroiki/follow-ups.md).

# Follow-ups

## All Groups Section

In order to add follow-ups to a script scenario, you must first create follow-up groups and then distribute the branch in which a particular group will be executed:

1. Groups to launch after a bot message
2. Groups to launch after an employee message

{% stepper %}
{% step %}
Go to the Follow-ups section and select "All groups":

<figure><img src="/files/bnNnVcM7skiA2GNh6oV8" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Click the "Create+" button and set up the follow-up:

<figure><img src="/files/kZBwbdoMerxsj4MJZe7Q" alt=""><figcaption></figcaption></figure>

We can create several groups at our discretion.

<figure><img src="/files/XyPk2sUAEjbPH7Mj7Yid" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Go to the "Groups" tab

For example, we want the "Didn't send data" group to be sent after the bot's last message. Then we click the "Add+" button.

<figure><img src="/files/BMnvlGOvVdDYesH7xkAD" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Select the required group:

A window will appear asking: "Select the desired follow-up group." Click the checkbox next to "Didn't send data." Then click "Add selected."

<figure><img src="/files/FXfNJhfv3HVr60Ls1B8r" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Next we see that our group has been successfully added to the corresponding section.

<figure><img src="/files/dGXvE2xwAMJWm5S8dBd6" alt=""><figcaption></figcaption></figure>

The steps are similar for the group we want to place in the "**Groups to launch after an employee message**" section.

Also, if we want to delete the group, we can click the red trash can icon on the right:

<figure><img src="/files/12y6vz6uKP59cEEwqypu" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
You can also trigger an action via a follow-up

<figure><img src="/files/yhxyK0NvHRegqQDCCstI" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Important: Only works for actions that are called by a trigger.
{% endhint %}

For example, if we call a bot via a trigger, this action will immediately appear in the field.

<figure><img src="/files/aEnCboampywsbrF2MMAL" alt=""><figcaption></figcaption></figure>

* **Message Sending Time** - The time after which the message will be sent.
* **Set Exact Time** - Sends the message at a specific time.
* **Reschedule Event if Scheduled Time is Outside Working Hours** - If the follow-up falls outside working hours, it will be rescheduled and sent during the scheduled working hours.
* **Set Dialog Call Limit** - The number of times a follow-up can be successfully completed in a single sending cycle.
* **LLM Instruction** - Used to determine whether specific actions should be performed in a dialog with a client based on the information provided in the dialog.
* **Fixed Message** - If this option is selected, enter a specific message to be sent to the user in the input field below.
* **Generate Message by an Existing Bot** - If this option is selected, enter instructions for additional bot actions and message generation in the input field below. For example: "Remind the user about yourself based on the context of the conversation and call the get\_file\_text(file=Administrator) function."
* **Generate a message using the LLM model** - if this option is selected, enter the message generation instructions in the input field below. For example: "Remind the user about yourself based on the context of the conversation."
* **Call a Knowledge Base file** - allows you to send a specific knowledge base file. If this setting is enabled, select the specific knowledge base file to be called by the follow-up in the File to Call field below.
* **Call an Action** - allows you to call a specific action created in the bot. It's important to note that this option only works for actions created by a trigger.
  {% endstep %}
  {% endstepper %}

## Additional options for sending follow-ups

1. **Follow-ups are sent only if the client has not responded to the bot and employee's message:**

* If the last message in the conversation was from a bot and the client did not respond, follow-ups will be sent after a specified time.
* If the last message was from the client, follow-ups are not sent.

2. **Resetting follow-ups when a client responds:**

* If the client responds, all scheduled follow-ups are reset.
* After the client responds, if the bot sends a message again, the follow-ups start counting again.

#### Exampes:

1. **Scenario 1: Client does not respond:**

* The bot sends a message
* The client does not respond within 20 minutes.
* Follow-up is sent 20 minutes after the bot's message.

2. Scenario 2: The client responds:

* The bot sends a message.
* The client responds within 10 minutes.
* All follow-ups are discarded.
* If the bot sends a message again, the follow-ups start counting again.

### Instructions in follow-ups (LLM instruction)

<figure><img src="/files/dqEpCv8JAMxAC6gp7VVz" alt=""><figcaption></figcaption></figure>

* **Pass function calls** - to check the condition, the dialog history will be passed to llm. This setting is responsible for whether to include function calls in the history.
* Use message history transfer settings from the agent

#### Example of instructions:

> If the client was provided with information about portrait sizes or was offered a suitable portrait size in the dialogue, then\
> Return false\
> Otherwise, if the dialogue only provided an approximate portrait price or no price information at all, then\
> Return true\
> Otherwise, return false\
> EndIf

**The purpose of this instruction:**

This instruction checks whether the client has been provided with specific information about portrait sizes or prices. Depending on this, it returns true or false, which can be used to make further decisions (for example, whether the conditions for sending this follow-up were met).

**How the instruction works:**

1. **First step:**

* It is checked whether the client was provided with information about the dimensions of the portraits or was offered a suitable size.
* If yes, the instruction returns false. This means that no action is required if the instruction's condition is met, so we move on to checking the second condition.

2. **Step two:**

* If information about the dimensions has not been provided, it is checked whether information about the cost of the portrait has been provided.
* If the price was only specified as an estimate (e.g., "from 1000 rubles") or not specified at all, the instruction returns true. This means additional steps need to be taken, i.e., a follow-up request with a more precise price should be sent.

3. **Step three:**

* If none of the above conditions are met, the statement returns false.
* The instruction returns true. Additional actions need to be performed.

### Explanation of instructions in simple language

#### Imagine you sell portraits:

1. **You ask the client what size portrait they want, or suggest a suitable size yourself:**

* If you've done this, then everything's okay, no further clarification is needed. You say, "Everything's clear, no further details are needed" (this is like a false statement in the instructions).

2. **If you haven't mentioned the size, but you've given an approximate cost estimate (for example, "from 1,000 rubles"), or haven't said anything at all:**

* Here you realize, "Oh, I didn't explain everything to the client, I need to clarify!" (this is like a true statement in the instructions).

3. If you've explained both the size and price:

* Then you're saying again, "It's okay, no further action needed" (this is false again).

**Simply put:**

* If you've explained everything clearly to the client (about size and price), then you don't need to do anything else.
* If you forgot to mention something (about size or price), then you need to clarify.

This instruction helps you understand whether you need to do anything further in a conversation with a client or whether everything is already in order.

#### Conclusion

This instruction helps automate the follow-up process by determining whether information needs to be clarified or whether the next steps can be taken. It returns true if the information is incomplete and false if the client has already been provided with the required data.

### Follow-up chains

<figure><img src="/files/A1xUQLr6pJbOaY0BBopC" alt=""><figcaption></figcaption></figure>

#### What is a follow-up chain?

This is a sequence of different follow-ups (pings) sent at specific intervals. Instead of sending the same follow-up message multiple times, you configure several different messages that follow each other based on specific conditions.

#### How does this work?

1. **First follow-up:**

* Sent after a specified time (for example, 10 minutes after the bot's last message).
* If the client hasn't responded, the next follow-up occurs.

2. **Second follow-up:**

* Sent after another period of time (e.g., 20 minutes after the first).
* If the client still doesn't respond, a third follow-up occurs.

3. **And so on:**

* The chain continues until there are no follow-ups or until the client responds.

### Limits in the chain

<figure><img src="/files/HVfT1BQOVGQAoUnXXSXw" alt=""><figcaption></figcaption></figure>

* The call limit is applied throughout the entire conversation, not just within a single cycle.
* If a step has a call limit (for example, 1), then after that step is successfully completed (a follow-up is sent), no more follow-ups will be sent in that conversation.
* If the limit is reached, all subsequent follow-ups in the chain will also not be sent, as they depend on the successful completion of the previous step.

{% hint style="warning" %}
Let's look at an example of sending a follow-up chain using three follow-ups (F1, F2, F3, and F4), with a limit of 1 for the follow-up (F2).\
If we have F1 (infinite), F2 (limit of 1 call), F3 (infinite), and F4 (infinite), then the follow-up sending scenario will look like this:\
F1 -> F2 -> F3 -> F4 -> F1 -> F1 -> F1...etc.\
Note: The limit for F2 was triggered, so F2 was triggered once, and all subsequent follow-ups (i.e., F3 and F4) in the second cycle are no longer triggered, since, according to the condition, they must follow F2.

### &#x20;**Important:**

\
If the follow-up call limit is triggered, then if it is reset (after the client's response) and a new sending cycle starts, only F1 will be sent, since According to the condition F2 is limited by the limit of 1, and F3 and F4 are sent after checking the conditions of F2.
{% endhint %}

A **follow-up chain** is a convenient way to send different messages at specific intervals. Limits help control where the chain should stop.

### How the Follow-Up Chain Works

1. **Each follow-up in the chain has its own execution condition:**

* Each follow-up in the chain has its own execution condition:
* If the condition is met, the follow-up is sent.
* If the condition is not met, the follow-up is not sent, but is considered successful by the system. The next follow-up's time is calculated from the time the previous one was queued.

2. **Queue and reset:**

* All first-level follow-ups are queued after a bot response, knowledge base file request, or other follow-up.
* If a client or employee chats before the follow-ups are completed, all scheduled follow-ups are canceled, and the queue restarts from level one.

3. **The sending time of each follow-up depends on the previous one**:

* If the previous follow-up has been sent, the next follow-up is scheduled for the specified time after the previous one.
* If the previous follow-up has not been sent (the condition is not met), the next follow-up is scheduled for the specified time after the initial time (the time of the last message).

#### Example:

* **Original time**: 6:00 PM (last message).
* **Thread**: f1 (5 min) → f2 (10 min) → f3 (15 min).

**Step 1: Follow-up 1 (f1):**

* **Submission time:** 18:05 (18:00 + 5 minutes).
* **Condition check:**\
  If the condition is met, f1 is sent at 18:05.\
  If the condition is not met, f1 is not sent, and the time for f2 is calculated from 18:00.

**Step 2: Follow-up 2 (f2):**

* **Departure Time:**\
  If f1 has departed, f2 is scheduled for 6:15 PM (6:05 PM + 10 minutes).\
  If f1 hasn't departed, f2 is scheduled for 6:10 PM (6:00 PM + 10 minutes).
* **Condition check:**\
  If the condition is met, f2 is sent at the calculated time.\
  If the condition is not met, f2 is not sent, and the time for f3 is calculated from 18:00.

**Step 3: Follow-up 3 (f3):**

* **Departure Time:**\
  If f1 has departed and f2 has departed, f3 is scheduled for 6:30 PM (6:15 PM + 15 minutes).\
  If f1 has departed and f2 hasn't departed, f3 is scheduled for 6:20 PM (6:05 PM + 15 minutes).
* **Condition check:**\
  If the condition is met, f3 is sent at the calculated time.\
  If the condition is not met, f3 is not sent, and the chain ends.

#### Summary:

* A follow-up chain allows messages to be sent one after another, based on conditions.
* Call limits control the number of times a follow-up can be sent within a single conversation.
* If a follow-up isn't sent due to a condition, the next follow-up is scheduled from the initial time (the time of the last message) or from the last follow-up.
* The follow-up queue is reset when a customer or employee responds and starts over from the first level.

### Schedule

<figure><img src="/files/dBMPZSDkjCByDFtx7F6K" alt=""><figcaption></figcaption></figure>

* **Trigger follow-ups after a staff member's response** means the bot will send follow-ups not only after its own messages, but also if the client doesn't respond after the staff member's message.
* **Follow-up schedule** - an option for setting up a work schedule. This is used to prevent follow-ups from being sent at night if you have follow-ups configured to be sent at a specific time rather than at a specific time.
