How to Run Claude Inside an n8n Workflow (2026)

Lead
You can embed Claude directly into n8n workflows to automate reasoning tasks,tag inbound emails, synthesize data, score leads, or run tool-calling agents. Claude gives n8n's visual automation layer a brain; n8n supplies the connectors, scheduling, and routing. The native Anthropic Chat Model node and AI Agent node make both patterns production-ready.
What you'll do: Create an n8n workflow, add the Anthropic Chat Model or AI Agent node, authenticate with an API key, and configure the model and output schema.
Who this is for: Operations teams and technical leaders at SMBs who want to automate repetitive reasoning work without building custom orchestration.
Verified against:** n8n Cloud, Anthropic Claude API. Current as of 2026-05-04.
Prerequisites
How ScaleIT handles this: See AI Quick-Start
- An n8n Cloud account or self-hosted instance (version 2024+)
- An Anthropic Console account with Claude API access
- An Anthropic API key from https://console.anthropic.com/account/keys
- Familiarity with n8n's visual workflow editor
Steps
- Log into n8n and create a new workflow
- Click Create → New workflow
- Click Add a node and search for "Anthropic"
- Add the Anthropic Chat Model node
- Select Anthropic Chat Model from the results
- This node sends a prompt to Claude and returns the response
- Create Anthropic credentials
- In the node's credential dropdown, click Create new credential
- Paste your Anthropic API key into the
API Keyfield - Name the credential (e.g., "Anthropic Production") and save
- Select the Claude model
- In the node's Model dropdown, choose from:
claude-3-5-sonnet-20241022(fast, cost-effective; default for most tasks)claude-3-opus-20250219(most capable; use for complex synthesis)claude-3-haiku-20250307(lightweight; use for high-volume classification)
- Write your prompt
- In the Prompt field, describe the task clearly
- Example: "Classify this email as billing, technical, or sales. Return JSON with category and confidence."
- Reference incoming data using n8n syntax:
{{ $json.email_body }}
- Set output format
- Enable JSON mode in Response Format settings if your workflow requires structured output
- Define the schema (e.g.,
{ "category": "string", "confidence": "number" }) - This ensures downstream nodes receive predictable output
- For AI Agent workflows (tool calling)
- Select AI Agent node instead if Claude needs to call other n8n nodes as tools
- Define Tools by selecting other n8n nodes
- Set Max Iterations to 5–8 to prevent runaway loops
- Write the System Prompt for the agent's goal
- Test and deploy
- Click Execute to test against sample data
- Verify the output in the Results panel matches your expected schema
- Click Activate to enable the workflow on schedule or trigger
Verify
- The node's Results panel shows the expected JSON or text output
- JSON output contains all required fields with correct types
- For AI Agents, the execution trace shows the agent called the correct tools
- Test the workflow against 3–5 real examples before production
Troubleshooting
"Invalid API key" error
- Confirm you copied the key from https://console.anthropic.com/account/keys
- Regenerate the key if it's older than 90 days
JSON output is incomplete or malformed
- Rewrite the prompt to be more explicit: "Return valid JSON with no text before or after"
- Enable JSON mode in the node's Response Format settings
AI Agent runs out of iterations without answering
- Reduce the tool list to 3–6 tools maximum
- Rewrite the system prompt to state the goal, not the implementation
- Lower Max Iterations and capture partial results for review
Workflow cost is higher than expected
- Switch to Haiku for classification work (lower cost, sufficient quality)
- Reduce the prompt length; every token costs money
- Batch similar requests in one workflow run instead of separate triggers
Next Step
Are you looking to put Claude inside n8n without spending weeks learning the patterns the hard way? We can help you design, build, and scale the right automation for your team. Contact ScaleIt for a free consultation.