Run Custom Code

Write JavaScript inside HubSpot workflows. Execute sandboxed JavaScript on any workflow enrollment with encrypted secrets, saved snippets, five inputs and five outputs. The escape hatch for every automation HubSpot cannot express natively.

Run Custom Code
What you get

Write JavaScript inside HubSpot workflows

  • Saved, versioned snippets or inline code
  • Encrypted secrets injected as secrets.KEY
  • axios, lodash, dayjs, crypto and form-data available
  • Console output captured for debugging
  • System snippet library with ready-made, clonable code
How it works

Operations inside this action

Pick an operation and the form shows only the fields that operation needs.

Run a saved snippet

Pick a snippet from your dashboard; version-controlled and reusable across workflows.

Run inline code

Paste JavaScript straight into the action for one-off logic.

Clone a system snippet

Start from a prebuilt snippet such as the PDF URL converter and customize your copy.

Use cases

What teams build with Run Custom Code

Convert a private PDF link into a public URL

The system snippet calls the HubSpot Files API for a signed URL and returns it as an output you can email or send onward.

filesintegrations

Score leads with your own model

Feed five properties in, compute a weighted score in code, write it back with a Copy property step.

sales opsscoring

Call an internal API with a signed JWT

Store the signing key as a secret, build the JWT in code with crypto, and post with axios.

integrationssecurity

Split full names, clean addresses, dedupe keys

Any string surgery HubSpot operators cannot do: regex, lookups, multi-step logic.

data cleanup
Browse every use case
FAQ

Run Custom Code questions

Everything teams ask before putting this action into production.

No. AuPerate adds a Run Custom Code action to any HubSpot account with workflows, starting at the Starter plan. You do not need Operations Hub Professional or Data Hub.
axios for HTTP, lodash for data manipulation, dayjs for dates, Node crypto for hashing and signing, and form-data for multipart uploads. Standard JavaScript built-ins such as JSON, Date, Math and RegExp are always available.
Add them as encrypted secrets in your AuPerate dashboard, then reference them in code as secrets.NAME. Secrets are encrypted with AES-256 at rest and never appear in logs or execution records.
Yes. Save it as a snippet and select it in any workflow with the Select Snippet dropdown. Editing the snippet updates every workflow that uses it.
Yes. The system snippet library ships twelve production-tested snippets, including converting a private HubSpot file URL into a public link, lead scoring, Slack notifications and currency conversion. Clone one and customize your copy.

Add Run Custom Code to your workflows today

Install AuPerate once and every action appears in your HubSpot workflow editor.

Get Started