The Run AI Agent block (also called AI Agent in some editor views) lets an AI model answer questions and, when enabled by the bot owner, ask visitors to choose an option, use session variables, invoke approved text-only groups, or access connected tools.
Available in Sendbot Studio. The native-choice flow has been verified in the web chat and Studio preview. Optional external integrations depend on the configured provider, credentials, permissions, and channel. Test those integrations separately before publishing.

What’s new in Run AI (October 2026)

Run AI now supports server-validated buttons that appear as visitor answers after selection, opt-in mandatory first choices, session-variable binding, and allowlisted text-only subflows. Interactive choices use the same visual theme as standard Sendbot buttons. Read-only agents can also offer choices without gaining permission to write. The implementation prevents the flow from silently advancing if a mandatory choice fails. Verified in real webchat/Studio use: the path from plan selection to saved variable, approved FAQ text, feedback, and a final Finish/Review choice. External MCP writes, other providers and paid media integrations have separate validation requirements; they are not automatically certified by this test.

Get started in Studio

  1. Open Sendbot Studio, choose a workspace, and open an existing bot or create one.
  2. In the flow editor, add the AI Agent / Run AI Agent block from Integrations.
  3. Select an AI Provider, Model, and a valid Credentials entry (or the available managed credentials for your workspace).
  4. Write a Prompt / Input describing the task. Add a System prompt if you need specific behavior or restrictions.
  5. Connect the block to the following text or input blocks. Open Preview and test a full conversation.
  6. Review the draft, then use the normal Studio publishing process. Saving changes does not automatically publish them.
The AI provider can take longer to respond than ordinary text and button blocks, particularly on the first model call or when tools are invoked.

Example: ask the visitor to select a plan

Create a session variable named selected_plan in the editor first. Then configure the Run AI block: Use this example prompt:
The AI requests a native, server-validated single-choice interaction. In web chat, the question is a bot message, the options use the existing Sendbot button theme, and the selected option appears as the visitor’s answer after confirmation. The old buttons do not remain clickable. The internal value (such as green) can be saved in the selected session variable.
Require an initial native choice enforces the tool call on the first model round. Without it, simply asking the model to display a choice in a prompt does not guarantee that it will use requestChoice. This option is off by default.
Native choices are for one option at a time. To make a fixed, non-AI menu with branches, or to collect multiple choices, use the regular Buttons input instead.

Use the answer in the rest of the flow

  1. After the Run AI block, add a Text block.
  2. Include the saved session variable using the editor’s variable insertion control.
  3. Add other inputs or conditions as needed.
  4. Preview both options and check that the next block uses the correct value.
Only the session variable explicitly selected in Save selected choice to session variable can receive the native choice value. The AI does not choose an arbitrary variable name to write.

Call a pre-approved text-only subflow

Use this when the agent needs to reuse a small FAQ, policy explanation, or other read-only text group from the same bot.
  1. Create a separate group containing only plain Text blocks. Do not connect this group to webhooks, scripts, Bot links, integrations, nested flows, or actions.
  2. In the Run AI block, enable Enable authorized read-only subflows (text-only groups).
  3. Under Approved text-only subflow groups, add an alias (for example faq), its purpose, and the ID of the existing group in this bot.
  4. If the group needs inputs, explicitly map up to five typed values (string, number, or boolean) to existing session variables.
  5. Ask the agent to call the authorized callSubflow_faq tool when the visitor requests the FAQ. Preview the result.
Limits: up to 8 allowlisted groups, up to 8 plain-text blocks per group, up to 5 mapped inputs per tool, and up to 12 subflow calls per agent block/session. Inputs run in an isolated, read-only frame. The bot’s active session graph is version-bound.
This is not a general workflow executor. An authorized text-only subflow cannot run external APIs, send emails, charge customers, change accounts, execute code, invoke other bots, or write session variables. Enabling Read-only Support (no actions) also disables subflow execution.

Read-only Run AI

Enable Read-only Support (no actions) when the agent should answer questions without changing records or carrying out external actions. You can still enable structured choices and Require an initial native choice in read-only mode. For example, the agent can ask Finish / Review, wait for a real click, and respond with a summary. For external MCP access in read-only mode, provide an explicit, non-empty Allowed Tools list of provider-declared read tools. Write tools, ambiguous tools, and tools outside the allowlist are blocked. A prompt saying “read-only” is not a substitute for these settings.

Optional: external MCP tools and built-in capabilities

The Run AI block also has optional capabilities. None of these is needed for basic native choices. For MCP tool access, configure Allowed Tools explicitly. Keep Require approval for MCP write actions enabled (the default) so changes require a separate, session-bound confirmation. Treat an approval request as pending until execution is actually confirmed; it is not proof of a completed CRM change.
Two different MCP connections: the Run AI block connects a bot outward to third-party systems. The Sendbot remote MCP connector lets an assistant such as ChatGPT help you manage drafts inside your own Sendbot account. Connecting one does not automatically configure the other.

Credits and provider costs

AI usage is model- and token-dependent; optional search, media, embeddings, and external tools can introduce additional costs or provider charges. Managed AI usage is subject to the workspace credit balance. Using your own provider credentials does not make all platform session or third-party costs disappear. See Credits and usage and test with a limited budget before enabling optional paid tools.

Checklist before publishing

  • A new preview conversation displays the real native buttons and waits for the selection.
  • The selected label appears as the visitor’s message, and the expected session variable updates.
  • The following block runs only after the choice is recorded. Previously selected buttons cannot execute again.
  • For an allowed text-only subflow, its text returns; an unlisted or effectful group remains blocked.
  • In read-only mode, no writes or unauthorized subflow calls are attempted.
  • If MCP writes are used, the user sees an approval step and an actual tool-result confirmation.
  • The selected provider and target channel work with your credentials and credit limits.

Troubleshooting

Related: AI Agent / MCP configuration · Buttons · Variables · Publishing.