JavaScript FAQs ​

Get answers to frequently asked questions (FAQs) about the JavaScript connector.

What is the Workato JavaScript connector used for? ​

View answer

The Workato JavaScript connector allows you to write custom JavaScript code as part of your recipes. You can use it for tasks like data transformation and invoking external services.

What JavaScript runtime does the Workato JavaScript connector use? ​

View answer

The Workato JavaScript connector runs on Node.js version 20.11.0. It includes all JavaScript libraries available in Node.js version 20.11.0, as well as additional libraries such as:

  • node_fetch
  • lodash
  • gRPC
  • Google Protobuf

Is there a limit to the size of JavaScript scripts in the connector? ​

View answer

Yes. The JavaScript action limits script size and has the following quotas:

DescriptionQuotaNotes
Memory quota for JavaScript connector actions, including libraries, temporary memory, and inputs256 MBNA
Maximum code field size for JavaScript connector actions1 MBNA
Timeout for JavaScript connector actions30 secondsNA
Read request timeout for JavaScript evaluation in actions30 secondsThis quota applies to the following action:
  • Invoke custom JavaScript code action

How do I define input fields in the Workato JavaScript connector? ​

View answer

Locate the Input fields section and select Add field to define input fields for your JavaScript code. You can map values to these input fields from previous steps in your recipe.

How are Date input fields passed to the JavaScript code? ​

View answer

Date input fields with the Date type are passed as strings to the JavaScript code. We recommend consuming date input by converting it to Date objects within your code.

How do I define the output schema for the JavaScript code being called? ​

View answer

To define the output schema, you can use one of two methods:

  • Use a sample JSON for schema generation.
  • Manually define the schema by adding fields, specifying data types, and determining which of these are optional.

What format should my JavaScript code follow in the exports.main function? ​

View answer

The JavaScript connector requires your code to be within the exports.main function. Your code must follow the CommonJS format and export the main function, which takes in data as input and returns the output.

Last updated: