At a glance
- Trigger
- Chat Trigger (Employee initiates a conversation)
- Nodes
- 39
- Apps
- OpenAI, BambooHR and Supabase
- AI nodes
- 22
- Credentials
- 3 types
- Category
- RAG, documents and vector search
Apps and integrations
Node types used
How it works
The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.
STEP #1: Retrieve company policies and load them into a vector store
BambooHR AI-Powered HR Benefits and Company Policies Chatbot
AI Chatbot Operating Guidelines
- When an employee asks for a contact person, first attempt to find the relevant contact in company_files.
- If a contact person is found but their details (e.g., email or phone number) are missing, use the employee_lookup_tool to retrieve their contact details.
- If no contact person is found
- Use the employee_lookup_tool with "HR" (or another relevant department) to retrieve the most senior person in that department.
- If no senior contact is found, ask the employee for their name.
- Use the employee_lookup_tool to retrieve their supervisor’s name.
- Use the employee_lookup_tool to retrieve their supervisor’s details.
- Provide the supervisor's contact information and recommend them as the best next point of contact.
About the maker
Find Ludwig Gerdes on LinkedIn
Toggle off the _simplify_ option to ensure categories are retrieved as well
This employee lookup tool gives the AI Benefits and Company Policies chatbot additional superpowers by allowing it to search for an individual or a department to retrieve contact information from BambooHR.
GetAll employees from BambooHR
BambooHR does not offer search by {field} functionality for its /employees endpoint, so filtering must be done after data retrieval. This can be inefficient for very large organizations where there may be multiple employees with the same name or simply a large number of employees.
GET singular employee by name path
This path may be used multiple times by the HR AI Agent to look up the employee's details, and then to look up their supervisor's details.
GET senior leader of department path
This path would normally only be used when no other contacts can be identified from the company_files. The employee can retrieve the contact details for the most senior leader of a department should they request it.
Final node returns employee name
The AI Agent can then call the employee lookup path to retrieve details, if requested.
Setup notes
The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.
(Optional) STEP #2: Set up employee lookup tool
Nodes in this workflow
The 39 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:
- When clicking ‘Test workflow’ (Manual Trigger)
- Default Data Loader (Default Data Loader)
- Embeddings OpenAI (OpenAI Embeddings)
- Recursive Character Text Splitter (Recursive Character Text Splitter)
- Window Buffer Memory (Window Buffer Memory)
- OpenAI Chat Model (OpenAI Chat Model)
- Vector Store Tool (Vector Store Question Answer Tool)
- OpenAI Chat Model1 (OpenAI Chat Model)
- Embeddings OpenAI1 (OpenAI Embeddings)
- Employee Lookup Tool (Call n8n Workflow Tool)
- OpenAI Chat Model2 (OpenAI Chat Model)
- OpenAI Chat Model3 (OpenAI Chat Model)
- OpenAI Chat Model4 (OpenAI Chat Model)
- Auto-fixing Output Parser (Auto-fixing Output Parser)
- OpenAI Chat Model5 (OpenAI Chat Model)
- Structured Output Parser (Structured Output Parser)
- GET all files (BambooHR)
- Filter out files from undesired categories (Filter)
- Split out individual files (Split Out)
- Filter out non-pdf files (Filter)
- Download file from BambooHR (BambooHR)
- Supabase Vector Store (Supabase Vector Store)
- Employee initiates a conversation (Chat Trigger)
- Supabase Vector Store Retrieval (Supabase Vector Store)
- AI-Powered HR Benefits and Company Policies Chatbot (Execute Workflow Trigger)
- Text Classifier (Text Classifier)
- GET all employees (BambooHR)
- Filter out other employees (Filter)
- Stringify employee record for response (Edit Fields (Set))
- GET all employees (second path) (BambooHR)
- Extract departments (Aggregate)
- Ensure uniqueness in department list (Edit Fields (Set))
- Extract department (Information Extractor)
- Retrieve all employees (BambooHR)
- Filter out other departments (Filter)
- Extract relevant employee fields (Aggregate)
- Identify most senior employee (Basic LLM Chain)
- Format name for response (Edit Fields (Set))
- HR AI Agent (AI Agent)
Credentials you need
- BambooHR API – used by Download file from BambooHR, GET all employees, GET all employees (second path) and GET all files and others
- OpenAI API – used by Embeddings OpenAI, Embeddings OpenAI1, OpenAI Chat Model and OpenAI Chat Model1 and others
- Supabase API – used by Supabase Vector Store and Supabase Vector Store Retrieval
Configure your own credentials after importing. Create each credential in n8n, then select it in the node.
How to import into n8n
- Download the JSON file with the button above.
- In n8n, open a new workflow, select the ... menu and choose Import from File. You can also paste the JSON straight into the editor canvas.
- Open each node that shows a warning and select or create its credential.
- Read the notes on the canvas, test the workflow with sample data, then activate it.
Do you need somewhere to run it? Read our guide to self-hosted n8n.