Anthropic AI agent: Claude Sonnet 4 and Opus 4 with Think and Web Search tool
Needs changesWhat this workflow does
This AI workflow has 10 nodes and runs when a chat message arrives. Along the way it connects Anthropic Chat Model and HTTP Request. It also calls api.anthropic.com over HTTP.
How it runs
Trigger: When a chat message arrives.
- Anthropic Routing Agent (AI Agent): runs an AI agent, with model: Sonnet 3.; output parser: Structured Output Parser
- AI Agent: runs an AI agent, with model: Sonnet 4 or Opus; 3 tools (Think, Calculator, web_search); memory: Simple Memory
Services it uses
HTTP calls to: api.anthropic.com
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in AI Agent (v1.9), Anthropic Routing Agent (v1.9): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Agent (v1.9), Anthropic Routing Agent (v1.9) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (8)
- Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - AI Agent
@n8n/n8n-nodes-langchain.agent - Think Tool
@n8n/n8n-nodes-langchain.toolThink - Calculator
@n8n/n8n-nodes-langchain.toolCalculator - Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Http Request Tool
n8n-nodes-base.httpRequestTool
From the author
This workflow dynamically chooses between two new powerful Anthropic models — Claude Opus 4 and Claude Sonnet 4 — to handle user queries, based on their complexity and nature, maintaining scalability and context awareness with Anthropic web search function…