Custom Code Action: Enriched UK vehicle registration payload from regchecker.co.uk failing to update

Hello HubSpot Community,

We are currently setting up an automated workflow inside HubSpot Operations Hub for a UK fleet management client. The goal is to automatically enrich Deal and Contact records with live vehicle data from our API endpoint (regchecker. co. uk) whenever a deal stage changes.

Integration Architecture:

  • Data Source: (regchecker.co.uk)

  • Workflow Mechanism: Operations Hub Custom Code Action (Node.js) triggering a GET request to fetch vehicle MOT status and tax expiration dates (?vrn=...).

  • Target Destination: Custom Deal Properties in HubSpot CRM.

Issue / Technical Query:

  1. JSON Payload Mapping Error: When the node-fetch request executes inside the HubSpot Custom Code block, nested JSON arrays (specifically MOT advisory history logs from regchecker.co.uk) cause an asynchronous timeout before the exports.main callback resolves.

  2. API Rate Limit Handling: What is the best pattern to handle HTTP 429 retry headers within HubSpot’s 20-second execution window for Custom Code Actions?

Troubleshooting Steps Taken:

  • Verified that raw endpoint responses return valid JSON (HTTP 200) within 350ms in Postman.

  • Sanitized special characters and spaces from registration plate input fields.

  • Wrapped the async request inside a standard try/catch block within the HubSpot code editor.

Has anyone experienced execution timeout issues when parsing multi-nested JSON arrays inside Operations Hub Custom Code actions? Any advice on optimizing callback promises would be greatly appreciated!

Thanks in advance!

We’ve encountered this type of issue before. Although I’m pretty sure a workaround could be devised within the workflow, we decided to use a more robust middleware solution (Workato) as a workaround - other factors drove that decision.