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
| Field | Required | Notes |
|---|---|---|
| prompt | no | Prompt text; expressions allowed |
| includeHistory | no | Include recent chat history in the Brain prompt (default on) |
| useKnowledge | no | Allow knowledge retrieval when available (default on) |
| replyMode | no | none | draft | send — draft outputs reply only; send delivers now |
| minConfidence | no | Below this confidence, Brain takes the default port (0–1) |
| maxToolCalls | no | Max allowlisted tools per Brain visit (default 3, max 8) |
| maxBrainInvocationsPerExecution | no | Cap Brain visits per run to prevent loops (default 20) |
| intents | no | Intent catalog — each id becomes a canvas output port |
| slotSchema | no | Optional fields the model may fill into slots |
| tools | no | Allowlisted tools (no_op / set_variables / http_request templates) |
| mockDecision | no | Optional 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 |
|---|---|
| Limited | May 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
| Symptom | Cause | Fix |
|---|---|---|
| Always takes default port | Low confidence, unknown intent id, or parse failure | Widen intent descriptions, lower minConfidence, or check Output.rawAnswer / parseOk. |
| AI_BRAIN_INVOCATION_CAP | Brain visited too many times in one run | Raise maxBrainInvocationsPerExecution or break loops with Ask / stop. |
| Tool unknown / HTTP failed | Model requested a tool id not in the allowlist, or template HTTP failed | Add the tool id in config; check toolResults; URL must come from the template only. |
| Step failed / missing account | No accountId in trigger context | Use 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).