Part 2: AI Agent & Validation
Objective
Immediately after the Extract from PDF node executes, the AI Agent analyzes the extracted CV text to identify key candidate information required for onboarding. The workflow then pauses to allow human review and approval of the AI-extracted data
Based on the decision:
- Approved: The workflow proceeds with the onboarding actions.
- Not Approved: The data is returned to the AI Agent for re-analysis, and the HR team is notified via email
Description
The AI Agent Node (using Ollama) processes the extracted text and automatically
- Extracts candidate Name and Start Date
- Determines the appropriate Team and Manager
- Determines the candidate’s Seniority Level (Junior, Mid-Level, Senior)
Once the analysis is complete, the workflow
- Sends a structured summary of the extracted information to the HR team via Gmail
- Includes Name, Start Date, Team, Manager, and Seniority Level in the email
- Provides Approve / Reject options
- Routes the workflow based on the decision:
- Yes → Proceeds with onboarding actions
- No → Triggers AI re-analysis and sends an email notification to the candidate
1. HR Supervisor Agent Node
Steps
- After Extract from PDF, click the "+" button.
- Search for AI Agent and add it to the workflow

- Define Prompt / Instructions:
- User Prompt
Here is a new CV:
{{ $json.text }}
Here is the start date:
{{ $('Form (New CV)').item.json['arrival date'] }}
- System Prompt
You are the Expert HR Analyst at Devoteam. Your unique role is to extract and structure onboarding information from a CV and an arrival date.
INSTRUCTIONS:
1. Analyze the provided CV to extract the candidate's First and Last Name.
2. Determine the target team based on the technical skills mentioned in the CV.
3. Assign the corresponding Manager according to this strict list:
- Data Team -> Manager: Ben (ben@company_forgai.lu)
- DevOps Team -> Manager: Jean (jean@company_forgai.lu)
- Mcloud Team -> Manager: Marc (marc@company_forgai.lu)
4. Use the provided arrival date: {{ $('Form (New CV)').item.json['arrival date'] }}.
MANDATORY OUTPUT FORMAT:
You must respond only in the form of a structured summary as follows, without superfluous text before or after:
- Candidate: [First Last Name]
- Team: [Team Name]
- Manager: [Manager Name]
- Manager Email: [Manager Email]
- Arrival Date: [Date]
- Profile Analysis: [Give a short sentence on seniority or specialty, e.g., Senior Data Engineer]
CRITICAL OVERRIDE (HITL FEEDBACK):
If a human reviewer provided a rejection reason below, this comment has absolute priority. You MUST adjust your analysis and output to strictly follow and incorporate this human feedback, overriding any conflicting deduced information:
{{ $json.data['If no, tell the reason :'] }}- Rename the AI Agent to HR Supervisor Agent

- Select Model: Ollama
- Choose Model: mistral-namo:latest
- Enable Memory / Context Storage
- Add Key: {{ $execution.id }}
- Change the Content Window Length field to 10

2. Gmail Node
- Add a Gmail Node after the AI Agent node
- Node Name: Gmail
- Action: Send message and wait for response

- Configure Node
- Add credentials
- Configure Recipient: HR email
- Subject: Validation Required: New Joiner
- Message
🤖 ** AI Generation Complete: New Joiner**
The AI has successfully analyzed the CV and prepared the onboarding data.
📄 ** Content: **
{{ $json.output }}
👇 Please click the secure link below to validate or refuse this onboarding process:- Add Field
- Name: Validate
- Type: Checkboxes
- Checkboxes: Yes / No
- Required Field
- Add Field
- Name: If no, tell the reason
- Type: Text Input

3 Decision Logic (IF Node)
Steps
- Add an IF Node connected to Gmail
- Condition :
{{ $json.data.Validate[0] }} contains Yes- Connect the AI Agent HR Supervisor to the False path of the IF node

Workflow Ready for testing
Execute the workflow by uploading the CV in the form Once the AI extraction is completed and the validation email is configured
- The candidate information is sent to HR for approval via Gmail.
- The workflow pauses until a decision is made
- The IF node evaluates the approval response
