Case study / automation

An n8n workflow that qualifies leads with an external AI API

Webhook in, DeepSeek classifies, the router branches on the verdict, JSON out. This is the exact flow we built and tested end to end on a local n8n instance (version 2.22.6) as a reference for automation work.

n8n 2.22.6 DeepSeek API Webhook IF router JSON response

How it works

01 / WEBHOOK

Lead arrives

A POST /webhook/lead-qualify receives the lead payload (name, company, role, message, budget, timeline).

02 / HTTP

AI classifies

The workflow calls the DeepSeek chat completions API with a strict JSON prompt: score 0-100, tier HOT / WARM / COLD, one-sentence reason.

03 / ROUTER

Branch on verdict

An IF node checks the model output for HOT and routes to the matching responder.

04 / RESPONSE

JSON back

The webhook caller gets { qualified, source, ai } the same moment the call finishes.

The workflow

n8n canvas: Webhook, DeepSeek Classify, Is Hot?, Respond HOT, Respond Not HOT
Canvas: Webhook → DeepSeek Classify → Is Hot? → Respond HOT / Respond Not HOT

Real test runs

Two live requests against the running instance. No mocks: the classify step hit the real API both times.

RunInputTierScoreResponse
#1VP Engineering, approved Q4 budget, 6-week timelineHOT95qualified: true
#2Owner, no budget, "just browsing"COLD10qualified: false
n8n executions list showing two successful runs
Executions view: both runs completed successfully

The part that actually takes time

The flow itself is four nodes and an afternoon. Getting a local n8n running the way we wanted took longer: native modules (sqlite3, isolated-vm) had to be rebuilt against the right Node version, the CLI import needs an explicit workflow id, and a published workflow only takes effect after a restart.

That is normal for automation work, and it is usually where projects stall. If a workflow of yours is stuck somewhere between "it worked yesterday" and "nobody knows why it stopped", that is the kind of thing we fix.

Need a workflow fixed, migrated or kept alive?

Diagnosis $99, repair with a 30-day warranty on the same root cause $299, or ongoing care from $200/month. Everything in writing, fully async.

Email [email protected]