Build an HR & IT Helpdesk Chatbot with n8n & OpenAI

Struggling to manage HR and IT queries efficiently? This workflow automates an HR & IT helpdesk chatbot using n8n, OpenAI, and Telegram, transforming policy PDFs into a smart, interactive assistant that handles text and voice queries with context memory.
telegramTrigger
agent
vectorStorePGVector
+18
Workflow Identifier: 1174
NODES in Use: Manual Trigger, HTTP Request, Extract from File, Default Data Loader, Recursive Character Text Splitter, Embeddings OpenAI, vectorStorePGVector, Telegram Trigger, Switch, Telegram, Telegram1, OpenAI, AI Agent, Postgres Chat Memory, toolVectorStore, OpenAI Chat Model, Postgres PGVector Store, OpenAI Chat Model1, Embeddings OpenAI1, Set, Unsupported Message Type
Automate HR IT helpdesk with n8n and OpenAI

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What this workflow does

This workflow creates an AI helper for HR and IT questions inside a company chat.
It reads company policy PDFs, makes them easy to search, and answers questions sent in text or voice on Telegram.
The workflow cuts the workload of HR teams by giving fast, clear answers to employees.


Who should use this workflow

Companies with many employee questions about HR policies or IT helpdesk topics can use this.
It works well for HR managers or support teams who want to save time and avoid missing urgent messages.
This method suits teams using Telegram for communication and who want AI help to answer common queries.


Tools and services used

  • n8n: Automates the whole process and runs the workflow.
  • PostgreSQL with PGVector: Stores text chunk vectors for fast search.
  • OpenAI API: Creates text embeddings and transcribes voice messages.
  • Telegram Bot API: Receives employee text and voice messages.
  • PDF files: Contain company policies downloaded via HTTP request.

How this workflow works (Input → Process → Output)

Inputs

  • PDF URLs for company policy documents.
  • Telegram messages as text or voice sent by employees.

Processing Steps

  • Download PDF using a HTTP Request node.
  • Extract text from PDF using Extract from File node.
  • Split text into 2000-character chunks with Recursive Character Text Splitter node.
  • Generate vector embeddings for each text chunk using Embeddings OpenAI node.
  • Store embeddings and related data in PostgreSQL via Create HR Policies vectorStorePGVector node.
  • Listen for Telegram messages with a Telegram Trigger node.
  • Check if message is text or voice using a Switch node.
  • If voice, download file and transcribe to text using Telegram1 node and OpenAI node (transcription mode).
  • Combine text and transcribed text fields via Edit Fields node to standardize input.
  • Send question text to AI Agent node with system prompt and vector search memory.
  • Maintain chat context using Postgres Chat Memory node.

Outputs

  • Instant answers sent back as Telegram messages through Telegram node.

This gives employees fast access to internal policy answers.
HR teams save time by not replying manually to each question.


Beginner step-by-step: How to build this workflow in n8n

Step 1: Import the workflow file

  1. Download the workflow file using the Download button on this page.
  2. In the n8n editor, click “Import from File” and select the downloaded file.

Step 2: Add credentials

  1. Go to each node needing credentials like OpenAI and Telegram.
  2. Enter your OpenAI API key in the OpenAI nodes.
  3. Fill in your Telegram Bot API token in the Telegram Trigger and Telegram send nodes.
  4. Set PostgreSQL credentials in vector store and memory nodes.

Step 3: Update settings

  1. In the HTTP Request node, check and update the internal policy PDF URL(s) to your own documents if needed.
  2. In database-related nodes, verify database name, schema, and tables are correct.
  3. In the AI Agent node, review the system prompt and change if company voice or details are different.

Step 4: Test the workflow

  1. Use the manual trigger or send Telegram messages to your bot for testing.
  2. Watch the execution logs and confirm PDF text extracts correctly.
  3. Check that voice messages transcribe and that text replies come back on Telegram.

Step 5: Activate for production

  1. Once tests work, turn on the workflow in n8n.
  2. Monitor the workflow when users start asking questions live.
  3. Adjust prompts or add new PDFs over time to keep the knowledge base fresh.

If using self-host n8n, visit here for help setting up.


Common problems and fixes

No text appears after PDF extraction?

The PDF may be made of images or have protections stopping text extract.
Try using OCR or check the file is text-based.

OpenAI embedding fails or errors?

Check the API key is valid and has quota.
Make sure text chunks are not too long or malformed.

Bot does not respond to voice messages?

Verify Telegram API token is correct.
Test voice file downloading steps in the workflow to find failures.


Ways to customize this workflow

  • Change PDF URLs in HTTP Request node to update help documents anytime.
  • Change text chunk size in the Recursive Character Text Splitter node for a better balance of performance and accuracy.
  • Add support for more message types like pictures or documents in the Switch node.
  • Modify the AI system prompt in the AI Agent node to fit your company style or specific topics.
  • Switch PostgreSQL vector store to a different database or vector tool if needed.

Summary of benefits and results

✓ Saves HR and IT teams hours every day by automating answers.
✓ Quickly answers employee questions from text or voice.
✓ Keeps answers consistent and based on official company policies.
✓ Stores conversation history in PostgreSQL for better chat flow.
✓ Works inside Telegram, a common employee chat platform.
✓ Easy to update knowledge base by adding new PDF documents.


Automate HR IT helpdesk with n8n and OpenAI

Visit through Desktop to Interact with the Workflow.

Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.
Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.

Frequently Asked Questions

Yes, the workflow can use other platforms like Slack or Microsoft Teams by replacing Telegram nodes with their equivalents.
Vector embeddings increase storage, but usually the size is manageable and can be cleaned regularly.
Yes, the workflow uses encrypted APIs and secure database connections depending on the hosting environment.
The PDF might be scanned images or protected. Try using OCR before extraction or use a different PDF.

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.