n8n's AI Agent node now handles tool calling, memory, and structured output inside a single node — the 15-node workflows of a year ago collapse into 3. This guide walks through the pieces you need to put that node into production safely: a multi-agent shape, a locked-down output schema, a human-in-the-loop gate, and audit logs.
Two decisions trip up most teams at the start. The first is 'where do I place the agent' (single vs multi). The second is 'how far do I let it act on its own' (confidence thresholds, approval gates). What follows is the minimum set of pieces needed to make both decisions safely.
The pattern that works: Researcher → Writer → Reviewer
This is the pattern that exploded across the community. A Researcher agent scrapes and summarizes sources, a Writer agent drafts the piece, and a Reviewer agent fact-checks and adjusts tone. Output quality is visibly better than the old one-agent-does-everything approach, for a simple reason: each stage can use a different prompt, different tools, and a different temperature.
The pieces — nodes that sit around the Agent
AI Agent— the workhorse. A general-purpose container you attach tools, memory, and an output parser toChat Trigger— trigger for conversations from Slack/Teams/your own webchat. Session memory managed automaticallyStructured Output Parser— enforces responses against a Zod schema, with built-in retry on parse failureVector Store (Postgres pgvector)— the de facto standard for self-hosted RAGSub-Workflow Tool— invoke another workflow as a tool. The way to give agents 'real actions'
Structured output isn't optional
Free-form prose from an LLM is hard for downstream nodes to work with. You can't branch on it, you can't store it. There's one answer: pin a schema to a Structured Output Parser.
// AI Agent → Structured Output Parser schema example
{
"type": "object",
"properties": {
"category": { "enum": ["billing", "technical", "sales", "other"] },
"urgency": { "enum": ["low", "medium", "high"] },
"confidence": { "type": "number", "minimum": 0, "maximum": 1 },
"summary": { "type": "string", "maxLength": 200 },
"needs_human": { "type": "boolean" }
},
"required": ["category", "urgency", "confidence", "needs_human"]
}The confidence and needs_human fields are the important part. Feed them into an If node — if confidence is below 0.7 or needs_human: true, kick the item to a review queue instead of auto-processing.
Human-in-the-loop still matters
If you hand everything to the AI just because it's competent, incidents follow. Anything hard to reverse — refunds, deletes, bulk sends — should require human approval before execution. n8n's Wait node plus Slack interactive buttons gets you there in five minutes.
- AI Agent proposes an action → outputs it as JSON
Slacknode sends an approve/reject button card to the team channelWaitnode waits for the webhook response (up to 24 hours, timeout branch on expiry)- On approval, call the real API; on rejection, log with the reason
- Write the entire flow to an
agent_actionsaudit table
The numbers from a real rollout
Results from applying the patterns above to a Korean SaaS support team. First-level triage + auto-reply + human approval queue.
The slowest part of stabilizing agent workflows wasn't prompt tuning — it was locking the output schema. Loose schemas make every downstream node fragile. Once the schema is pinned, you can iterate on prompts for days without breaking anything downstream.— SynAct.ai consulting team
Three traps to avoid
- Unbounded memory — Chat Trigger's default memory grows without limit. Use
Window Buffer Memoryto keep only the last 20 turns - Too many tools — attach 20 tools to an agent and it starts wandering. Stick to 3–5 tools per agent
- No token cost tracking — a single GPT-4-class retry can run hundreds of won. Log the
usagefield to Postgres on every execution
AI Agent node works with OpenAI, Anthropic Claude, Google Gemini, or a local Ollama — just swap credentials. Worried about vendor lock-in? Expose the model parameter as a workflow variable.Wrap-up
The AI Agent node in production isn't a 'should we use it' question anymore. It's 'where do we draw the line between what's automated and what a human sees'. Structured output, confidence thresholds, approval gates, audit logs — get those four in place and you can push to production today.