Skip to content

Send Follow-Up

This module generates and prepares follow-up messages to send to the user when they have not responded. It supports three message generation modes:

  1. AI (ai): Generates the message automatically using an LLM. The system prompt instructs the AI to create short, natural, and non-invasive messages adapted to the follow-up number. It can reuse the brain configured in the session’s agent or use its own.
  2. Template (template): Uses a predefined message with dynamic variables such as {{name}}, {{last_topic}}, {{follow_up_number}}, etc. Variables are replaced with session data and extracted entities.
  3. Dynamic (dynamic): Takes the message directly from the input data (message, text, or content).

The module optionally:

  • Adds the follow-up message to the session history.
  • Updates session counters and timestamps in the database.

If AI generation fails, a predefined fallback message is used based on the follow-up number.

ParameterTypeRequiredDescription
message_modeselectYesHow the follow-up message is generated. Options: ai, template, dynamic. Default: ai.
template_messagetextareaNoTemplate message. Supports variables like {{name}}, {{last_topic}}, etc. Visible in template mode.
ai_prompttextareaNoInstructions for the AI on how to generate the follow-up message. Visible in ai mode.
use_session_brainbooleanNoUse the same AI configured in the session’s agent. Default: true. Visible in ai mode.
brain_providerselectNoAI provider for generating the message. Visible if use_session_brain is false.
brain_modelaiModelSelectorNoAI model to use. Default: gpt-4o.
credentials_keycredentialsNoAI provider credentials. Visible if use_session_brain is false.
max_tokensnumberNoToken limit for the generated message. Min: 50, Max: 1000. Default: 200. Visible in ai mode.
temperaturenumberNoMessage creativity (0.8 recommended for follow-ups). Default: 0.8. Visible in ai mode.
include_contextbooleanNoInclude conversation context to generate a more relevant message. Default: true.
update_sessionbooleanNoAdd the sent message to the session history. Default: true.

Optional. If use_session_brain is true, the agent’s credentials are reused. Otherwise, credentials_key must be configured.

{
"success": true,
"message": "Hola! Vi que estabamos conversando. Hay algo en lo que pueda ayudarte?",
"session_id": "uuid-sesion",
"channel": "whatsapp",
"external_id": "5491112345678",
"follow_up_number": 1,
"message_mode": "ai",
"generated_at": "2026-03-23T10:00:00.000Z"
}
{
"message_mode": "template",
"template_message": "Hola {{nombre}}, queria retomar nuestra conversacion sobre {{ultimo_tema}}. Puedo ayudarte en algo mas?",
"include_context": true,
"update_session": true
}
  • session_id: Agent session ID.
  • last_topic: Last conversation topic.
  • last_user_message: Last user message.
  • memory: Session memory.
  • entities: Extracted entities (name, email, etc.).
  • follow_up_number: Follow-up number (1, 2, 3…).
  • channel: Communication channel.
  • external_id: User’s external ID.

In AI mode, the configured provider’s API (OpenAI, Anthropic, Google, etc.) is called to generate the follow-up message.

  • Predefined fallback messages are: (1) “Hi! I noticed we were chatting…”, (2) “I just wanted to check if you have any pending questions…”, (3) “I hope everything is going well…”.
  • In template mode, unreplaced variables are removed from the final message.
  • A temperature of 0.8 is recommended for follow-ups, as it generates more varied and natural messages.
  • The module does not send the message directly; it generates the text for a subsequent node (e.g. Telegram, WhatsApp) to send it.