Skip to content

Turbyn docs

Write JavaScript or Python that runs as a step inside your HubSpot workflows.

In this guide

Turbyn provides a Custom Code action for HubSpot workflows. You write the code here; HubSpot calls it as a workflow step and uses what it returns.

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 event object.
  • The ctx object. Secrets, key-value store, logging, and calling the HubSpot API.
  • Packages. How npm and pip dependencies work.
  • Error reference. Every error code and what causes it.

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
  └─ Custom Code step
       ├─ Saved action:  "enrich-company"     ← picked from a dropdown
       ├─ Inputs:        JSON object (HubSpot data tokens as string values)
       └─ Outputs:       Text / Number / Boolean / Options / Date / Phone, plus outputs JSON
                                │
                                ▼
                      Turbyn runs your code

HubSpot 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

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.