This workflow follows the Agent → OpenAI Embeddings recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "AI Agent with Tools",
"id": "test-workflow-001",
"nodes": [
{
"type": "n8n-nodes-base.webhook",
"name": "Webhook Trigger",
"parameters": {
"path": "ai-agent",
"httpMethod": "POST"
}
},
{
"type": "@n8n/n8n-nodes-langchain.agent",
"name": "AI Agent",
"parameters": {
"text": "={{$json.body.prompt}}"
}
},
{
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"name": "OpenAI Chat Model",
"parameters": {
"model": "gpt-4",
"temperature": 0.7
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
"name": "Anthropic Model",
"parameters": {
"model": "claude-2.1",
"apiKey": "<redacted-credential>"
}
},
{
"type": "@n8n/n8n-nodes-langchain.toolCode",
"name": "Code Tool",
"parameters": {
"jsCode": "const { execSync } = require('child_process');\nreturn execSync('ls').toString();"
}
},
{
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"name": "HTTP Tool",
"parameters": {
"url": "https://api.example.com/data"
}
},
{
"type": "@n8n/n8n-nodes-langchain.mcpClientTool",
"name": "MCP Client",
"parameters": {
"sseEndpoint": "https://remote-mcp.example.com/sse"
}
},
{
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"name": "OpenAI Embeddings",
"parameters": {
"model": "text-embedding-ada-002"
}
},
{
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
"name": "Pinecone Store",
"parameters": {}
},
{
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"name": "Buffer Memory",
"parameters": {}
},
{
"type": "n8n-nodes-base.httpRequest",
"name": "HTTP Request",
"parameters": {
"url": "https://api.openai.com/v1/completions",
"headers": {
"Authorization": "<redacted>"
}
}
},
{
"type": "n8n-nodes-base.code",
"name": "Custom Code",
"parameters": {
"jsCode": "const http = require('http');\nhttp.request('http://evil.com', (res) => {});"
}
}
],
"connections": {
"Webhook Trigger": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Code Tool",
"type": "main",
"index": 0
},
{
"node": "HTTP Tool",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
openAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
How this works
This workflow empowers businesses and developers to build intelligent AI agents that autonomously handle complex tasks by leveraging multiple language models and specialised tools, saving hours of manual effort on data processing and decision-making. It suits teams needing dynamic automation, such as customer support or research operations, where the agent interprets user queries via a webhook trigger and executes actions like API calls or code generation. The key step involves the AI Agent node orchestrating interactions with OpenAI and Anthropic models alongside tools for HTTP requests and custom code, ensuring versatile and context-aware responses.
Use this workflow when you require an adaptable AI system for real-time query handling, such as integrating external data sources or running computations without rigid scripting. Avoid it for simple, linear automations lacking decision branches, or if your needs involve heavy data volumes better suited to batch processing tools. Common variations include swapping Anthropic for other models or adding database tools for persistent storage in enterprise setups.
About this workflow
AI Agent with Tools. Uses agent, lmChatOpenAi, lmChatAnthropic, toolCode. Webhook trigger; 12 nodes.
Source: https://github.com/Trusera/ai-bom/blob/main/n8n-node/__tests__/fixtures/sampleWorkflow.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Click here to access this Workflow for free.
Indoor Farming Agent. Uses lmChatOpenAi, documentDefaultDataLoader, embeddingsOpenAi, toolVectorStore. Webhook trigger; 36 nodes.
WooriFisa. Uses agent, httpRequest, documentDefaultDataLoader, vectorStorePinecone. Scheduled trigger; 86 nodes.
Alfred (funcional). Uses gmailTool, googleCalendarTool, gmail, embeddingsOpenAi. Event-driven trigger; 83 nodes.
This workflow automates patient communication for medical clinics using the WhatsApp Business API. It supports appointment booking, rescheduling, service inquiries, follow-ups, and document submission