Skip to content

Events

Nodes in the Events section are scenario entry points. They do not expect an incoming connection: execution is started by MyCodeBot, a messenger callback, a custom trigger, or an AI agent.

The original documentation describes six event types: OnMemberFollow, OnEnd, OnError, OnTrigger, OnChatClosed, and OnAgentTriggered.

1. Error

Error (OnError) starts a separate error-handling branch.

Use it when scenario errors need a dedicated flow, for example to show a fallback message or perform other error-specific handling.

Connections

  • Inputs: none — this is an entry point.
  • Output: one NextAction to the first node of the error flow.
  • If the handler is empty, no separate error flow is started.

Important details

In the current host code, OnError starts NextAction directly without executing the EventNode itself. Therefore, #node.{id}.event_triggered is not created for this event.

2. Trigger

Trigger (OnTrigger) starts a scenario from a custom action or parameter.

Connections

  • Inputs: none — this is an entry point.
  • Output: one NextAction.
  • Custom OnTrigger uses a dedicated endpoint for creation/configuration.

Result

Normal event execution creates:

#node.{id}.event_triggered
#node.{id}.trigger_param

If trigger_param is not provided, its value is:

none

Important details

  • Custom OnTrigger with a parameter is implemented for the Telegram start command.
  • An equivalent Viber lookup is not described in the verified code.
  • If the target action is empty or missing, execution ends with an error.

3. Agent trigger

Agent trigger (OnAgentTriggered) is the entry point for a synchronous AI tool. It receives arguments from the AI agent, validates them against a JSON Schema, and starts a synchronous flow.

Settings

Field Meaning
InputJsonSchema JSON Schema describing the AI tool arguments
NextAction Transition to the first processing node

Connections

  • Inputs: none — this is the AI tool entry point.
  • Output: one NextAction.
  • An AI tool schema must contain exactly one OnAgentTriggered.
  • Every execution branch must eventually end with JSON output.

Output variables

Validated top-level arguments are available as:

#node.{id}.arguments.{property}

The complete canonical arguments JSON is available as:

#node.{id}.arguments_json

Example

Agent trigger
  -> HTTP Request
  -> Condition
       | success -> JSON output
       | failure -> JSON output

Important details

  • OnAgentTriggered cannot be activated without a valid NextAction.
  • A synchronous AI tool cannot use a flow that waits for new user interaction.

4. OnMemberFollow

OnMemberFollow starts the initial flow when a user begins interacting with the bot.

The event is used for:

  • Telegram /start;
  • Viber conversation_started.

It may also run for a member that already exists.

Connections

  • Inputs: none — this is an entry point.
  • Output: one NextAction to the first node of the start flow.

Result

Normal execution creates:

#node.{id}.event_triggered
#node.{id}.trigger_param

Example

OnMemberFollow
  -> Screen "Welcome"

Important details

If the target action is empty or missing, execution has nowhere to continue and ends with an error.

5. OnChatClosed

OnChatClosed starts a new scenario after an operator chat is closed.

For example, it can be used to return the user to the bot flow after a conversation with an operator has ended.

Connections

  • Inputs: none — this is an entry point.
  • Output: one NextAction.
  • If the handler is empty, no separate flow is started.

Variables

The following global chat variables are available when the event starts:

#chat.sessionId
#chat.provider
#chat.integrationId
#chat.closedAtUtc
#chat.closeEventId

Example

OnChatClosed
  -> Screen "The operator chat has ended"

Important details

In the current host code, OnChatClosed starts NextAction directly without executing the EventNode itself. Therefore, #node.{id}.event_triggered is not created for this event.

6. OnEnd

OnEnd is a reserved scenario-completion event type.

No automatic host trigger for OnEnd was found in the verified backend, so it should not be relied on as a guaranteed callback after a flow finishes.