How to Automate Lead Capture With n8n

Build a lead pipeline in n8n: a form posts to a webhook, the workflow validates the lead, saves it to your CRM, and alerts your team in seconds.

By Galactic News Editorial · Published 2026-11-10T16:22:44+00:00 · Updated 2026-11-10T16:22:44+00:00

Automate lead capture with n8n webhook workflow from form to CRM

How to Automate Lead Capture With n8n

n8n turns a website form into a lead pipeline. A visitor submits the form. n8n catches the submission, checks the email, saves the lead, and alerts your team. No one copies data by hand. This guide builds that workflow step by step, then covers the test URL trap and webhook security.

How to automate lead capture with n8n: what the workflow looks like

The whole pipeline is five nodes. A Webhook node receives the form submission. An IF node checks that the name and email are present. A Code node checks the email format. A CRM node saves the lead. A Slack node alerts the sales team. A Respond to Webhook node answers the form so the visitor sees a success message. The run takes under a second.

n8n is a visual workflow automation tool. You build on a canvas by connecting nodes. It runs as a hosted Cloud service or as a free self-hosted Community Edition on your own server. Every workflow starts with a trigger node and continues through action nodes. Data flows between nodes as JSON items.

Step 1: Add a Webhook trigger

  1. Create a workflow. In n8n, click Create Workflow. The canvas opens empty.
  2. Add a Webhook node. Click the plus icon, search for Webhook, and place the node. Set the HTTP Method to POST. Set the path to lead-intake.
  3. Copy the Test URL. The node shows two URLs. The Test URL works while you build. The Production URL works only when the workflow is active. Use the Test URL now.
  4. Point your form at it. Paste the Test URL into your form tool's webhook settings. Most form builders can POST each submission to a URL. Send one test submission and check which fields arrive in the editor.

Step 2: Validate the lead

Bad data in means bad data everywhere downstream. Validate before you store anything.

  1. Add an IF node. Check that the name and email fields are present and not empty. Route failures to a dead end or an error log, not to the CRM.
  2. Add a Code node for format checks. A short JavaScript check confirms the email looks like an address. This is format validation only. It does not verify that the inbox exists.
  3. Normalise the fields. Trim spaces, lower-case the email, and map every source to one lead format. One format now saves hours of cleanup later.

Step 3: Store the lead in your CRM

Pick one system of record and send every lead there. Google Sheets works for a first version. Notion, HubSpot, and Salesforce all have n8n nodes for later.

  1. Add your storage node. Connect it with your account credentials. Map the name, email, phone, and enquiry fields from the webhook payload. Fields arrive as JSON, so an email field is read as {{ $json.email }}.
  2. Use create-or-update, not create-only. A returning visitor should update the existing record, not create a duplicate. Deduplicate on email or phone.
  3. Score the lead if you want to. A small Code node can score from facts only, such as company size or budget field. Keep the scoring rules written down so the team trusts them.

Step 4: Alert the team and reply to the form

  1. Add a Slack node. Send a message to the sales channel with the lead's name, email, and enquiry. Hot leads get an immediate ping. Everything else can wait for a morning digest, which a Schedule Trigger can send daily.
  2. Add a Respond to Webhook node. Return a success message to the form. Without this node, some form tools hang or show an error even though the lead was saved.
  3. Activate the workflow. Click the Active toggle. Now switch the form from the Test URL to the Production URL. Production runs do not show live in the editor. Check them in the workflow's Executions tab.

The test URL trap

Confusing the two webhook URLs is the most common n8n webhook problem. The Test URL only works while the workflow is open in the editor and listening for a test event. The Production URL only works when the workflow is active. A form pointed at the Test URL stops working the moment you close the editor. A form pointed at the Production URL of an inactive workflow receives nothing at all. Test with the Test URL. Go live with the Production URL. Check the Executions tab to confirm live runs.

Secure the webhook before you publish it

An unprotected webhook is a public URL. Anyone who finds it can fire your workflow, flood your CRM with spam, or trigger messages to your team. n8n's Webhook node supports Header Auth, Basic Auth, and JWT out of the box. Pick one and require it.

For services that sign payloads, such as Stripe or GitHub, verify the signature inside the workflow before trusting the data. Validate the payload shape with an IF node early, before any node writes or sends anything. Never act on an unauthenticated webhook that moves money, changes records, or sends messages.

Ways to capture leads in n8n compared

TriggerSourceSetupBest for
Webhook nodeAny website form that can POSTPaste the webhook URL into the form toolForms you already own
n8n Form TriggerA form hosted by n8n itselfBuild the form in the node, share its URLQuick landing pages with no site
App trigger nodesTypeform, Google Forms, Gmail, Facebook Lead AdsConnect the app account, pick the eventLeads that start outside your site
Schedule TriggerA sheet or inbox checked on a timerSet the interval, read new rowsBatch imports and daily digests

Bottom line

Start with the five-node version: webhook, validation, storage, Slack alert, and webhook response. Get one form flowing end to end before adding scoring, enrichment, or follow-up sequences. The two rules that matter most are the test-versus-production URL split and webhook authentication. Get those right and the pipeline runs quietly for months.