Communication
Nodes in the Communication section are used to hand a bot conversation over to an external operator or support service, and to answer customers through an AI agent.
1. Operator chat
Operator chat hands the current conversation over to an operator through the selected chat integration and ends the current bot scenario. The Smsbat operator chat supports Telegram, Viber bot, and Instagram.
Settings
| Field | Meaning |
|---|---|
Title |
Node title on the canvas. |
ChatIntegrationId |
Selected enabled chat integration of the current bot. |
ScreenId |
Optional initial Screen. Its messages and buttons are displayed when the operator chat opens. |
Provider |
Chat provider: Unitalk=0 or SmsBat=1. |
NoteTemplate (Note for the operator) |
Optional operator note: a template with #var and {{ JS }}. The operator sees it as the first service message in the chat; the customer cannot see it. Supported by the Smsbat provider. |
Create credentials and a chat integration in the bot card, then select the integration in ChatNode.
Connections
- Input: one standard connector.
- Outputs: no regular transition to a following node.
Operator chatis a terminal node and ends the current scenario execution.OnChatClosedis a separate entry point for a new flow after the operator chat is closed, not a connection fromOperator chat.ScreenIdis a separate connection to the initialScreen. OnlyScreencan be connected here; other node types are not supported.
How it works
The node opens an operator chat through the selected integration. The handoff is considered successful only after the external chat has been confirmed as opened.
If NoteTemplate is set, the node renders the note at handoff and sends it when opening the chat. A template error does not stop the handoff: the chat opens without a note. Empty notes are not sent.
If an initial Screen is connected, MyCodeBot sends its messages and buttons. While the chat is open, user messages are forwarded to the operator and the regular bot scenario does not run.
ChatNode ends the current scenario execution. The node does not create its own variables or return JSON.
Example
Button "Operator" -> Operator chat
Initial Screen: "Please wait for an operator"
This Screen's button "Main menu" -> Screen "Main menu"
OnChatClosed -> Screen "Chat ended"
A button on the initial Screen closes the chat first, then follows its transition. Closing the chat from the operator panel starts the OnChatClosed scenario.
Example Note for the operator for SMSBAT (the AI agent node has ID 40, and topic is an additional response field):
Topic: #node.40.ai.topic
Phone: #member.phone
AI conversation:
#node.40.ai.transcript
Important details
Operator chatis a terminal node and has no regular transition to a following node.- Only the operator can see the note.
- To include a phone number in the note, collect it earlier with a
Phoneinput andSave as member phone:#member.phonewill already be populated. - If the integration is missing, disabled, uses the wrong provider, or cannot open the external chat, execution ends with an error.
Operator chatis not used in a synchronous AI tool because the terminal node does not return JSON.- The initial Screen and its buttons are optional and can be configured separately. Without a Screen, no initial message is sent.
- The integration must be configured and enabled. The same integration cannot be used in two ChatNode nodes in one schema.
- When a schema is imported into another bot, the connection to an integration belonging to another bot or an unavailable integration is cleared. The Screen and its transitions are preserved. Before using this node, select an integration of the target bot.
2. AI agent
AI agent (AgentNode) sends a customer message to the selected AI agent, receives a response and additional fields, and passes control to the next node. The node itself sends nothing to the customer: a following Screen displays the response through #node.{id}.ai.answer.
Settings
| Field | Meaning |
|---|---|
Title |
Node title on the canvas. |
AgentId (Agent) |
An active AI agent in the account; required. The prompt, business rules, knowledge base, and tools come from the agent's settings. |
MessageTemplate (Message) |
The customer message the agent should answer. A template with #var and {{ JS }}; defaults to #userInput. Saved in conversation history. |
ContextTemplate (Context) |
Optional additional information for the agent at this step: customer type, name, time, etc. A template with #var and {{ JS }}. Sent with the message, but not saved in history or included in ai.transcript. |
OutputFields (Output fields) |
Up to 10 additional fields returned separately from the response: Name, Description (instructions for the AI), and optional AllowedValues. |
NextAction |
The next node after the agent responds. |
Output fields rules:
Name:a-z,0-9,_, starts with a letter, up to 40 characters, unique within the node. Reserved names:answer,has_answer,needs_human,hasanswer,needshuman,issuccess,error,transcript.AllowedValues: up to 30 values, each 1–100 characters, with no duplicates. When a list is provided, the agent returns exactly one listed value or an empty value. Without a list, any text is allowed.
Connections
- Input: one standard connector.
- Output: one
Next(NextAction). - Branch on the response using a separate
ConditionorSwitchnode with#node.{id}.ai.*variables.
How it works
The node renders Message and Context, adds the member's conversation history, and calls the agent. History is shared by all AI agent nodes of this bot for the same member.
The response is not sent to the customer automatically. To show it, connect Next to a Screen containing #node.{id}.ai.answer in its text.
Errors do not stop the scenario; execution continues through Next:
- the agent is unavailable, the usage limit is reached, or the request times out (45 seconds) —
ai.isSuccess = False,ai.needsHuman = True, andai.errorcontains the error code; - the message is empty (for example, the customer sent only a file), or the
MessageorContexttemplate has an error — the AI is not called:ai.isSuccess = False,ai.needsHuman = False, andai.error = empty_messageortemplate_error.
Output variables
| Variable | Meaning |
|---|---|
#node.{id}.ai.answer |
The agent's response text. |
#node.{id}.ai.hasAnswer |
True if the agent has an answer. |
#node.{id}.ai.needsHuman |
True if the agent considers human assistance necessary; also True when the agent call fails. |
#node.{id}.ai.isSuccess |
True if the agent call succeeded. |
#node.{id}.ai.error |
Empty or an error code: timeout, usage_limit, AgentNotFound, empty_message, template_error, error, and others. |
#node.{id}.ai.transcript |
Conversation history and the current step as “Name: text” lines (customer name from #member.name, bot name from #bot.name). Useful for operator notes. |
#node.{id}.ai.{name} |
The value of an Output fields entry; empty if the agent did not return it. |
Important details
Execute nodein the builder does not call the AI:ai.*variables are empty andai.error = not_dispatched. Test the agent in the test chat on its page, and test the complete scenario in the messenger.- The node cannot be used in tool schemas (
Agent trigger): such a tool cannot be activated. - The agent must be active when saving the node.
- Importing a schema into another account clears the agent selection: the card shows “Agent not selected”. Select an agent again.
- The
ai.*variables, including Output fields entries, appear immediately in the variable picker of subsequent nodes. - For Instagram, set a response length in the agent's rules, for example up to 1000 characters — the Instagram message limit.