HubSpot Development Insights by Studio Nope

Custom-Coded Workflow Actions in HubSpot: When to Write Code, When to Let Breeze Do It

Written by StudioNope | Jul 2, 2026 6:11:08 PM

You open a HubSpot workflow, you need it to do something the standard actions cannot express, and until recently that meant one of two things: bend the built-in actions into a shape they were never meant to hold, or write a custom code action yourself. As of May 2026 there is a third option. You describe the action in plain language and Breeze writes the code for you.

That changes the question. It used to be "can I build this?" Now it is "should I write this myself, let Breeze draft it, or not reach for code at all?" We build and debug this kind of automation for a living, so here is the honest version: where each option wins, what the generated code gets right, and the parts that still bite you if nobody reads them.

The Three Ways to Run Logic in a Workflow

Before you reach for code, it helps to see the whole ladder. There are three places your logic can live, and most of the time the right answer is the first one.

  1. No-code actions. Set a property, create a task, branch on a value, send an internal email. If a standard action already does the job, use it. It is readable by whoever inherits the portal after you, and it never times out.
  2. Custom code actions. A JavaScript or Python action you drop in when the standard actions cannot express the logic: calling an external API, doing math across several properties, or formatting data in a way the built-in formatter will not.
  3. Breeze-generated code. The same custom code action, except Breeze writes the first draft from your description. You still land in the normal code editor, and you still own what runs.

Most workflows should live at level one. Code is for the cases where a branch and a "set property" genuinely cannot get you there. That is true whether you write the code or Breeze does.

What a Custom Code Action Actually Is

This is the part most workflow tutorials skip, and it is the part that decides whether your action works at 9am on a Monday when 400 records enroll at once. A custom code action requires a Data Hub Professional or Enterprise subscription (the hub formerly called Operations Hub). Inside one, here is what you are working with:

  • Languages: JavaScript on the Node.js runtime, or Python (currently in beta).
  • Timeout: the action has to finish within 20 seconds. Every external API call you make eats into that budget.
  • Memory: 128 MB.
  • Inputs: up to 50 properties passed into the action.
  • Outputs: string output values cap at 65,000 characters.
  • Secrets: stored as environment variables (process.env.TOKEN in Node, os.getenv() in Python), with a combined limit of 1,000 characters across all of them. Enough for a couple of tokens, not a phone book.
  • Libraries: a curated set, including @hubspot/api-client and axios in Node, requests in Python. You cannot install anything you like.
  • Retries: if your code throws on a rate limit or a 5xx, HubSpot retries for up to three days, starting one minute after the failure and backing off to a maximum eight-hour gap.

None of these are dealbreakers. They are guardrails, and they explain most of the "it worked in testing and broke in production" stories. An action that calls three external endpoints in sequence is fine for one record and blows past 20 seconds the moment the API is slow.

What Breeze Does Now, and What It Does Not

The May 2026 update let Breeze Assistant build a complete workflow from a description, and, for Data Hub Professional and Enterprise, generate a custom code action when no standard action fits. You describe the behavior, tell it which properties are inputs and what you expect back, and it writes the action. JavaScript is the default. You review it in the standard code editor before anything saves, and any workflow Breeze creates stays turned off until you manually enable it.

That last detail is the whole safety model. Breeze drafts, you approve. It does not quietly push logic into production.

It is also worth knowing what it will not touch. Breeze Assistant cannot set your enrollment triggers, add a delay-until-an-event, insert a format-data step, or build AND/OR branch logic for you. So it is a fast way to get one action written, not a way to have the whole automation designed for you. You still own the shape of the workflow.

A Worked Example: Scoring a Deal

Say you want to score a deal when it enrolls. You describe it to Breeze, and it produces something close to this:

const hubspot = require('@hubspot/api-client');

exports.main = async (event, callback) => {
  const amount = parseFloat(event.inputFields['amount']) || 0;
  const stage  = event.inputFields['dealstage'] || '';
  const source = event.inputFields['deal_source'] || '';

  let score = 0;
  if (amount > 50000) score += 40;
  else if (amount > 10000) score += 20;
  if (source === 'referral') score += 30;
  if (stage === 'qualifiedtobuy') score += 15;

  callback({
    outputFields: {
      deal_score: score,
      priority: score >= 60 ? 'high' : 'normal'
    }
  });
};

That is genuinely useful, and it is correct. But notice what you have to check before you trust it:

  • The null cases. parseFloat(undefined) returns NaN, which is why the || 0 matters. Generated code usually handles this. Verify that it did, because a single NaN silently poisons every branch downstream.
  • Where the thresholds came from. Breeze guessed 50000 and referral. Those are business rules, not code details. Only you know if they are right.
  • What happens on the 401st record. This example makes no API calls, so it is safe at volume. The moment an action fetches from an external service, re-read the timeout and retry notes above.

This is the same lesson as our take on using AI to write code without shipping something generic: the model gets you to a working first draft fast, and the value you add is reading it.

The Honest Decision Guide

  • Use a no-code action when a standard action or a branch can do it. Do not write code to feel clever. The next person to open this portal will thank you.
  • Let Breeze write the code when the logic is real but bounded: scoring, reformatting, a single well-behaved API call. It gets you a correct first draft fast, and you keep the review step.
  • Write it yourself when the action touches money, provisions access, hits a flaky third-party API, or loops over related records where the 20-second timeout is a live risk. These are the cases where reading every line matters more than saving ten minutes.
  • Do not use code at all when you are tempted to rebuild a delay, a filter, or AND/OR logic in JavaScript. HubSpot already does those, and its versions do not time out.

The Five Things That Actually Break

  1. Silent nulls. A missing property becomes undefined, your math becomes NaN, and nothing errors. It just routes wrong. Guard every input.
  2. The 20-second wall. Sequential external calls are the usual culprit. Batch them, cache what you can, or split the work across separate actions.
  3. Secrets and rate limits. Keep tokens in secrets, never hardcoded, and back off on 429 responses instead of hammering the API. A tight loop over associated or related records is the usual way to trip HubSpot's rate limits from inside an action.
  4. Thresholds you did not choose. Generated code invents reasonable-looking numbers. Reasonable is not the same as correct for your pipeline. Read every constant.
  5. Retries on actions that are not safe to repeat. HubSpot re-runs a failed action for up to three days. If your code charges a card or sends an email, make it safe to run twice, or it will fire twice.

Where This Leaves You

Breeze writing workflow code is a real shortcut, not a replacement for judgement. It collapses the "how do I write this" step and leaves the two steps that actually matter: deciding whether code belongs here at all, and reading what runs before it touches a live record. Treat the generated action the way you would treat a pull request from a fast junior developer. Quick, capable, and worth reviewing every time.

If your portal has a drawer full of workflows nobody remembers writing, half of them firing on records they should not, that is exactly the kind of thing we untangle. Take a look at how we work at Studio Nope, or read our quick checks that tell you if a HubSpot portal is in trouble.