n8n

How to Automate Telegram HR Helpdesk Support?

Give your team a simple HR helpdesk in Telegram. Staff send questions by text or voice and get fast answers from your internal policy documents. It cuts repetitive work and speeds up support for common requests.

Policy PDFs are downloaded, converted to text, and split into small parts. Each part is turned into vectors with OpenAI and saved in PostgreSQL using PGVector. When a message arrives, a switch checks if it is text or voice. Voice notes are fetched from Telegram and transcribed before going to an AI agent. The agent uses the vector store and chat memory to find the right policy text and write a clear reply. A fallback sends a kind message if the content type is not supported.

To set it up, connect Telegram, OpenAI, and PostgreSQL. Add your HR and IT policy PDFs, run the setup once to build the knowledge base, and then enable the Telegram trigger. Expect faster answers, fewer email tickets, and more consistent guidance for topics like onboarding, leave rules, device use, and password support.

What are the key features?

  • Telegram trigger listens for new messages and starts the flow.
  • Message type check routes text and voice, with a fallback for unsupported content.
  • Telegram file fetch downloads voice notes using the file id.
  • OpenAI audio transcribe converts voice to text for agent processing.
  • HTTP Request downloads the policy PDF and Extract from File reads its text.
  • Text splitter creates clean chunks for better search accuracy.
  • OpenAI embeddings turn chunks into vectors for similarity search.
  • Postgres PGVector store saves vectors for fast and accurate retrieval.
  • AI Agent uses the vector store tool and Postgres chat memory to answer with context.
  • Telegram send message returns the final reply to the user.

What are the benefits?

  • Reduce response time from 1 hour to under 1 minute
  • Automate up to 70% of routine HR questions
  • Improve answer consistency by using one source of truth
  • Handle 5x more inquiries without extra staff
  • Connect Telegram, OpenAI, and PostgreSQL in one flow
  • Lower email ticket volume by up to 40% through chat self service

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Telegram, OpenAI and PostgreSQL. See the Tools Required section above for links to create accounts with these services.
  3. Create a Telegram bot with BotFather and copy the bot token. In n8n, open the Credentials page, create a new Telegram credential, paste the token, and save. Open the Telegram Trigger and Telegram nodes and select this credential.
  4. Get your OpenAI API key from your OpenAI account. In n8n, create a new OpenAI credential with the API key. Select it in the OpenAI Chat Model and OpenAI audio transcribe nodes.
  5. Set up PostgreSQL access. In n8n, create a PostgreSQL credential with host, port, database, user, password, and SSL settings as required. Select it in Create HR Policies, Postgres PGVector Store, and Postgres Chat Memory nodes.
  6. Open the HTTP Request node and set the URL to your policy PDF file. Click Execute Node to confirm the file is reachable.
  7. Open the Extract from File node and keep the operation set to PDF. Run it to confirm text is extracted.
  8. Check the Text Splitter chunk size and overlap. Keep chunk size near 2000 for broad answers. Run Create HR Policies in insert mode to build the vector store. Verify rows were added in your PostgreSQL database.
  9. Enable the workflow and start the Telegram Trigger. Send a text message to your bot and confirm you get a clear answer.
  10. Send a voice message to the bot. If transcription fails, ensure the Telegram file node maps file_id correctly and the OpenAI audio node uses the binary property named data.
  11. Review the AI Agent system message to match your tone and scope. Confirm the Postgres Chat Memory session key uses the Telegram chat id so context is kept per user.
  12. When you update policy documents, rerun the setup path with the manual trigger to refresh the vector store.
  13. If answers seem off, verify the correct PDF URL, check that extracted text is not empty, and confirm the embeddings and vector store nodes point to the same PostgreSQL database.
  14. Secure access by limiting who can contact the bot and by restricting PostgreSQL network access to n8n only.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

PostgreSQL

Sign up

Free: $0 (open-source PostgreSQL License; self-hosted)

Telegram

Sign up

Free: $0, Telegram Bot API usage is free for developers

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.