Use custom code actions in workflows (BETA)

Last updated: October 13, 2020

In Beta

In workflows, you can use the Custom code action to write and execute JavaScript in your workflow. With custom code actions, you can extend workflow functionality within and outside of HubSpot.

Custom code actions support JavaScript using the Node 12.x runtime framework. When the action executes, the runtime compute is managed through a serverless function by HubSpot and AWS Lambda.

To add a custom code action to your workflow:

  • In your HubSpot account, navigate to Automation > Workflows.
  • Click the name of a workflow, or create a new workflow
  • Click the plus icon + to add a workflow action.
  • In the right panel, select Custom code

  • To use a secret in your custom code, click the Secrets dropdown menu, then select an existing secret, or add a new secret:
    • To add a new secret, click Add secret.
    • In the dialog box, enter the Secret name and Secret value.
    • Click Save. You can now select this secret in future custom code actions.
  • In the code field, enter your JavaScript. 
  • Click Save.

Supported libraries

The Custom code action supports the following JavaScript libraries and versions: