OpenAI assistant with custom tools
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
What this workflow does
This AI workflow has 13 nodes and runs when a chat message arrives (plus 1 other trigger). Along the way it connects OpenAI.
How it runs
Trigger: When a chat message arrives (plus 1 other trigger).
- OpenAI: work with assistant, with 2 tools (Tool to call the workflow below, Tool: Get current date and time); memory: Simple Memory
- List countries? (If): checks a condition and branches into true / false
- Mapping data (Code): runs custom JavaScript code
- Get the matching country's details (Merge): merges the data from its input branches
- Mapping data (Code): runs custom JavaScript code
- Concatenate country names (Summarize): summarizes / groups the items
- Return specific capital (Edit Fields (Set)): sets 1 field: response
- Return country list (Edit Fields (Set)): sets 1 field: response
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (11)
- Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - OpenAI
@n8n/n8n-nodes-langchain.openAi - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Call n8n Workflow Tool
@n8n/n8n-nodes-langchain.toolWorkflow - Code Tool
@n8n/n8n-nodes-langchain.toolCode - If
n8n-nodes-base.if - Code
n8n-nodes-base.code - Summarize
n8n-nodes-base.summarize - Edit Fields (Set)
n8n-nodes-base.set - Merge
n8n-nodes-base.merge
From the author
This workflow shows how you can get your OpenAI assistant to call an n8n workflow as a tool. Since you can put almost any functionality in an n8n workflow, this means you can give your assistant access to almost any data source. Note that to use this…