n8n Multi-Tool AI Agent
A single webhook endpoint that accepts any sales-ops request in plain English and lets an LLM decide which CRM, calendar, search, and Slack tools to invoke — in what order — to fulfill it.
Fixed automation workflows break the moment a request doesn't match a predefined trigger. Sales-ops teams field open-ended requests — "look up this person, schedule a follow-up, ping the team" — that don't fit one rigid flow. Encoding every variant as its own workflow doesn't scale.
A single AI agent with four tools. The LLM reads the natural-language request, decides which tools to call and in what order, executes them, and returns a plain-English confirmation. Adding a new capability is one new tool node with a description — no workflow rebuild.
The agent loop, node-by-node.
Ten stages. One webhook in, one structured response out. Tool selection is the LLM's job, not the workflow's.
Webhook Receives Request
POST /webhook/ai-agent accepts { request, channel? }. n8n Webhook node configured for "Respond via Respond to Webhook Node" mode.
Input Validation
IF node checks $json.body.request is non-empty. Empty → returns 400 with a clean error. Non-empty → continues.
Variable Extraction
Set node creates clean references (userRequest, slackChannel, timestamp). Slack channel defaults to #make-testing if omitted.
AI Agent (Llama 3.3 70B)
Tools Agent node, OpenAI Chat Model sub-node pointed at api.groq.com, temp 0.1, max 2000 tokens. System prompt enforces no-hallucination + ISO 8601 Asia/Manila date formatting.
Tool Selection (ReAct)
Agent picks from 4 tools, each wired with $fromAI() parameter injection. ReAct loop: reason → call tool → read result → repeat until answer is complete.
Response Formatting
Set node extracts output, tool metadata, and success status from the agent’s result.
Audit Logging
Google Sheets Append Row to "n8n Agent — Request Log". Configured "Continue on Error" so logging failures never block the user response.
Final Response Builder
Second Set node assembles the clean JSON body { status, response, tools_used, timestamp }. Added during testing to dodge JSON-template escape issues.
Respond to Webhook
Sends the JSON body back to the caller with a 200.
Error Handler Workflow
Separate workflow with Error Trigger → Slack post. Wired as the main workflow’s Error Workflow. Fires on actual crashes, not graceful tool failures the agent handles itself.
Tested honestly. Failures owned.
Real test runs against the live agent. The wins are documented — and so are the deferred tests that didn't make it through the day's quota.
Test 7 sent unknown@nowhere.com. Agent responded: "The contact for unknown@nowhere.com was not found in HubSpot." Zero invented details. Driven by an explicit system-prompt rule.
Test 8 sent "create a task for the ACME account" with no specific contact. Agent refused to call tools and asked: "Which contact at ACME should I associate this with?" — a real product-design call, not a hack.
"Send proposal next Monday 10am to john@startup.io" produced a Calendar event Mon Jun 1, 10:00–10:30 AM with the right attendee. Agent enriches metadata with HubSpot lookups when possible.
7 clean passes · 1 partial · 0 fails · 5 deferred (Groq free-tier daily quota during back-to-back runs). Deferred tests are honestly labeled as not-run, not assumed-pass.
Every node, every side effect.
Real screens from the production workflow. Click any to expand.









Each tool, its job.
The trade-offs, owned.
Two tools had to be swapped mid-build due to real-world constraints. Both swaps are documented in the repo — clients care more about real judgment calls than a clean linear story.
Original design used HubSpot Tasks as the scheduling tool. Free-tier HubSpot doesn't expose the tasks.write scope. Swapped to Google Calendar mid-build — and got better UX (real invites with attendees) as a bonus.
Gemini’s free tier required billing setup in our region. Switched to Groq’s OpenAI-compatible API. Same agent logic, no code changes — just a new base URL and model name.
First Set node parses agent output. Second Set node builds the final JSON. This split was added after JSON-template escape issues with unpredictable agent text — small architectural call, big reliability win.
A separate Request Router workflow (Webhook → Switch by event_type → typed sub-workflows) ships in the repo. Production pattern, not one monster flow — adds the "senior engineer" signal beyond the agent itself.
Need an agent like
this one?
Book a free 30-minute discovery call — or send me an email if you prefer. We'll figure out where an AI agent fits in your stack.