Skip to content

What can custom coded actions do in HubSpot workflows?

80 specsNeeds Professional or higher (per-hub plans: Data Hub, formerly Operations Hub)19 need Enterprise20 also need Marketing Hub Professional on per-hub plans

Short answer

A custom coded action runs your own JavaScript inside a workflow, which lets it do four things no native action does: ... call an API, ... read the records associated to the enrolled one, do arithmetic between two properties, and aggregate many records into one message. It needs Data Hub Professional, now called Data Hub Professional. Each run is per enrolled record, inside a 20 second window, and any secret it uses is readable by anyone who can edit the workflow.

Read the whole answerShow less

What a spec looks like

Free Required field enforcement on contact creation (email or phone missing) Contact9 steps Read it in full
The nine sections, and the files

Every spec follows the same nine sections, so a team reads one and knows how to read all of them.

  • Outcome, when to use it and when not to
  • Prerequisites: properties, lists, tiers, with the JSON to create them
  • Enrollment and re-enrollment, then every step with its parameters
  • Known pitfalls, a test plan, variants, and the YAML build spec

PDF, Markdown, properties JSON, workflow JSON, custom code where used. Test plan and known pitfalls in every spec.

Each spec states its minimum tier. The 12 free ones open in full, the others show their public preview.

The 80 specs, in build order

Data transformation and formatting

Lookup tables and string cleanup that turn free text into one standard value the rest of the portal can filter on.

What each spec doesHide
Show the 12 other specs in this groupShow fewer
Placeholder and junk value flag in name fields (test, n/a, asdf)Contact6 stepsContacts carrying obvious placeholder or junk values in their name fields ("test", "n/a", "asdf") get flagged for cleanup instead of showing up in sales collateral, exports, or reports as if they were real names.Per-hub plans: also Marketing Hub ProfessionalJob title standardization via lookup mappingContact7 stepsJob titles entered as free text ("VP Sales", "Vice President of Sales", "Sales VP") collapse into one standard title, so persona-based segmentation and lead scoring can filter on job title reliably.Per-hub plans: also Marketing Hub ProfessionalIndustry field standardization to a fixed picklistCompany7 stepsIndustry values imported as free text or as slightly different phrasing all collapse into one of your portal's standard industry options, so segmentation and reporting by industry are not silently split across near-duplicate values.Per-hub plans: also Marketing Hub ProfessionalAddress field standardization (street abbreviations, casing)Contact2 stepsStreet addresses land in one consistent format, title case with standard abbreviations for street, avenue, suite, and similar terms, so mailing labels, exports, and address-based matching all read the same value.LinkedIn and social URL cleanup and format enforcementContact5 stepsLinkedIn profile URLs land in one clean, consistent format with tracking parameters stripped, and anything that is not a real LinkedIn profile URL gets flagged instead of silently sitting there unusable.Currency normalization on deal amount to a home-currency propertyDeal4 stepsEvery deal carries an amount expressed in your home currency, so pipeline totals and forecasts add up correctly across deals booked in different currencies.Custom code email typo detection (common domain misspellings)Contact6 stepsContacts with a likely misspelled email domain, such as "gmial.com" or "yahooo.com", get flagged with a suggested correction, instead of bouncing silently on the first send and never being noticed until a campaign report shows a dead address.Cross-field consistency check: phone country code vs. address countryContact6 stepsContacts whose phone number's country calling code clearly disagrees with their stated address country are flagged for a look, catching mismatched or copy-pasted contact records before a call goes to the wrong country's sales rep or time zone.Pre-import dedupe key check via form hidden fieldContact2 stepsEvery contact carries one normalized dedupe key computed automatically at submission, so a later import or integration can match against it reliably instead of each process separately trying to normalize email casing and formatting itself.Territory-country mismatch flag (phone or address vs. assigned territory)Contact6 stepsContacts whose phone country code or address country falls outside the countries actually covered by their assigned sales territory get flagged before a rep spends time on a lead routed to the wrong region.Per-hub plans: also Marketing Hub ProfessionalCustom object property normalization (picklist mapping from free text)Custom5 stepsData Hub EnterpriseA free-text field on a custom object that different people or import sources fill in inconsistently gets mapped to a small, standard set of categories automatically, the same lookup-table pattern used for standard-object fields in data-quality-014, applied here to a custom object.EnterpriseCampaign UTM format validation and marketing ops notificationContact4 stepsMalformed UTM parameters on a new contact's tracked fields get flagged to marketing ops within a day, instead of surfacing three months later as a "why does this campaign report look wrong" investigation.

Cross-object lookups and associations

Code that searches the CRM, reads the records associated to the enrolled one, and writes or flags the link.

What each spec doesHide
Show the 21 other specs in this groupShow fewer
Duplicate ticket detection (same contact, same subject, short window)Ticket7 stepsTickets that look like a repeat submission from the same contact on the same topic within a short window are flagged for a merge decision, instead of splitting one issue across two open tickets worked by two agents.Per-hub plans: also Marketing Hub ProfessionalAssociation hygiene: prevent duplicate association labels on the same record pairDeal6 stepsDeals that end up associated to the same contact under a repeated or conflicting association label get flagged for cleanup, instead of quietly confusing reports that count associations by label.Per-hub plans: also Marketing Hub ProfessionalCustom object association hygiene (child record must link to parent)Custom5 stepsData Hub EnterpriseChild custom object records created without a link to their parent get flagged immediately, instead of orphaned records piling up that nobody can trace back to where they belong.EnterpriseDuplicate company detection by name-similarity fallbackCompany6 stepsCompanies with different domains but near-identical names get flagged for review, catching the duplicate pairs that domain-based matching cannot see.Per-hub plans: also Marketing Hub ProfessionalCustom code validation of deal amount against line item totalDeal7 stepsA deal whose amount field disagrees with the sum of its actual line items gets flagged before it reaches a forecast or a quote, instead of a stale, manually-typed amount quietly overstating or understating what the deal is really worth.Per-hub plans: also Marketing Hub ProfessionalAssociation count cap per company (portfolio hygiene flag)Company7 stepsCompanies that have accumulated an unusually large number of associated contacts get flagged for a portfolio review, catching runaway association growth, a shared catch-all company absorbing every unrelated inbound lead for example, before it distorts account-level reporting.Per-hub plans: also Marketing Hub ProfessionalSet the product plan on contacts from paid line items (payments and invoices)Contact7 stepsEvery paying contact carries the plan they actually bought and the date it started, read from the line items behind their payment or invoice, so segmentation and onboarding stop relying on a rep remembering to set the field by hand.Onboarding owner reassignment audit trailDeal4 stepsEvery time the onboarding owner on a deal changes, a timestamped note is logged on the deal showing who it moved from and to, so ownership history survives even after several handoffs.Cross-pipeline deal count cap per company (portfolio hygiene)Deal6 stepsA company sitting above an agreed number of simultaneously open deals, counted across every pipeline, gets flagged with the exact count, so sales ops can catch portfolio sprawl a single-pipeline view would never surface.Multi-touch attribution property update on each new session sourceContact5 stepsMarketing Hub EnterpriseEvery new traffic source a contact arrives through gets logged as its own touchpoint record, so marketing ops can see the full path a contact took, not just HubSpot's default first-touch and last-touch properties.EnterpriseCampaign ROI property rollup from associated dealsDeal4 stepsMarketing Hub EnterpriseEvery deal associated with the same marketing campaign gets a shared, always-current revenue rollup written onto it, so campaign performance can be filtered and reported on outside the Campaigns tool, in any list, report, or workflow that reads deal properties.EnterpriseCustom object campaign/event attribution rollup to contactCustom5 stepsMarketing Hub EnterpriseContacts show which HubSpot campaigns actually touched them and how many times, directly on the record, without anyone cross-referencing engagements against the Campaigns tool by hand.EnterpriseFranchise/location-based campaign attribution via custom objectCustom5 stepsMarketing Hub EnterpriseA franchise or multi-location brand can see which physical location's campaign actually drove a given contact, instead of every lead looking like it came from one shared brand campaign.EnterpriseSubscription custom object synced with renewal deal dateCustom4 stepsSales Hub EnterpriseEach product a customer subscribes to has its own Subscriptions record with an end date that stays synced to whatever renewal deal covers it, so an account with several products no longer depends on a single company-level date that can only describe one contract at a time.EnterpriseUsage data custom object triggers property-change workflowCustom5 stepsData Hub EnterpriseEvery raw usage event landed on a dedicated custom object rolls up automatically into the company's running usage total, instead of someone manually summing event records before a renewal or health-score review.EnterpriseTerritory-based renewal deal reassignment on account transferDeal6 stepsSales Hub EnterpriseWhen an account is transferred to a new sales territory, every one of its open renewal deals moves to that territory's designated owner automatically, instead of a rep quietly keeping deals from an account that no longer belongs to their patch.EnterpriseCreate or update a territory custom object record when an account is assigned to a territoryCustom4 stepsSales Hub EnterpriseEvery distinct territory value used on companies gets exactly one Territories record with a running account count, instead of sales ops keeping a separate spreadsheet of who owns which patch.EnterpriseAuto-attach the call recording link to the AE handoff task after a qualifying callContact5 stepsThe AE handoff task lands with a direct link to the call recording already in it, so the AE can listen before the first outreach instead of asking the SDR to dig up the link.Surface a competitive battlecard task when a competitor name is logged in a deal noteDeal5 stepsSales Hub EnterpriseThe moment a rep logs a note mentioning a known competitor, they get a task with a direct link to that competitor's battlecard, instead of digging through a shared drive mid-deal.EnterprisePrevent SLA clock reset on an internal note versus a genuine customer replyTicket6 stepsA ticket status change to "Waiting on contact" only counts as a real response when an actual outbound reply went to the customer, so a custom SLA-adjacent timestamp never gets stamped off the back of an internal note alone.Per-hub plans: also Marketing Hub ProfessionalDuplicate-ticket flag for repeat tickets from the same contact within a time windowTicket7 stepsA ticket that is really the same issue as one the same contact just opened gets flagged and linked at intake, so reps stop working two threads for one problem.Per-hub plans: also Marketing Hub Professional

External APIs and webhooks

Outbound calls to a product API, a vendor or a chat tool, with the secret, the timeout and the failure path handled.

What each spec doesHide
Show the 4 other specs in this groupShow fewer

Scheduling and date math

Scheduled runs that compute an elapsed time, sweep a database on a cadence, or aggregate a week into one message.

What each spec doesHide
Show the 15 other specs in this groupShow fewer
List hygiene: unused/stale list archive notificationContact6 stepsMarketing ops gets a periodic report of active and static lists nobody has touched in months, instead of discovering a portal cluttered with hundreds of dead lists during an unrelated audit.Monthly consent-status change compliance export/reportContact6 stepsMarketing ops gets one monthly summary of every consent-status change in the portal, ready to hand to legal or compliance without manually exporting contact history.Scheduled bulk campaign association backfill for historical contactsContact6 stepsHistorical contacts that were never formally associated with the HubSpot campaign they actually came from get associated in bulk, so campaign-level reporting stops silently excluding pre-automation-era leads.Co-term alignment workflow for multi-subsidiary renewal datesCompany4 stepsSales Hub EnterpriseWhen a parent account's contract end date changes, every subsidiary account under it gets its own contract end date aligned to match, so a multi-entity customer renews on one date instead of subsidiaries drifting onto separate cycles.EnterpriseWeekly Slack roundup: deals closed won this week (team wins digest)Deal1 stepOnce a week, the sales channel gets one Slack message listing every deal closed won that week with the total revenue, instead of scrolling through individual real-time alerts.Disabled workflow inventory and owner nudge (automation hygiene)Contact1 stepOnce a month, an admin gets a message listing every disabled workflow in the portal, so forgotten or paused automation gets reviewed instead of sitting disabled indefinitely.Duplicate trigger detection across workflows (automation hygiene)Contact1 stepOnce a month, an admin gets a report of workflows that enroll on the same object type with the same trigger property and condition, so overlapping automation gets reviewed before two workflows fight over the same record.Weekly Slack digest: ticket volume and CSAT average to service channelTicket1 stepOnce a week, the service channel gets one Slack message showing how many tickets were created, how many were closed, and the average CSAT score for the week, instead of pulling those numbers by hand from separate reports.Weekly sales activity summary: calls, emails, meetings logged per repDeal1 stepOnce a week, sales management gets one message breaking down calls, emails, and meetings logged per rep, so activity coaching conversations start from a shared number instead of a guess.Monthly digest: lifecycle stage funnel movement summary (count per transition)Contact1 stepOnce a month, an admin gets a message showing how many contacts moved from each lifecycle stage to each other stage that month, so funnel movement is visible as transitions, not just stage totals.Weekly digest: workflow enrollment and error summary for admins (automation health)Contact1 stepData Hub EnterpriseOnce a week, the admin team gets one Slack message listing which workflows had errors in the past week, so a broken action gets caught during a routine check instead of only when someone complains a record was missed.EnterpriseCustom object record digest: weekly summary of new custom-object recordsCustom1 stepData Hub EnterpriseOnce a week, the owning team gets a Slack message listing every new record created on a given custom object that week, so activity on a custom object is visible without opening its record list in the CRM.EnterpriseWeekly SDR activity digest (calls and emails logged) sent to the sales managerContact3 stepsThe sales manager gets one weekly email listing calls and emails logged per SDR, without opening a report or asking each rep for a number.Daily task digest email to each rep listing due and overdue tasksContact4 stepsEach rep gets one morning email listing their due-today and overdue tasks, instead of opening the Tasks tool and filtering it themselves every day.Weekly SDR leaderboard digest (top performers by activity) sent to the teamContact5 stepsThe whole SDR team gets a weekly ranked view of who logged the most calls and emails, building visible momentum without anyone manually pulling a report and formatting it.

Scoring and calculations

Weighted scores, counters, currency and commission math, and alerts that compare today against a rolling baseline.

What each spec doesHide
Show the 8 other specs in this groupShow fewer
Account-level marketing contact tier cost alert (approaching plan limit)Contact6 stepsMarketing ops and finance get a projected extra cost estimate, in currency, days before the next billing date, if the current marketing contact growth trend would push the account into an overage tier, instead of only ever seeing a plain contact count.Churn risk score from usage decline and support ticket volumeCompany11 stepsEvery account gets a numeric churn risk score, recalculated whenever usage or ticket data changes, so CS and sales can prioritize outreach by risk instead of by gut feel.Per-hub plans: also Marketing Hub ProfessionalTicket reopen counter property (recidivism tracking for reporting)Ticket4 stepsEvery ticket carries an accurate count of how many times it has been reopened, giving the service team a reporting property to spot recurring-issue tickets instead of reading the timeline by hand.Anomaly alert: daily form submission volume drop vs 7-day averageContact1 stepEach day, an admin gets a Slack alert only when that day's form submission volume drops well below the trailing 7-day average, so a broken form or a tracking outage gets caught the same day instead of at month end.Anomaly alert: email bounce rate spike after a sendContact3 stepsShortly after each marketing email send, an admin gets a Slack alert only if that send's bounce rate is well above the portal's recent historical average, so a bad list segment or a deliverability problem is caught within hours, not at the next monthly review.Create a commission calculation record on a custom object when a deal is closed wonDeal4 stepsSales Hub EnterpriseEvery closed-won deal produces exactly one commission record with the amount, rate, and calculated payout captured at close, instead of a spreadsheet someone rebuilds every payroll cycle.EnterpriseCreate a commission dispute / adjustment record on the commission custom objectCustom5 stepsSales Hub EnterpriseA disputed commission gets its own auditable adjustment record with the corrected amount and a stated reason, instead of someone editing the original number and losing the history of what changed.EnterpriseCreate a commission split record for co-selling deals with two ownersCustom4 stepsSales Hub EnterpriseA co-sold deal produces two linked commission records, one per rep, split by an agreed percentage, instead of one rep's commission record covering the whole deal and a manual conversation to sort out the split afterward.Enterprise

The 3 things that break this, and how the specs stop them

A workflow secret is readable by everyone who can edit the workflow

Storing an API key as a workflow secret keeps it out of the visible action configuration, but it does not hide it from your colleagues.

Check in Settings who can view and edit workflow secrets, and keep that list as narrow as the credential deserves. Rotating a key on the vendor side breaks every future run, with no retry of the calls that already failed.

How the specs stop itShow less

A 200 response is not proof the payload landed

An endpoint that returns 200 and then rejects the payload in its own response body shows up as a success unless the code reads the body too, not just the status.

The same trap sits inside the CRM: a failed fetch that returns an empty list reads as a real zero. Every spec here outputs a distinct error code instead, so a failure shows as a failure in workflow history.

How the specs stop itShow less

Rate limits pause the action and everything after it

A coded action runs per enrolled record, in 20 seconds, in 128 MB, and you set a rate limit per action.

Hit that limit and the action pauses, along with every step that follows it. The CRM Search API called from inside the code is throttled separately, so a bulk import can starve a detection workflow that works fine at normal volume.

How the specs stop itShow less

What this bundle builds

Eighty specs that all share one thing: a step where the native action list runs out and you write code instead. They come from the four jobs that keep hitting that wall. Turning free text into one standard value, because a lookup table of country spellings cannot live in a branch. Reading the records associated to the enrolled one, because a deal cannot see its own line items. Talking to something outside the portal, because there is no native action for your product API. And doing arithmetic, because a workflow branch compares two properties but never subtracts one from the other.

This suits an in-house operations owner who already has Data Hub and is not sure what it actually buys them, and an agency that keeps rewriting the same domain matching code on every portal. The five components map to the five shapes that code takes in a workflow: transformation and formatting, cross-object lookups and associations, external APIs and webhooks, scheduling and date math, then scoring and calculations. Every spec names its secrets, its input fields and its output fields before the first line of code.

Read the restShow less
How the pieces fit together

Start with the formatting specs. They need no token, no secret and no API call, so you can build one in twenty minutes and see the pattern: inputs in, lookup table, output fields, error branch. That build teaches you the shape of every other spec in the pack.

Cross-object work comes next, because it adds the first dependency: a private app token with read access on the objects you search. Company association from email domain is the one to build first, since duplicate detection, the line item check and the association caps all reuse its search and its free-mail exclusion list.

External calls come third, once you have somewhere safe to keep a secret and a convention for failure. Scheduling sits fourth: it reuses the earlier code but multiplies the execution count, which is where rate limits start to bite. Scoring comes last because a score is only as honest as the properties feeding it, and those properties are what the first three components clean up.

What you get
  • 80 specs, each with outcome, prerequisites, enrollment, steps, known pitfalls, a test plan and variants
  • Each spec ships as PDF and Markdown
  • Properties JSON, 125 properties across contacts, companies, deals, tickets, products and nine custom objects
  • Workflow JSON for all 80, in Automation API format, switched off on import
  • 80 custom coded actions as JavaScript files, each with its inputs, outputs and secrets named in the header
  • A test plan per spec, including the forced-failure step that proves the error path works
  • Install in one click for Full and Agency buyers
Who it is for, and who should skip it

Buy this if your portal already has Data Hub Professional or Enterprise and the licence is underused, or if you build on client portals and keep rewriting the same normalization and matching code. You get value in the first hour from the formatting specs alone.

Skip it if you do not have Data Hub. Nothing here runs without the custom code action, and buying it to find out is an expensive way to read a tier table. Take the native-only bundle instead. Skip it too if you want one specific outcome rather than a toolkit: a single bundle, or the full library, will fit better than eighty specs you did not ask for.

Questions admins ask

Do I need Data Hub Professional to use a custom code action?

Yes. The custom code action is gated to Data Hub Professional or Enterprise, now named Data Hub. Every spec in this pack uses one, so Starter and plain Professional portals of the other hubs cannot build them as written. Several specs carry a documented no-code alternative in their Variants section, and the native-only bundle collects 40 specs that need no code at all.

How many custom code executions do I get per month?

The specs in this pack disagree on this point and say so openly. The limits that are documented and that you can see yourself are the 20 second runtime, the 128 MB memory ceiling, and the rate limit you configure per action. Treat any monthly allowance figure as something to confirm against your own subscription before you schedule a daily sweep across the full database.

What happens when my code throws an error?

Nothing silently succeeds. Each spec catches the error and returns a result code plus a truncated error message as output fields, so the run shows as a failed execution in the workflow History tab. The branch that follows reads that code and routes to a task or an alert instead of treating a missing value as a clean result.

Can a workflow loop over several records and send one message?

Not with native actions. A standard workflow enrolls and acts per record, so fifty closed deals produce fifty notifications. The weekly digest spec does the aggregation inside the code: it queries the search endpoint for the date range, sums the amounts, formats one string and posts it once. At volume the query needs pagination, not a single unpaginated call.

Where do I put an API key that the code needs?

In a workflow secret, referenced from the code as an environment variable, never pasted into the code body. Every spec here that calls something external names its secrets in the header comment of its code file, so you know what to create before you build. A missing secret fails the action immediately rather than sending an unauthenticated request.

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.

99 EUR129

This bundle
Get this bundle