Blogguides

How to connect the Claude API to n8n (5 minutes, no coding)

Affiliate disclosure: This site earns a commission when you sign up for tools through links on this page, at no extra cost to you. I only recommend tools I've researched and would use myself.

You already have n8n running. You want Claude in your workflows. The setup takes about 5 minutes and there's nothing clever about it — it's a credential, a node, and a connection.

This is the guide I wish I'd had the first time: specific steps, no filler.

What you'll end up with

After this guide, you'll have:

  • Claude wired into n8n as a credential
  • A working test workflow (Chat Trigger → AI Agent → Claude)
  • The right model selected for your use case
  • A real sense of what API costs look like in practice

What you'll need

  • An n8n instance — cloud or self-hosted (v1.15 or higher)
  • An Anthropic account at console.anthropic.com
  • About 5 minutes and $5 in Anthropic API credit to start (it'll last you a long time)

Don't have n8n yet? Start with n8n cloud — free trial available, no credit card required to start.


Step 1 — Get your Anthropic API key

Go to console.anthropic.com. If you use Claude Pro, this is a separate account — create one if you haven't already.

Once you're in:

  1. Click Settings in the left sidebar
  2. Click API Keys
  3. Click + Create Key
  4. Give it a name like n8n-integration
  5. Click Create Key — then copy the key immediately

Important: the key is only shown once. If you close the dialog without copying it, you'll need to create a new one. Store it somewhere secure (password manager, not a sticky note).

You'll also need to add a payment method under Billing and load at least $5 in credit. There's no free tier for the API — but $5 goes surprisingly far at Haiku pricing.


Step 2 — Add the Anthropic credential in n8n

In your n8n instance:

  1. Click Credentials in the left sidebar
  2. Click Add Credential
  3. Search for Anthropic and select Anthropic API
  4. Paste your API key into the API Key field
  5. Click Save

That's the entire credential setup. n8n stores it encrypted and makes it available to any workflow.


Step 3 — Build a test workflow

Now let's confirm everything works before you build anything real.

Create a new workflow and add these three things:

1. Chat Trigger Search for Chat Trigger and add it as your first node. This gives you a built-in chat interface for testing — no webhook setup needed.

2. AI Agent node Click the + button after the Chat Trigger, search for AI Agent, and add it. The AI Agent is n8n's orchestration layer — it takes input, sends it to a language model, decides what to do with the response, and loops until the task is done.

3. Claude Chat Model (sub-node) This is where Claude enters. On the AI Agent node, you'll see input slots at the bottom: Chat Model, Memory, and Tools. Click the + next to Chat Model and search for Anthropic Chat Model.

In the Anthropic Chat Model node:

  • Credential: Select the Anthropic credential you just created
  • Model: Start with claude-sonnet-4-6 — more on model selection below
  • Leave everything else at defaults for now

Your workflow should look like:

[Chat Trigger] → [AI Agent]
                      ↑
              [Claude Chat Model]

Activate the workflow, then click Chat in the Chat Trigger node. Type a test message. If Claude responds, you're connected.


Which model should you use?

Three real options in 2026, with honest trade-offs:

Claude Haiku 4.5 — $1/M input, $5/M output Best for: high-volume, simple tasks (classification, extraction, short summaries). Fast and cheap. Not great for anything requiring complex reasoning or long outputs.

Claude Sonnet 4.6 — $3/M input, $15/M output Best for: most workflows. The sweet spot between capability and cost. Handles multi-step reasoning, document analysis, coding help, and complex instructions without the Opus price tag. This is what I'd start with.

Claude Opus 4.7 — $5/M input, $25/M output Best for: genuinely difficult tasks where cheaper models fail — complex analysis, advanced coding, tasks requiring extended thinking. Don't use this by default. Use it when Sonnet isn't getting the job done.

In practice: start with Sonnet, switch to Haiku if cost becomes a concern, escalate to Opus only when you have a specific reason.


What does it actually cost?

A 1,000-token conversation with Sonnet (about 750 words in, ~200 words out) costs about $0.006 — less than a cent. You can run thousands of workflow executions before you spend $10.

The math that matters: if a workflow saves 10 minutes of manual work and you're running it 50 times a month, you're saving 8 hours. At any reasonable rate, the API cost is irrelevant.

Where costs add up: high-volume document processing, using Opus for everything, or forgetting to set token limits in workflows that loop.


Step 4 — Add memory (optional but useful)

By default, the AI Agent doesn't remember previous messages in a session. For a one-shot workflow, that's fine. For a conversational agent, you'll want memory.

Click the + next to Memory on the AI Agent node and add Window Buffer Memory. Set the Context Window Length to 10 (keeps the last 10 message pairs in context). This is enough for most conversational workflows without burning unnecessary tokens.


Troubleshooting the three most common problems

"Invalid API Key" error Double-check the key was copied completely — it should start with sk-ant-. If you're not sure, create a new key and re-paste. API keys can't have spaces or line breaks.

Claude responds but ignores your system prompt The system prompt goes into the AI Agent node's System Message field, not in the Chat Model node. Putting it in the wrong place is common. Find the System Message field inside the AI Agent settings.

High latency on first response Sonnet and Opus have a cold-start delay of 1–3 seconds on the first message in a session. This is normal — subsequent messages in the same session are faster. If speed is critical, Haiku eliminates most of this delay.


Where to go from here

Once Claude is connected, the useful things to build aren't far off:

  • Document processor: Webhook → read PDF → Claude summary → send to Slack or email
  • Content pipeline: new blog post trigger → Claude rewrites for social → post via Buffer
  • Support triage: incoming email → Claude classifies intent → route to correct Notion database
  • Research assistant: scheduled trigger → Claude searches and summarizes a topic → weekly digest to email

The pattern is the same for all of them: trigger → Claude processes → output goes somewhere. The setup you just did is the foundation.

Try n8n free — 14-day trial on cloud, or self-host for free on any VPS.


Claude API and n8n pricing verified June 2026. EUR/USD rate used: 1.15.

This post may contain affiliate links. I earn a commission if you purchase through a link, at no extra cost to you. I only recommend tools I've honestly assessed.

← Back to all posts