Answer website chat questions about attached documents with OpenAI
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-12-01.
What this workflow does
This AI workflow has 13 nodes and runs when a chat message arrives. Along the way it connects OpenAI Chat Model.
How it runs
Trigger: When a chat message arrives.
- Settings (Edit Fields (Set)): sets 1 field: maxCharacters
- A file attached? (If): checks a condition and branches into true / false
- Which kind of file? (Switch): routes items into branches
- Answer (AI Agent): runs an AI agent, with model: Chat model; memory: Conversation memory
- Read the PDF (Extract from File): extracts data from a file (pdf)
- Read the text (Extract from File): extracts data from a file (text)
- Unsupported file (Edit Fields (Set)): sets 4 fields: sessionId, fileName, text…
- The document (Edit Fields (Set)): sets 5 fields: sessionId, fileName, fullText…
- Keep it in the conversation (Chat Memory Manager): uses Chat Memory Manager, with memory: Conversation memory
- Back to the message (Edit Fields (Set)): sets or maps fields
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 (9)
- Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Switch
n8n-nodes-base.switch - Extract from File
n8n-nodes-base.extractFromFile - Chat Memory Manager
@n8n/n8n-nodes-langchain.memoryManager - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow
From the author
Quick Overview This workflow hosts a public chat webhook for your website where visitors can upload a PDF, TXT, or Markdown file and ask questions about it, using OpenAI to respond strictly from the document text while keeping the document in conversation…