What you need

An n8n instance (cloud.n8n.io or self-hosted via Docker).

An API key for your AI model provider.

Access to the services you want to connect (email, Slack, databases, etc.).

Step 1: Set up n8n

Self-host: `docker run -it --rm --name n8n -p 5678:5678 n8nio/n8n` and access `http://localhost:5678`.

Or sign up at cloud.n8n.io for a hosted instance.

Create your first workflow from the dashboard.

Step 2: Add an AI agent node

Drag an 'AI Agent' node onto the canvas. This is the core node that connects to LLMs.

Configure the model connection: select OpenAI, Anthropic, or any OpenAI-compatible provider.

Set the agent's system prompt — this defines how the agent behaves and what tools it can use.

Step 3: Connect MCP tools

n8n supports MCP (Model Context Protocol) servers. Add MCP tool nodes to give your agent access to external services.

Connect tools like web search, database query, file read/write, or API calls.

Each MCP tool appears as a function the agent can call when it needs specific information.

Step 4: Build the workflow

Example workflow: Webhook trigger → AI Agent (research topic) → AI Agent (write summary) → Slack (post result).

Use the visual editor to connect nodes. No code required — all configuration is point-and-click.

Add conditional logic with IF nodes: 'If the summary is longer than 500 words, send as PDF. Otherwise, post directly.'

Step 5: Test and activate

Run the workflow with test data to verify each step works correctly.

Check the execution logs to see what the AI agent did at each step.

Activate the workflow to run on a schedule or trigger from events.

FAQ

Can n8n handle complex multi-agent workflows?

Yes. You can chain multiple AI agent nodes, each with different system prompts and tools, creating a pipeline of specialized agents.

Is n8n free for commercial use?

n8n has a Sustainable Use License. Self-hosted is free. Cloud has a generous free tier and paid plans for higher usage.

Build n8n AI Workflows

  1. Set up n8n (self-hosted or cloud)
  2. Add an AI Agent node with model connection
  3. Connect MCP tools for external access
  4. Build the workflow with the visual editor
  5. Add conditional logic and error handling
  6. Test and activate the workflow

Ready to see the full catalog?

Browse all 42 agent-ready business kits. Each includes pre-configured agent roles, prompts, workflows, install steps, and approval gates.

Shop all business kits