Turbyn docs
Turbyn provides a Run Code action for HubSpot workflows. You write the code here; HubSpot calls it as a workflow step and uses what it returns.
Start here
Section titled “Start here”- Quickstart. Connect a portal and get an action running end to end.
- Setup guide. Installing, configuring and disconnecting the app.
- Writing actions. The handler signature and the
eventobject. - The ctx object. The HubSpot client, secrets, key-value store and logging.
- Packages. How npm and pip dependencies work.
- Error reference. Every error code and what causes it.
How the pieces fit
Section titled “How the pieces fit”Your code lives in Turbyn. HubSpot’s workflow step holds a reference to it plus the inputs you map.
HubSpot workflow └─ Run Code step ├─ Saved action: "enrich-company" ← picked from a dropdown ├─ Field 1..5: mapped CRM properties or earlier step outputs └─ Outputs: output1..5, json, errorCode, errorMessage │ ▼ Turbyn runs your codeHubSpot has no code-editor field for third-party actions, which is why the code isn’t edited inside the workflow builder. The upside is that one saved action can be used by many workflows, and updating it doesn’t mean editing each step.
What runs where
Section titled “What runs where”When a record is enrolled, HubSpot posts the payload to Turbyn and Turbyn immediately tells HubSpot to pause the enrollment. Your code then runs with no 20-second constraint, and the workflow resumes when it finishes.
This is why long jobs work here and don’t in HubSpot’s native custom code action. The pause window is roughly a week, which is the practical outer limit for a single run.