๐ Documentation
Getting started
Install the app from the landing page, authorize with OAuth, and the two actions will appear in your workflow builder automatically.
Run Custom Code
Execute JavaScript code inside your HubSpot workflows. Map contact properties as input variables and return values for downstream branches.
Input fields
- Input variables (JSON) โ A JSON object mapping variable names to HubSpot property tokens:
{"email": "{{ contact.email }}"}. These become available asevent.inputFieldsinside your code. - JavaScript Code โ Define
exports.mainexactly like HubSpot's native Custom Code action. Access variables viaevent.inputFieldsand return outputs viacallback.
Example
// Input variables (JSON):
{ "email": "{{ contact.email }}", "name": "{{ contact.firstname }}" }
// JavaScript Code:
exports.main = async (event, callback) => {
const email = event.inputFields['email'] || '';
const domain = email.split('@')[1] || '';
const isPremium = String(domain === 'corp.com');
callback({
outputFields: {
out1: domain,
out2: isPremium
}
});
};
Available modules
Your code can require() the following modules:
- axios โ HTTP requests
- crypto, url, querystring, util, path, buffer โ Node.js built-ins
Outputs
Up to 10 outputs (out1โฆout10) plus an error field (empty string on success). Use them in workflow branches.
Limits
| Limit | Value |
|---|---|
| Timeout | 15 seconds |
| Memory | 128 MB |
| Max output size | 65,000 characters |
| Allowed modules | axios + Node.js built-ins (no fs, child_process, net) |
Send Webhook
Send HTTP requests to any URL from your workflows. Perfect for integrating with Zapier, Make, n8n, or any API.
Input fields
- URL โ The endpoint to send the request to.
- Method โ HTTP method (GET, POST, PUT, PATCH, DELETE).
- Headers (JSON) โ Optional HTTP headers as a JSON object.
- Body โ Request body (for POST/PUT/PATCH). Supports HubSpot property tokens.
Example
// URL:
https://hooks.zapier.com/hooks/catch/123456/abc123
// Method:
POST
// Headers:
{ "Content-Type": "application/json" }
// Body:
{
"email": "{{ contact.email }}",
"name": "{{ contact.firstname }}"
}
Outputs
statusCodeโ HTTP response status coderesponseBodyโ Response body as stringerrorโ Error message (empty on success)
Using outputs in branches
Method 1 โ Direct branch:
Use "One action output (value equals)" right after the
action.
[Run Custom Code] โ output: isPremium = "true"
โ
[Branch: isPremium]
โโโ "true" โ [Send VIP email]
โโโ "false" โ [Send standard email]
Method 2 โ Property + If/Then:
Save the output to a contact property first, then use it in
an If/Then branch for complex AND/OR logic.
[Run Custom Code] โ output: domain = "corp.com"
โ
[Set property: company_domain = domain]
โ
[If/Then: company_domain contains "corp.com" AND score > 80]