Workflow 3 · HR
Reads the cover letter, builds a candidate profile and drafts an email to the candidate.
not built yet The email draft is not sent.
An automation that reads incoming messages (job applications, sales leads, support problems, spam) and routes each one to the right team, flagged in the response it returns. Built during the Kanz AI Training Hackathon. The whole AI pipeline runs locally, with no outside AI service.
In short. A shared inbox fills up with job applications, sales leads, support problems and spam, and someone has to sort each message. A small AI model running locally sorts them, plain steps check the input and score the lead, and each message is routed to the right team. It is a prototype: the ticket and email steps are not connected and the accuracy was not measured.
Demo video
A recording of five test messages sent to the workflow from Postman: a general question, a sales lead, a support problem, a job application and spam. Each one is then checked in n8n's Executions tab to see where it went. Click a chapter to jump to it.
Core flow
Safety and limits
Core flow
Safety and limits
Core flow
How it flows
Pick a test message from the demo:
What came out
Category General, confidence 0.99, with an automatic answer. The run took 6.0 seconds.
Click any box to see what that step does.
A company inbox gets job applications, sales leads, support problems, partnership offers and spam. This automation reads each message, decides what kind it is, and sends it to the right place. When the AI is unsure, it looks again more carefully, or hands the message to a person.
It is built in n8n, and the AI is a small model (qwen2.5:3b) running locally, so CVs and customer details never leave it. The example company in the prompts is ConnectWave Telecom.
The main workflow has 25 parts, but only two of them use the AI. The rest is plain code, which is what makes a small AI model reliable enough.
The website form (or any app) sends the message to the workflow.
It must have a name, a valid email, a subject and a message. If not, the sender gets an error right away and the AI is never used.
Removes extra spaces and makes the email lower-case.
A small AI model (qwen2.5:3b) running locally picks one category: HR, Sales, Support, Partnership, Spam or General. It also says how sure it is and how urgent the message is.
If the AI's answer is broken, the code looks for a category name in the text and marks it as unsure. If that fails too, it files the message as General. The workflow never crashes because of a bad AI answer.
Yes, when the AI is less than 70% sure, or when the message is for HR. Otherwise the first guess stands.
The same AI model gets a longer, more detailed question and tries again. If its answer is broken, the first guess is used.
The result is printed to the console. Saving it in a database is not built yet.
One path for each category, plus a catch-all path, so an unexpected answer never lands in the wrong team.
| Type | Goes to | Status |
|---|---|---|
| HR | Workflow 3: reads cover letters | partly built Builds a candidate profile. Sending the email draft is not built yet. |
| Sales | Workflow 4: scores the lead | partly built Scoring works. Saving to a CRM and notifying sales are not built yet. |
| Support | Workflow 5: finds the problem type | partly built Picks the team. Searching help articles, creating tickets and alerts are not built yet. |
| General | Workflow 6: tries to answer | partly built Writes an answer and checks confidence. Sending the email is not built yet. |
| Partnership | No handler yet | partly built Goes to an empty step for now. |
| Spam | Dropped | done Dropped on purpose, with no notification. |
| Anything else | Catch-all | done Has its own path so nothing is lost. |
Reads the cover letter, builds a candidate profile and drafts an email to the candidate.
not built yet The email draft is not sent.
Finds what the customer wants, how big the company looks, how urgent it is and whether a budget is mentioned. Then it scores the lead with a fixed point system.
not built yet Saving to a CRM and the two sales notifications are not built yet.
Finds the type of problem and how serious it is, then picks the right team. Critical problems go down a separate path.
not built yet Searching help articles, creating tickets, the network-team alert and the team queue are not built yet.
Writes an answer, and sends it automatically only if the AI says it can answer and is at least 75% sure.
not built yet Sending the reply and passing the message to a person are not built yet.
A separate workflow that runs when anything fails, and records what went wrong.
not built yet It writes to the console.
For sales messages, the AI only reads out four facts. The score itself comes from a simple point system, so the same facts always give the same score:
+15 urgency medium +30 size enterprise +20 budget mentioned +10 priority medium = 75
This is the real scoring code from the sales workflow, run on the values you choose. In the real workflow the AI reads out the first three values, and the points are added by plain code.
| A quick guess first, a careful one only if needed | Most messages are clear, so a short question is enough. The longer question only runs when the AI is unsure or the message is for HR. |
|---|---|
| Check the message before using the AI | Bad input is rejected by plain code, so the AI only sees proper messages. |
| A safe fallback for every AI answer | Small models sometimes answer in the wrong format. Every step has a safe default instead of crashing. |
| Only auto-reply when the AI is confident | A reply goes out by itself only if the AI says it can answer and is at least 75% sure. Everything else goes to a person. |
| Run the AI locally | CVs and customer details stay on the same machine instead of going to an online service. |
Ask me about Rami's projects, skills, education or how to reach him. Hiring? Switch to “Compare a job post” and paste the description.