top of page

How to Send Website Leads to a CRM with n8n

1 day ago
4 min read

A lead that sits in your inbox for two days is a lead that has probably moved on. If your website form only sends you an email, someone still has to copy each name into your CRM, and that someone is usually you, late at night.

In this guide you will build an n8n workflow that receives every form submission, cleans the data, creates or updates the contact in HubSpot and alerts you right away. Note: we have not tested this exact workflow end to end on a live site. The steps follow the official n8n and HubSpot documentation, so test it with your own email before you rely on it. New to n8n? Start with n8n for beginners.

How to send website leads to a CRM with n8n

This post may contain affiliate links. If you buy through them, we may earn a commission at no extra cost to you.

What you will build

The workflow has five parts: your form sends the data to an n8n Webhook, n8n cleans it, the HubSpot node creates or updates the contact, and a final node sends you an alert by email or chat.

Website lead to CRM in five steps: form sent, webhook, clean data, HubSpot, notify

What you need

  • An n8n account (n8n Cloud or a self-hosted instance).

  • A form that can send a webhook. Many form builders, such as Tally and Jotform, can do this, or your developer can post the form data from your site's code.

  • A HubSpot account and a way to connect it: a private app access token or an OAuth2 connection.

  • Gmail, Slack or another app for the alert.

Step 1: Add a Webhook trigger

Create a new workflow in n8n and add a Webhook node as the trigger. Set the HTTP method to POST. The node shows two addresses: a Test URL and a Production URL. The Test URL only listens while you are testing in the editor. The Production URL only works when the workflow is turned on.

Step 2: Send a test submission

Copy the Test URL and paste it into your form's webhook settings. In n8n, start listening for a test event, then fill in the form yourself with your own email. The submitted fields should appear in the Webhook node. Look at the exact field names in the data, because you will use them in the next steps.

Step 3: Clean the data

Add an Edit Fields (Set) node to tidy up the values before they reach your CRM: trim spaces, make the email lowercase and split a full name into first and last name if your form uses one field. Then add an IF node that stops the workflow when the email is empty, so you do not create blank contacts.

Keep it simple. These are the only fields most small businesses need to send:

  • Email: required, used to find or create the contact.

  • Name: first and last name, if you ask for them.

  • Company: useful for B2B leads, optional.

  • Message: what the visitor actually needs.

  • Source page: which page or campaign the lead came from.

  • Consent: whether they agreed to hear from you.

Step 4: Create or update the contact in HubSpot

Add a HubSpot node, choose the Contact resource and the Create or Update operation. Map the email, first name, last name and company from the previous step. Because HubSpot uses the email to match contacts, a person who fills in your form twice is updated instead of duplicated.

To connect HubSpot, you can create a private app in your HubSpot settings and give it the contact scopes it needs (reading and writing contacts), then paste its access token into a new n8n credential. You can also use the OAuth2 option. Follow the current n8n credential guide, since the screens change from time to time.

Step 5: Get an instant alert

Add a Gmail or Slack node at the end. Send yourself a short message with the lead's name, email, message and source page. Now you can reply within minutes instead of days.

Step 6: Turn the workflow on

  1. Turn the workflow on in n8n (the Active or Publish switch, depending on your n8n version).

  2. Replace the Test URL in your form settings with the Production URL.

  3. Submit the form one more time with your own email and check that the contact appears in HubSpot and the alert arrives.

Privacy and consent

  • Only collect the data you really need, and never ask for sensitive information in a simple contact form.

  • Add a consent checkbox and a link to your privacy policy, and store the consent answer with the contact.

  • Treat the Production URL like a password. If your form tool supports it, add header authentication to the Webhook node.

  • Limit who can see workflow executions in n8n, because they contain personal data.

Troubleshooting

  • Nothing arrives in n8n: you may be using the Test URL while not listening, or the Production URL while the workflow is off.

  • HubSpot returns an error about permissions: check that your private app has the contact scopes and that the token was copied correctly.

  • Fields are empty in HubSpot: compare the field names in the incoming data with the names in your mapping.

  • Duplicate contacts: make sure you use Create or Update and map the email field.

The bottom line

A webhook, a cleanup step, the HubSpot node and an alert are all it takes to stop copying leads by hand. Build it once, test it with your own email, switch to the Production URL and every new lead lands in your CRM in seconds. Want another workflow? Try automating invoices with n8n and Google Sheets, or see how n8n compares in n8n vs Zapier vs Make.

Get one ready-to-use automation every week: subscribe to the Blog Spotlight Weekly newsletter.

Comments


bottom of page