AI chat with any data source (using the n8n workflow tool)
Needs changesWhat this workflow does
This AI workflow has 8 nodes and runs when a chat message arrives (plus 1 other trigger). Along the way it connects Hacker News and OpenAI Chat Model.
How it runs
Trigger: When a chat message arrives (plus 1 other trigger).
- AI Agent: runs an AI agent, with model: OpenAI Chat Model; 1 tool (Custom tool to call the wf below)
- Hacker News: work with all
- Clean up data (Edit Fields (Set)): sets 5 fields: title, points, url…
- Stringify (Code): runs custom JavaScript code
Services it uses
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.8): 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.8) | 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 - Call n8n Workflow Tool
@n8n/n8n-nodes-langchain.toolWorkflow - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Hacker News
n8n-nodes-base.hackerNews - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
From the author
This AI agent can access data provided by another n8n workflow. Since that workflow can be used to retrieve any data from any service, this template can be used give an agent access to any data. Note that to use this template, you need to be on n8n version…