Playbook ยท CRM operations
Extending HubSpot workflows with custom code
Builds four HubSpot workflows that use webhook triggers and custom code actions to reach external data that standard actions cannot, covering territory routing, ICP tagging from enrichment, signal-triggered sequence enrolment and deal updates from Slack.
Your HubSpot workflows are full of workaround properties because the logic depends on spreadsheets, webhooks or other systems.
Tools in this playbook
The workflow
How it works
- 01
Set up the Private App
We set up one Private App per environment with contact and deal read and write, owners read, sales-email-read, contact schema read and timeline scopes, and store its token as a workflow secret for the custom code actions. Missing scopes fail silently.
- 02
Territory routing
On new contacts with lifecycle Lead and a source present, a custom code action looks up the zip or state in an Airtable territory map and sets hubspot_owner_id, rotating to an owner when the territory is unmapped. The workflow then stamps a routing-source property and notifies the rep in Slack, and we build this one first.
- 03
ICP tagging from enrichment
Clay writes headcount, industry, funding and tech stack to the record, and a workflow triggered on those properties assigns tier and score with if/then branches, or a custom code action for the score. Both are written with a timestamp to the contact or deal.
- 04
Signal-based enrolment
A workflow triggered by a G2 or product-usage webhook matches the contact and continues only if it is not in a sequence, its stage is Lead or MQL and its last enrolment was over 14 days ago. It then enrols the contact through a custom code call to the Sequences API and logs a timeline event.
- 05
Slack deal feedback
A four-field Slack form, with competitor as a dropdown, posts the deal ID to a webhook-triggered deal workflow, which updates next step, competitor and confidence and adds a note through a custom code action.
Run this playbook in your systems
We build it into your stack and run it for you. Start with a free strategy call.