HSEmulate is a local test runner designed to simulate HubSpot custom-coded workflow actions in both JavaScript and Python. It enables developers to execute their code locally using real workflow event payloads, thereby streamlining the development and testing process.
Key Features:
Supports execution of custom code actions in JavaScript and Python.
Utilizes fixtures for realistic input data.
Includes assertions for validating output and metadata.
Implements snapshot testing to detect regressions.
Enforces execution budgets for time and memory constraints.
Detects flaky runs through repeated execution.
Audience & Benefit:
Ideal for developers building HubSpot custom code, HSEmulate reduces reliance on the HubSpot UI by enabling local iteration and validation. It helps catch errors early, ensures consistent behavior, and minimizes manual testing cycles.
HSEmulate can be installed via winget, providing a seamless setup experience for developers.
README
HubSpot Emulator (hsemulator)
hsemulator is a local test runner and execution engine for HubSpot Workflow Custom Code Actions.
It allows you to run the exact JavaScript or Python code you paste into HubSpot locally, using real workflow event payloads, with support for assertions, snapshots, execution budgets, and flaky-run detection.
The goal is to make developing HubSpot custom code feel closer to Lambda-style local development—without relying on the HubSpot UI for iteration.
Why hsemulator exists
Developing HubSpot custom code today typically means:
Writing code in an editor
Copying it into the HubSpot UI
Triggering a workflow
Reading logs in a browser
Repeating
hsemulator replaces that loop with a local, deterministic workflow:
Code stays in your editor
Events are fixtures
Failures are explicit
Regressions are caught automatically
No UI-driven iteration required.
When to use it
Use hsemulator when you want to:
Develop and debug HubSpot custom code locally
Validate logic using real workflow event payloads
Catch regressions with assertions and snapshots
Enforce execution limits during development or CI
Reduce copy–paste cycles into the HubSpot UI
Do not use it to:
Fully emulate HubSpot’s runtime or infrastructure
Mock HubSpot APIs or rate limits
Replace integration or end-to-end tests
Core capabilities
Local execution of JS and Python custom code actions
Fixture-based event input
Assertions against output and metadata
Snapshot testing for regression detection
Execution budgets (time and memory)
Flaky-run detection via repeat execution
Structured execution summaries and events
CI-friendly, machine-readable output
Engine-first architecture (new)
As of v0.4.0, hsemulator is built around a standalone execution engine.
All execution behaviour—validation, lifecycle management, event emission, and result generation—lives in a single engine layer. Interfaces such as the CLI or HTTP runtime simply invoke the engine and interpret its outputs.