If you’ve tried to use the built-in HubSpot trigger in n8n, you’ve likely run into a frustrating permission error. It’s a known issue that can halt your automation projects.
In this tutorial, I’ll show you a reliable workaround using HubSpot’s webhooks. We’ll cover two main things:
- How to set up a HubSpot action in n8n (creating a contact).
- How to set up a HubSpot trigger using a webhook to listen for new contacts.
Let’s get started.
Part 1: Setting Up a HubSpot Action in n8n
We’ll begin by creating a contact in HubSpot from n8n. This proves our connection is working.
Step 1: Create a HubSpot Private App
First, you need to generate an access token for n8n to use.
- Go to the HubSpot Developer Portal.
- Log in with your HubSpot account and navigate to your dashboard.
- Click on “Legacy Apps” and then the “Create” button.
- Select “Private for one account” to create a private app.
- Give your app a name (e.g., “n8n Test”).
- Click on “Scopes” and then “Add New Scope.” For creating contacts, you need to select the
crm.objects.contactsscope with bothreadandwritepermissions. - Click “Update” and then “Create App.”
- Once created, go to the “Auth” tab. You will see an access token. Click “Show token” and copy it.
Step 2: Configure n8n with Your HubSpot Credentials
Now, let’s plug that token into n8n.
- In your n8n workflow, add a HubSpot node.
- Search for and select the “Create or Update a Contact” action.
- Click on “Credentials” and then “Create New.”
- Choose the “App Token Method” and paste the access token you copied from your HubSpot private app.
- Click “Save” to create the credential.
Step 3: Test the Action
- In the HubSpot node, enter a test email address (like
[email protected]). - Click “Execute Node” to run the workflow.
- If successful, go to your HubSpot CRM contacts. You should see a new contact with that email address, confirming the action node works perfectly.
Part 2: Setting Up a HubSpot Trigger (The Webhook Fix)
The built-in HubSpot trigger node often fails due to OAuth scope issues. Here’s how to bypass that problem using a webhook.
Step 1: Add a Webhook Node in n8n
- In your n8n workflow, add a Webhook node.
- Give it a descriptive name like “HubSpot Trigger.”
- The node will generate a unique URL. Copy this URL. Remember:
- Use the test URL (the one with
-testin it) while building and testing your workflow. - Use the production URL (without
-test) when you activate your workflow.
- Use the test URL (the one with
Step 2: Configure the Webhook in Your HubSpot Private App
We’ll use the same private app we created earlier.
- Go back to your private app in the HubSpot Developer Portal.
- Navigate to the “Webhooks” section.
- Click “Edit Webhooks” or “Create Subscription.”
- Paste the n8n webhook URL you copied in the previous step.
- For the subscription details:
- Object Type: Select
Contact. - Events: Select
contact.creation.
- Object Type: Select
- Click “Subscribe” or “Create Subscription.”
- Ensure the subscription status is “Active.” If it’s paused, you may need to activate it.
Step 3: Test the Trigger
- Back in n8n, with your Webhook node selected, click “Listen for test events” on the right-hand panel. This puts the node in testing mode.
- Now, go to your HubSpot CRM and manually create a new contact.
- Return to your n8n canvas. You should see that the Webhook node has automatically triggered and its output now contains the data of the newly created contact.
Success! You now have a fully functional HubSpot trigger. Whenever a new contact is created, it will send the data to this n8n webhook, kicking off your automation.
Conclusion
By using a HubSpot private app for actions and a webhook for triggers, you can build robust automations that bypass the common pitfalls of the native n8n nodes. This method is reliable and gives you full control over the data flow between HubSpot and n8n.