Building a Multi-Tool AI Agent Workflow in n8n

I recently built a powerful AI-driven automation workflow in n8n, and it turned out to be a great hands-on experience designing a system that connects multiple services into one intelligent pipeline.

What This Workflow Does

At its core, this setup centers around a single AI Agent that acts as the brain of the entire operation. Instead of building separate automations for every task, I funneled everything through one intelligent agent that can understand context, make decisions, and trigger the right action on its own.

The workflow accepts inputs from several entry points:

  • Chat messages: a “When chat message received” trigger for direct conversational requests
  • Webhooks: including a dedicated “Retrieve Deep Research” webhook and a “Respond to Webhook” node to send results back
  • Session handling: SetSessionID, SetResearchID, and ToolCall nodes manage state and keep each request properly tracked

From there, everything routes into the AI Agent for processing.

The Tools Behind the Agent

What makes the agent genuinely useful is the set of tools wired into it:

  • OpenAI Model: the language model powering the reasoning
  • Memory: so the agent retains context across the conversation
  • Calculator: for any on-the-fly computation
  • Google Sheets: reading and writing data to a connected sheet
  • Gmail: sending messages and creating drafts automatically
  • Task management: Get Active Tasks, Create Task, and Update Task nodes for full task handling
  • Deep Research: Retrieve and Conduct Deep Research nodes for pulling richer information
  • Shopping List management: Get, Add to, and Update Shopping List nodes
  • CreateHTML & Edit Fields: for formatting and shaping output

I also scaffolded in Microsoft Teams and Home Assistant nodes (currently deactivated) so the system can expand into team messaging and smart-home control down the line.

What I Learned

The most interesting part was structuring the logic so the agent could interpret a request, decide which tool to reach for, and execute, whether that meant creating a task, drafting an email, running research, or updating a sheet, all without manual intervention.

This project deepened my skills in:

  • Designing AI agents that orchestrate multiple tools
  • Workflow automation and state management
  • API integrations across Google, Gmail, and more
  • Building scalable no-code / low-code systems

It’s exciting to see how automation can turn a tangle of complex steps into one simple, efficient process. :rocket:

2 Likes

The session handling via SetSessionID/SetResearchID is a solid architectural choice - keeping those as dedicated Set nodes before the Agent makes it easy to swap the ID logic without touching the agent itself. One pattern worth considering as you scale to more tools: grouping related tools (like the task management cluster or the research cluster) into separate sub-workflows called via the “Execute Workflow” tool lets you version and test each group independently without redeploying the whole agent.

That’s a great point.

I agree, keeping the session and research ID logic outside the agent makes the workflow much easier to maintain. The agent can stay focused on decision-making, while the ID/session layer can be changed independently when the workflow grows.

I also like the idea of splitting tool groups into separate sub-workflows. For example, task management, research, Gmail, and Sheets actions could each live in their own workflow and be called through Execute Workflow when needed.

That would make the overall system cleaner, easier to test, and safer to update without touching the main agent every time. Definitely a good pattern for scaling this beyond a single workflow.