POST with a nested JSON body, which that action can’t build, so this guide uses a Custom code action instead. Existing v2 workflows keep running until November 2026, when v2 endpoints stop responding - migrate before then.Prerequisites
1. Check your HubSpot subscription
Custom code actions require Data Hub Professional or Enterprise, which HubSpot previously called Operations Hub. If your portal is on Marketing Hub or Sales Hub only, the Custom code action won’t appear in the action list, and you’ll need a connector platform such as n8n, Workato, Make or Zapier instead. You also need Edit permissions for workflows and Publish permissions to turn it on - not Super Admin, and no app.2. Get your Lusha API key
Go to Manage API keys and click + Create new Key. Copy it - you’ll paste it once, below. Auth is via anapi_key HTTP header, not Bearer.
Custom properties to create
Create a property for each value you want to keep. Everything here is optional, so start with the handful your team will actually use and add more later. See Appendix B for the full list. Go to Settings → Properties → Create property, set the object to Contact, and choose the field type shown in Appendix B.Workflow configuration
There are four core parts to configure:Create the workflow
- In HubSpot, go to Automation → Workflows
- Click Create workflow → From scratch
- Choose Contact-based, then click Next
- Name it something descriptive, such as
Lusha Contact Enrichment
Set the enrollment trigger
- Click Set up triggers
- Choose When filter criteria is met → Contact properties
- Select Create date → is known
- Click Apply filter, then Save
Add the Custom code action
- Click the + icon below the trigger
- In the left panel, search for and select Custom code
- Leave Language set to Node.js
- In Description, enter something like
Call Lusha v3 and return contact data
Add your Lusha API key as a secret
- Click Add secret → Create new secret
- Secret name:
LUSHA_API_KEY - Secret value: your Lusha API key
- Click Save, then make sure the checkbox next to the secret is ticked
Add the input properties
Paste the code
https://api.lusha.com/v3/contacts/search-and-enrich. It then pulls 31 values out of the response and returns them as data outputs. It doesn’t write anything to HubSpot itself, so nothing changes on the record until your Edit record actions run. Every output is declared with a default at the top of the script, so the action always returns the complete set - an output missing from a response fails any action that references it, which is why none are left undefined.Define the data outputs
All 31 outputs and their data types
All 31 outputs and their data types
Add a branch so unmatched Contacts are left alone
- Click the + icon below the Custom code action
- Select If/then branch
- Branch on Action outputs → your Custom code action → lushaMatched
- Set the condition to is equal to → true
- Every Edit record action goes on the Yes path. Leave the No path empty
Add your first Edit record action
- On the Yes path, click the + icon
- Select Edit record
- Record to edit: Contact from trigger
- Property to edit: Lusha Work Email
- Change type: Replace
- Choose a value: click the field, switch the source to your Custom code action, and select
lushaWorkEmail - Click Save
lushaWorkEmail in the code and lushaWorkEmail in Data outputs have to match exactly.Add an Edit record action for each remaining field
Set a rate limit
- Click the Custom code action, then Configure rate limit at the bottom
- Toggle Turn on rate limiting on
- Action executions:
20, Time frame: Seconds
429 errors. Setting 20 leaves headroom for anything else on your account calling the API. The rate limit also applies to every action after the Custom code action in this workflow.Testing and activation
12. Test the action
- At the bottom of the Custom code action, click Test action
- Click the Contact dropdown and select a record to test with
- Click Test, then confirm
- When the run finishes, check that Status reads success, that Data outputs shows
lushaMatchedastruewith the fields populated, and that Logs shows no errors
13. Review and publish
- Click Review and publish in the top right
- Check the enrollment summary, then click Turn on
Appendix A - full custom code
Paste this into the Code editor of the Custom code action, replacing the sample code HubSpot provides.Full Node.js script
Full Node.js script
Appendix B - output and property reference
Every value the code returns, with a suggested HubSpot property and field type. Create only the properties you want.All 31 outputs with suggested properties
All 31 outputs with suggested properties
lushaAllEmails, lushaAllPhones and lushaPreviousEmployers, which can hold several values and are better as Multi-line text. Boolean outputs map to a Single checkbox. lushaCreditsCharged maps to a Number property. Keep lushaUpdateDate as Single-line text - Lusha returns it as 2026-08-13, and a HubSpot Date property expects a different format, so mapping it to a date type fails the action.Appendix C - copying Lusha values into standard properties
The main guide writes everything intoLusha ... properties so your existing CRM data is never overwritten. Once you trust the match quality, you can copy specific values into the standard fields.
The safe pattern is to write only when the standard field is empty:
- On the Yes path, add an If/then branch
- Branch on Contact properties → Email → is unknown
- On that branch’s Yes path, add an Edit record action
- Property to edit: Email, Change type: Replace, Value:
lushaWorkEmail
Appendix D - writing properties from the code instead
Write properties from the code instead of Edit record actions
Write properties from the code instead of Edit record actions
Create the private app
- In HubSpot, go to Development → Legacy apps
- Click Create legacy app, then select Private
- Name it on the Basic Info tab, then open the Scopes tab
- Click Add new scope and enable
crm.objects.contacts.readandcrm.objects.contacts.write, then click Update - Click Create app, then Continue creating
- Open the Auth tab, click Show token, and copy it
Change the code
Add the client at the top, then replace the final callback with a property write. Only include the properties you’ve created, because an unrecognised internal name fails the entire update.HUBSPOT_TOKEN, and tick it alongside the Lusha key.Appendix E - troubleshooting
The Custom code action doesn't appear in the action list
The Custom code action doesn't appear in the action list
An output doesn't appear in the Edit record value picker
An output doesn't appear in the Edit record value picker
A property was cleared instead of filled
A property was cleared instead of filled
lushaMatched is in place and that every Edit record action sits on its Yes path. If the Contact did match but one field came back empty, that field genuinely has no value in Lusha, so remove its action or point it at a Lusha property rather than a standard one.The action times out
The action times out
Errors during a bulk import
Errors during a bulk import
429 from Lusha means your rate limit is too high or turned off. Set the Custom code action to 20 executions per second, or lower if your plan’s per-minute cap is smaller (for example, 50 per minute on Pro). Throwing the error in the catch block, as the code does, is what tells HubSpot to retry, so don’t remove it.Contacts aren't enrolling
Contacts aren't enrolling
Additional resources
If you have questions on the above, reach out to the support team:- Via live chat from the Lusha website
- Your Lusha dashboard
- Via email: support@lusha.com