Answer HR and IT policy questions on Telegram with OpenAI and Postgres PGVector
Needs changesWhat this workflow does
This AI workflow has 21 nodes and runs manually, when you click “Execute workflow” (plus 1 other trigger). Along the way it connects Postgres PGVector Store, Embeddings OpenAI, Telegram and OpenAI and 3 more. It also calls s3.amazonaws.com over HTTP.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 1 other trigger).
- HTTP Request: calls s3.amazonaws.com
- Verify Message Type (Switch): routes items into 2 branches
- Extract from File: extracts data from a file (pdf)
- Edit Fields (Edit Fields (Set)): sets 1 field: text
- Telegram: work with file
- Unsupported Message Type (Telegram): uses Telegram
- Create HR Policies (Postgres PGVector Store): stores documents in the Postgres PGVector Store vector store, with embeddings: Embeddings OpenAI; document loader: Default Data Loader
- AI Agent: runs an AI agent, with model: OpenAI Chat Model; 1 tool (Answer questions with a vector store); memory: Postgres Chat Memory
- OpenAI: transcribe (audio)
- Telegram: uses Telegram
Services it uses
HTTP calls to: s3.amazonaws.com
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.7): 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.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (16)
- Manual Trigger
n8n-nodes-base.manualTrigger - HTTP Request
n8n-nodes-base.httpRequest - Extract from File
n8n-nodes-base.extractFromFile - Postgres PGVector Store
@n8n/n8n-nodes-langchain.vectorStorePGVector - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - Telegram Trigger
n8n-nodes-base.telegramTrigger - Switch
n8n-nodes-base.switch - OpenAI
@n8n/n8n-nodes-langchain.openAi - Telegram
n8n-nodes-base.telegram - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Postgres Chat Memory
@n8n/n8n-nodes-langchain.memoryPostgresChat - Vector Store Question Answer Tool
@n8n/n8n-nodes-langchain.toolVectorStore - Edit Fields (Set)
n8n-nodes-base.set
From the author
Quick overview This workflow builds a searchable HR policy knowledge base from a PDF and runs a Telegram helpdesk bot that answers employee questions from that content, handling both text messages and voice notes via OpenAI transcription and retrieval from a…