The short answer
In HubSpot's native action, use the libraries documented for its runtime. If a required dependency is not supported, consider a small built-in implementation, an external service or an app-provided code action. Turbyn supports compatible npm and Python packages, but runtime and installation constraints still apply.
Check the native library list first
HubSpot publishes separate supported-library lists for Node.js and Python. Check the package name and version against the current documentation, rather than assuming a local dependency is also installed in the action runtime.
For simple transformations, the language’s built-ins may be enough. An unavailable date library does not prevent all date arithmetic, and an unavailable vendor SDK does not necessarily prevent an HTTP request to that vendor.
Decide what you need the dependency to do
Write down the behavior before choosing a package. For example, a phone-normalization action needs decisions about default country, extensions, invalid input and the format returned to the workflow.
A useful acceptance list is:
- Accept a valid international number.
- Apply a default country only when the input needs one.
- Keep invalid input distinguishable from a valid empty result.
- Preserve or deliberately separate extensions.
- Return a field the next workflow action can use.
Start from the phone-normalization recipe for its concrete configuration and sample results. For documents, see the personalized onboarding pack.
Choose an execution approach
Use a built-in. A small, well-tested transformation can be easier to maintain than an extra dependency.
Vendor a small utility. Check its license and dependencies, and take responsibility for reviewing updates. Pasting code is not a substitute for understanding its assumptions.
Call an external service. This moves the implementation elsewhere, but adds credentials, network failures and another service to operate. Waiting for it still consumes the calling action’s runtime budget.
Use a connected-app code action. Turbyn lets you use compatible packages alongside your handler. Read the package guide for the installation model and restrictions; do not assume your local development environment exactly matches the sandbox.
Test the dependency and the workflow separately
First test the transformation against synthetic edge cases. Then test installation and execution in Turbyn. Finally, verify that HubSpot’s next step selects the correct returned value.
Record the versions you tested. Review changes before publishing a new version, especially when a package changes its parsing rules or output shape. An install that succeeds is not proof that the resulting behavior matches your business rule.
Keep the action’s responsibilities small
A library should support one understandable outcome: normalize a phone number, produce a document or calculate a date. Avoid turning a single workflow step into an unrelated collection of integrations.
If a package primarily solves a runtime problem, check the timeout guide too. More library choice does not remove memory limits, API quotas or the need to handle failures.
Sources and references
Source documentation checked for this update. Availability can vary by subscription and account.