Supported JavaScript libraries

The Function node in Workflows comes with the libraries below already loaded, grouped by what you'd use them for. Each one is a ready-made global: use it by name, with no require or import. Standard JavaScript — for example JSON, Math, Date, RegExp, Map, Set, Promise and Intl — is also available. Libraries not listed here aren't supported.

Calling APIs and web services

Connect to other systems — for example, look up a ticket or update an employee record.

  • axios — Sends HTTP requests and reads the responses. Make execute an async function and await the call.

The code can't use your Integrations connections unlike Code Tools, so pass any token or API key in as an argument — for example, from an earlier step's output. fetch isn't available; use axios instead.

Working with data

Filter, combine and summarise records — for example, joining data from two systems or totaling expenses by team.

  • _ (Lodash) — Filters, sorts, groups, joins and reshapes lists and objects. Also safely reads nested values, like _.get(employee, 'manager.email').

Dates and time zones

Handle dates in any format and across time zones — for example, working out a leave end date or converting a meeting time.

  • luxon — Reads, formats and compares dates, does date math like adding three months, and converts between time zones. Use luxon.DateTime, luxon.Duration and luxon.Interval.

XML

Read or build XML — for example, a SOAP API response or an XML feed.

  • xml2js — Converts XML to a JavaScript object (new xml2js.Parser().parseStringPromise(xml)) and back again (new xml2js.Builder().buildObject(obj)).

Encoding

Convert text between formats — for example, Base64 for a Basic auth header or an attachment.

  • Buffer — Converts text to and from Base64 and hex, like Buffer.from(text).toString('base64').

Security and tokens

Protect data and sign in to APIs — for example, signing a request or creating a unique ID.

  • crypto — Creates hashes, HMAC signatures and random values, and signs data with keys. For example crypto.createHash('sha256'), crypto.createHmac(...) and crypto.randomUUID().

Each run is stopped after 60 seconds. See Javascript for how arguments are passed and what the action returns.


Did this page help you?