n8n lead generation workflow
Turn LeadMind into AI automation inside n8n: one HTTP Request node starts a job from a sentence, a Webhook node receives the delivered leads, and the rest of your workflow decides where they go. No custom node, no polling loop, no seat to buy.
1. Create an API key
In Settings → API keys create a key with the jobs:write, leads:read and webhooks:write scopes. Store it in n8n as a Header Auth credential: name Authorization, value Bearer lp_live_…. Use an lp_test_ key while you build — it runs the same flow on fixture data for free.
2. Webhook trigger node
Add a Webhook trigger (method POST, respond “Immediately”). Copy its production URL and register it once:
POST https://outreach-nlfc.onrender.com/v1/webhook-endpoints
Authorization: Bearer lp_live_…
Content-Type: application/json
{ "url": "https://<your-n8n>/webhook/leadmind", "events": ["job.delivered", "job.failed"] }The response contains the signing secret once. Every delivery carries X-LeadMind-Signature: t=<unix>,v1=<hex HMAC-SHA256(secret, "<t>.<raw body>")>; verify it in a Code node before trusting the payload, and respond 2xx within 10 seconds (n8n’s “respond immediately” does).
3. HTTP Request node — start the job
POST https://outreach-nlfc.onrender.com/v1/jobs
Authorization: Bearer lp_live_…
Content-Type: application/json
Idempotency-Key: {{ $execution.id }}
{ "prompt": "{{ $json.prompt }}", "maxCredits": 50 }The prompt can come from a form, a Slack message, a WhatsApp message or a schedule. Idempotency-Key makes retries safe; maxCredits caps what the job may charge. The job answers 202 and runs for two to fifteen minutes.
4. On job.delivered: fetch and route the leads
The webhook body contains data.job.id and ready-made data.links.leads / data.links.export URLs (payloads never contain lead data themselves). Add an HTTP Request node:
GET https://outreach-nlfc.onrender.com/v1/jobs/{{ $json.data.job.id }}/leads?limit=100
Authorization: Bearer lp_live_…Each lead has email, phone, website, socials.whatsapp, socials.telegram, a score with reason and a site object of verified website signals (online booking, live chat, platform, hiring). Feed them to Google Sheets, HubSpot, Airtable or a WhatsApp reply node; follow nextCursor for more than 100 rows.
5. Handle the other outcomes
job.awaiting_clarification— the prompt was ambiguous (usually the location). Answer withPOST /v1/jobs/{id}/clarifyor add the missing detail to the prompt.job.failed— nothing was charged; the body carries a stableerrorCode.- A delivered job with zero leads carries a
deliveryNoteexplaining why (no matches, all duplicates, all filtered) — also not charged.
Frequently asked questions
- Does LeadMind have an n8n node?
- Not a dedicated one yet; none is needed. n8n’s built-in HTTP Request node calls the REST API and the Webhook trigger node receives the job.delivered event, which is the whole integration.
- Does the workflow spend credits while waiting?
- No. Credits are held when the job starts and charged only for delivered leads when the webhook fires. A job that fails, is cancelled or delivers nothing charges nothing.
- Can I test the workflow without spending credits?
- Yes. Create a test key (lp_test_…) in Settings. It walks the same status sequence on fixture data, so you can wire every node before you pay.
- Where do the leads go?
- Anywhere n8n can write: Google Sheets, HubSpot, Airtable, a CRM, Slack, or a WhatsApp reply through Meta Cloud API, Twilio or WATI. Fetch them with GET /v1/jobs/{id}/leads (paged) or the CSV export link.
Full reference: REST API. Prefer an assistant over a workflow? Connect Claude, ChatGPT or Gemini over MCP.