Automations · Nodes · ai

AI Brain

ai.decide · ai

Understand the message, optionally draft/send a reply, fill slots, run allowlisted tools, then continue on a declared intent port.

When to use

  • Route natural language into declared intent ports (e.g. FAQ reply vs start quote vs handoff).
  • Optionally draft/send a reply, fill slots, and run allowlisted tools — without free-form URLs or node jumps.
  • Prefer AI Brain over classify + if/else when the same turn needs decide + reply + branch.
  • After Wait Mismatch cancel_and_reroute: wire Ask mismatch → AI Brain; use {{vars.mismatchText}} / waitKind (see Wait Mismatch Brain pattern).
  • Not Meta WhatsApp Flows and not a replacement for live FAQ AI outside Automations.

Configuration

FieldRequiredNotes
promptnoPrompt text; expressions allowed
includeHistorynoInclude recent chat history in the Brain prompt (default on)
useKnowledgenoAllow knowledge retrieval when available (default on)
replyModenonone | draft | send — draft outputs reply only; send delivers now
minConfidencenoBelow this confidence, Brain takes the default port (0–1)
maxToolCallsnoMax allowlisted tools per Brain visit (default 3, max 8)
maxBrainInvocationsPerExecutionnoCap Brain visits per run to prevent loops (default 20)
intentsnoIntent catalog — each id becomes a canvas output port
slotSchemanoOptional fields the model may fill into slots
toolsnoAllowlisted tools (no_op / set_variables / http_request templates)
mockDecisionnoOptional Execute-step mock; clear before publish for live AI

Inputs

Upstream node output and execution context (contact, account, variables).

Outputs

intentId, confidence, reason, reply, slots, toolCalls, toolResults, usage. Continues on the matching intent port (or default / error). Insert value includes per-slot paths when slotSchema is set.

Execute step (editor)

Eligible?Notes
LimitedMay consume AI allowance. Use mockDecision / Input brainMock for deterministic Execute. replyMode=send skips live delivery on Execute.

See Test, Execute, debug, listen and limitations.

Common errors

SymptomCauseFix
Always takes default portLow confidence, unknown intent id, or parse failureWiden intent descriptions, lower minConfidence, or check Output.rawAnswer / parseOk.
AI_BRAIN_INVOCATION_CAPBrain visited too many times in one runRaise maxBrainInvocationsPerExecution or break loops with Ask / stop.
Tool unknown / HTTP failedModel requested a tool id not in the allowlist, or template HTTP failedAdd the tool id in config; check toolResults; URL must come from the template only.
Step failed / missing accountNo accountId in trigger contextUse a channel message trigger or set account on the node.

Example

WhatsApp/AppChat message received → AI Brain (intents: reply_only, start_tp_quote, handoff_human) → reply_only sends draft text; start_tp_quote → Ask text / HTTP; handoff_human → pause AI + assign. Wait Mismatch: Ask interactive (cancel_and_reroute) → mismatch → Brain (answer_faq / stay_in_flow / switch_quote / handoff).

Related