OpenAI Assistant with custom n8n tools

Sub-workflow: Return the capitals of fictional countries It can either list the countries it knows about or return the capital of a specific country

Workflow Structure (12 nodes)
100%
Langchain.manual Chat Trigger
On new manual Chat Message
Langchain.open Ai Assistant
OpenAI Assistant
Langchain.tool Workflow
Tool to call the workflow below
Langchain.tool Code
Tool: Get current date and time
Execute Workflow Trigger
Execute Workflow Trigger
If
List countries?
Code
Mapping data1
Code
Mapping data
Merge
Get the matching country's details
Summarize
Concatenate country names
Set
Return country list
Set
Return specific capital
Node Types:
trigger
default
code
logic
transform
Requires credentials

Prerequisites

Required Credentials (1)

OpenAI

Used by: OpenAI Assistant

Docs

Complexity

Complex

Advanced features used. Requires n8n experience.

Setup time: ~30 min
Score: 56/100
Custom Code
Conditional Logic

When to Use This Workflow

AI-Powered Content Creation

Automate content generation, summarization, or analysis using AI capabilities.

Save hours of manual work while maintaining quality and consistency.

Real-time Response

React instantly when events happen - new orders, form submissions, or API calls.

Zero delay between trigger and action for time-sensitive workflows.

Error Reduction

Eliminate human error from routine processes with consistent automation.

Improve accuracy and reliability across your workflows.

workflow.json
{
  "id": "aVTi7K9mFjK5OjAV",
  "meta": {
    "instanceId": "b3a8efae31a34c2224655b66499bee098263a56d266da574e8820468780b7ddd"
  },
  "name": "OpenAI Assistant with custom n8n tools",
  "tags": [],
  "nodes": [
    {
      "id": "d15e7634-408b-43c5-a8d6-afcbc83479a9",
      "name": "On new manual Chat Message",
      "type": "@n8n/n8n-nodes-langchain.manualChatTrigger",
      "position": [
        600,
        300
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
...

Workflow Details

Nodes
14
Trigger
Event
Source
awesome
Added
Dec 4, 2025

Need Help?

Check out the official n8n documentation for detailed guides.

Related Workflows

AI chat with any data source (using the n8n workflow tool)

Replace me with any other service, e.g. fetching your own data

Manualchat
Executeworkflow
Hackernews
Agent
12 nodesEvent
Curated

Agent with custom HTTP Request

Convert the query string into JSON, apply the limit for a page length

Manualchat
Lmchatopenai
Http-request
Executeworkflow
20 nodesEvent
Curated

Build a Tax Code Assistant with Qdrant, Mistral.ai and OpenAI

Step 1. Download the Tax Code PDF [Read more about handling Zip Files](https://docs.n8n.io/integrations/builtin/core-nod...

Embeddingsmistralcloud
Documentdefaultdataloader
Textsplitterrecursivecharactertextsplitter
Http-request
38 nodesEvent
Curated

Building RAG Chatbot for Movie Recommendations with Qdrant and Open AI

Tool, calling Qdrant's recommendation API based on user's request, transformed by AI agent

Github
Embeddingsopenai
Documentdefaultdataloader
Textsplittertokensplitter
27 nodesEvent
Curated

Enrich Property Inventory Survey with Image Recognition and AI Agent

1. Use Airtable to Capture Survey Photos [Read more about AirTable](https://docs.n8n.io/integrations/builtin/app-nodes/n...

Lmchatopenai
Airtable
Executeworkflow
Http-request
29 nodesEvent
Curated

Extract insights & analyse YouTube comments via AI Agent chat

... or watch set up video [13 min] [![Youtube Thumbnail](https://cflobdhpqwnoisuctsoc.supabase.co/storage/v1/object/publ...

Lmchatopenai
Toolworkflow
Memorypostgreschat
Agent
29 nodesEvent
Curated