Skip to content

Custom code action pulls usage API data into risk score property

One of 565 written HubSpot workflow specs, by a collective of independent HubSpot consultants.

Professional

Seat pricing: Professional edition. To build it, a GTM Seat or an Ops Seat (an Ops Seat cannot create marketing emails or sequences). Per-hub plans: Data Hub Professional.

Company6 stepsUpdated for HubSpot seat pricing
OutcomeEvery customer account gets a fresh usage-based risk score pulled directly from the product's usage API on a recurring schedule, instead of depending on a separate integration tool to sync that data into HubSpot first.
Workflow maprenewal-expansion-044
Scheduled daily run: Customer accounts with External Account ID leads to Custom code: call usage API, compute risk score. Custom code: call usage API, compute risk score leads to Call succeeded?. Call succeeded? leads to Yes: Set Usage Risk Score and Usage Last Synced At; No: Notify operations owner: pull failed. Yes No Scheduled daily run: Customer accounts with External Account ID Custom code: call usage API, compute risk score Call succeeded? Set Usage Risk Score and Usage Last Synced At Notify operations owner: pull failed
Scheduled daily run: Customer accounts with External Account ID leads to Custom code: call usage API, compute risk score. Custom code: call usage API, compute risk score leads to Call succeeded?. Call succeeded? leads to Yes: Set Usage Risk Score and Usage Last Synced At; No: Notify operations owner: pull failed. Yes No Scheduled daily run: Customer accounts with External Account ID Custom code: call usage API, compute risk score Call succeeded? Set Usage Risk Score and Usage Last Synced At Notify operations owner: pull failed

When to use it, when not to

Use it

  • Use it when the product's usage data lives behind an API the team already has credentials for, and no dedicated sync integration exists (or is worth building) to bring that data into HubSpot as a standing property.
  • Use it as a lighter-weight alternative to a full third-party integration, for a portal that only needs one or two usage-derived numbers rather than a complete two-way sync.
Read more on when to use itShow less

Skip it

  • Do not use it if a proper native integration or iPaaS connector (a dedicated app, or Zapier/Make) already keeps usage properties current; a custom coded action calling the same API on a schedule duplicates that work and adds a second point of failure.
  • Do not use it for real-time usage alerting; a scheduled pull is only as fresh as its run interval, typically daily at best for this pattern, not instant.
Read more on when to skip itShow less

The rest of this spec

Prerequisites · 5 items

Every property with its label, internal name, type and options, plus the assets the workflow needs.

Enrollment · 4 parts

The trigger, the criteria as ticked in the UI, the re-enrollment rule and the suppression list.

Steps · 6 numbered actions

Each action in order with its parameters, branches and delays.

Known pitfalls · 5

Traps seen in production, each with what breaks and what to do instead.

Test plan and UAT script · 3 cases, 3 variants

How to prove it works in a test portal, one case per branch, and a sign-off sheet.

Files · PDF, Markdown, JSON, CSV, code

The properties JSON creates the fields in one call. The workflow JSON documents the build. The custom coded action ships as a ready-to-paste .js file.

Install · 1 click, switched off

The installer creates the properties and the workflow, switched off, then opens a task for what it cannot create. Nothing is deleted, enabled or enrolled.

Unlock all 565 specs, 149 EUR

One-time, excl. VAT. 30-day refund. Installs in 3 portals. Founding price until 30 November.

Read the free Renewal and expansion spec

Read 12 complete specs before you pay.

One per category, same format as the paid ones. Email only, no card.

We email the link, then a short note when specs change. Nothing else.

149 EUR199

Full library, 565 specs
Get the full library