# Answer HR questions with OpenAI and PostgreSQL: n8n workflow

> Started by another system calling it, and works across Pinecone and Postgres. It puts OpenAI behind a retrieval step, so answers are drawn from documents...

Source: https://millionrounds.com/workflow/answer-hr-questions-with-openai-and-postgresql (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Customer support](https://millionrounds.com/workflows?category=Customer+support#library)

# Answer HR questions with OpenAI and PostgreSQL

Started by another system calling it, and works across Pinecone and Postgres. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 26 steps, 5 branches: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fanswer-hr-questions-with-openai-and-postgresql)

**26 steps** Large: read it before trusting it with anything live

**5** Branches: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 5 Model 7 Logic 11 Service 3

The steps in the order they run, from what starts it.

- 1 **Webhook - HR Bot Chat** Webhook *Starts it*
- 2 **OpenAI Model - Translation** Lm Chat Open Ai *Model*
- 3 **OpenAI GPT-4o-mini** Lm Chat Open Ai *Model*
- 4 **PostgreSQL - HR Database Tool** Postgres Tool *Service*
- 5 **OpenAI Embeddings** Embeddings Open Ai *Model*
- 6 **PostgreSQL Chat Memory** Memory Postgres Chat *Model*
- 7 **Validate Identity (Mobile/Email)** If *Logic*
- 8 **Translate to English** Chain Llm *Model*
- 9 **HR Assistant AI Agent** Agent *Model*
- 10 **Pinecone - HR Policy Knowledge Base** Vector Store Pinecone *Model*
- 11 **Check Audio Input** If *Logic*
- 12 **Error - Invalid Mobile/Email** Respond To Webhook *Starts it*
- 13 **Merge Translation Context** Set *Logic*
- 14 **Format Final Response** Code *Logic*
- 15 **ElevenLabs - Transcribe Audio** Eleven Labs *Service*
- 16 **Validate Message** If *Logic*
- 17 **Fetch Employee Data** Postgres *Service*
- 18 **Send Success Response** Respond To Webhook *Starts it*
- 19 **Extract Transcript** Set *Logic*
- 20 **Parse Input & Detect Language** Code *Logic*
- 21 **Error - Invalid Message** Respond To Webhook *Starts it*
- 22 **Validate Employee** If *Logic*
- 23 **Needs Translation?** If *Logic*
- 24 **Merge Employee & Language Context** Code *Logic*
- 25 **Error - Employee Not Found** Respond To Webhook *Starts it*
- 26 **Skip Translation (English)** Set *Logic*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 26, with 5 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Pinecone, Postgres
- **Model:** OpenAI
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Pinecone and Postgres accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on another system calling it.

Does it use AI?

Yes. It calls OpenAI. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 26 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 26 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fanswer-hr-questions-with-openai-and-postgresql)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Pinecone](https://millionrounds.com/workflows?service=Pinecone#library)[Postgres](https://millionrounds.com/workflows?service=Postgres#library)

## Workflows like it

Also customer support, with the same services where possible, closest in size first.

- [**Answer Slack knowledge questions with Notion and Google Drive** 25 steps · calls a model · Google Drive, Notion](https://millionrounds.com/workflow/answer-slack-knowledge-questions-with-notion-and-google-driv)
- [**Automate Airbnb guest support with OpenAI and Google Drive** 24 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/automate-airbnb-guest-support-with-openai-and-google-drive)
- [**AI email support system: Gmail, Gemini, GPT-4, Slack & Google** 23 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/ai-email-support-system-gmail-gemini-gpt-4-slack-and-google)
- [**Build RAG-powered support agent for Jira issues with Pinecone** 23 steps · calls a model · Pinecone](https://millionrounds.com/workflow/build-rag-powered-support-agent-for-jira-issues-with-pinecon)
- [**Answer FAQs and route Telegram users to support with Postgres** 29 steps · Postgres, Telegram](https://millionrounds.com/workflow/answer-faqs-and-route-telegram-users-to-support-with-postgre)
- [**AI-powered ticket triage with OpenAI and Postgres** 22 steps · calls a model · Postgres, Slack](https://millionrounds.com/workflow/ai-powered-ticket-triage-with-openai-and-postgres)
