Block 1 - When chat message received
- Type / Role
- @n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
- Config choices
- Version 1.1
This workflow is provided as-is. Please review and test before using in production.
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 scalabili...
@n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.toolthink, @n8n/n8n-nodes-langchain.toolcalculator, @n8n/n8n-nodes-langchain.lmchatanthropic, @n8n/n8n-nodes-langchain.memorybufferwindow
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Davide.
Original n8n.io sourceThis 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 and Think tool.
🔁 Dynamic Model Selection
🧠 AI Agent with Tool Use
📎 Memory Integration
🧮 Built-in Calculation Tool
📤 Structured Output Parser
🌐 Web Search Capability
Trigger: Listens for new chat messages.
Routing Agent: Analyzes the message and returns the best model to use.
AI Agent: Handles the conversation, decides when to use tools.
Tools:
web_search for internet queriesThink for reasoningCalculator for math tasksModels Used:
claude-sonnet-4-20250514: Optimized for general and business logic tasks.claude-opus-4-20250514: Best for deep, strategic, and analytical queries.Dynamic Model Selection
Query Processing and Response Generation
Node Configuration
prompt and model fields. Tool Integration
anthropic-version) are correctly configured. Credentials
Testing
Deployment
Contact me for consulting and support or add me on Linkedin.
This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
| Workflow | Anthropic AI agent: Claude Sonnet 4 and Opus 4 with Think and Web Search tool |
|---|---|
| Complexity | intermediate |
| Nodes | 11 |
| Categories | Engineering, AI Chatbot |
| Author | Davide |
| Published | 26 May 2025 |
Use the JSON export at /data/workflows/4399/4399.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
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 scalabili...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering, AI Chatbot use case.