Sync HubSpot records to Lightfield
Last updated: August 28, 2026
Goal: When a HubSpot record is created or a synced property changes, Lightfield creates or updates the matching record.
HubSpot → Lightfield · One workflow and one automation per record type
This sync will
Match records by HubSpot ID
Copy only the fields you choose
Create new records
Update existing records
This sync will not
Match records by name
Delete or merge records
Copy missing or blank values
Sync changes back to HubSpot
Before you start
You need: Lightfield Pro, Lightfield workspace admin access, HubSpot workflow access, HubSpot Data Hub Professional or Enterprise, and one safe HubSpot test record.
Choose one mapping
HubSpot | Lightfield | Lightfield tracking field |
|---|---|---|
Company | Account |
|
Contact | Contact |
|
Deal | Opportunity |
|
The tracking field must be writable Text. It stores the HubSpot record ID and prevents duplicates.
Write down the fields to copy:
[HubSpot property] → [Lightfield field]
[HubSpot property] → [Lightfield field]
Good first setup: HubSpot Company → Lightfield Account. Copy only company name, domain, and industry.
1. Configure Lightfield
Complete this section in Lightfield Agent Chat.
A. Check the data model
Open the prompt below, replace the bracketed text, and send it to the agent.
📋 Copy prompt: Check the Lightfield fields
I am setting up a one-way sync from HubSpot [record type] to Lightfield [record type]. Inspect the Lightfield [record type] fields. Confirm that: - [Lightfield field] exists and is writable. - [Lightfield field] exists and is writable. - [tracking field] exists as a writable Text field. If a field is missing, create it if you can. If you cannot, tell me what I need to add and stop. Do not create or update CRM records yet.
B. Build the automation
Continue only after the agent confirms that every field exists and has the correct value type.
📋 Copy prompt: Build the automation
Create a draft automation named: HubSpot → Lightfield | [HubSpot record type] to [Lightfield record type] Use an inbound webhook with this payload: { "source": "hubspot", "object": { "type": "[HubSpot record type]", "id": "[HubSpot record ID]", "properties": {} } } For each run: 1. Require source to equal "hubspot" and object.id to be present. 2. Find the Lightfield [record type] whose [tracking field] exactly equals object.id. 3. If there is no match, create one record and save object.id in [tracking field]. 4. If there is one match, update it. 5. If there is more than one match, stop without changing a record. 6. Copy only these non-blank properties: - object.properties.[HubSpot property] → [Lightfield field] - object.properties.[HubSpot property] → [Lightfield field] 7. Never match by name. Never delete or merge records. Use the correct Lightfield field keys and value types. Propose only the required permissions. Show me the draft before activating it.
C. Test and activate
Answer the agent's questions.
Review the fields, match rule, and permissions.
Grant the permissions when prompted.
Test with your HubSpot test record's real record ID.
Run the same payload again with one changed value.
Confirm that the first run creates one record and the second run updates it.
Activate the automation.
Copy its inbound webhook URL.
Keep the webhook URL private. You will store it as a HubSpot secret.
2. Create the HubSpot workflow
Complete this section in HubSpot → Automation → Workflows.
A. Create the workflow
Select Create workflow → From scratch.
Select Skip trigger and choose eligible records.
Choose the HubSpot record type.
Select Save and continue.
Name the workflow
Sync [record type] to Lightfield.
B. Set the enrollment trigger
Select When an event occurs.
Add Object created.
Add one Property value changed event for each property you are syncing.
Under AND only enroll records that also meet these filters, define which records may sync.
Select Yes, re-enroll every time the trigger occurs.
Save the trigger.
HubSpot joins the events with OR and requires a refinement filter for Object created.
3. Add the Custom code action
A. Add the secret and properties
Select + in the workflow.
Select Custom code.
Keep Node.js as the language.
Add a secret:
Name:
LIGHTFIELD_WEBHOOK_URLValue: the Lightfield webhook URL
Under Properties to include in code, add only the properties you want to sync.
Set each Property name to the HubSpot property's internal name.
Common HubSpot property names
Company:
name,domain,industryContact:
firstname,lastname,email,phoneDeal:
dealname,amount,dealstage
B. Add the code
📋 Copy the JavaScript
const axios = require("axios"); exports.main = async (event, callback) => { if (!process.env.LIGHTFIELD_WEBHOOK_URL) { throw new Error("LIGHTFIELD_WEBHOOK_URL is missing."); } await axios.post( process.env.LIGHTFIELD_WEBHOOK_URL, { source: "hubspot", object: { type: String(event.object.objectType), id: String(event.object.objectId), properties: event.inputFields } }, { headers: { "Content-Type": "application/json" }, timeout: 15000 } ); callback({ outputFields: {} }); };
Save the action.
4. Test and turn on the sync
Open the Custom code action.
Select Test action.
Choose the test record and run the test.
In Lightfield, confirm the record type, copied fields, and HubSpot ID.
Change one synced HubSpot property.
Run Test action again.
Confirm that Lightfield updates the same record without creating a duplicate.
Turn on the HubSpot workflow.
Create or update one non-test record and confirm that it syncs.
Existing HubSpot records
Event triggers only capture events after the workflow is turned on. To sync older records, manually enroll them. Start with a small group.
The sync is ready when: one test record was created once, updated once, and one non-test record synced successfully.
Final check
[ ] The tracking field is writable Text.
[ ] The Lightfield automation is active.
[ ] Both tests used the same HubSpot record ID.
[ ] The second test updated the first Lightfield record.
[ ] HubSpot re-enrollment is enabled.
[ ] The webhook URL is stored as a HubSpot secret.
[ ] One non-test record synced successfully.
Something went wrong
Problem | Fix |
|---|---|
No Lightfield run | Confirm the automation is active and the HubSpot secret contains its current webhook URL. |
HubSpot does not run after an edit | Add the missing Property value changed event or enable re-enrollment. |
A duplicate appears | Turn off the HubSpot workflow. Ask the Lightfield agent to inspect the tracking-field rule. |
A field is missing | Confirm that it is included in the Custom code action and the Lightfield mapping. |
Existing records did not sync | Manually enroll them. Event triggers do not include earlier events. |
If a duplicate appears or the wrong record changes: turn off the HubSpot workflow before testing again.