For the complete documentation index, see llms.txt. This page is also available as Markdown.

Custom code

The Javascript code block lets you add custom data manipulations, conditional logic checks, or API actions

If you want specific, custom functionality in a single workflow step, try out our Javascript code block. It's perfect for:

  • Specific data validation or formatting requirements

  • Complex conditional logic

  • Custom API interactions

Code inputs

You can map values from previous steps in your workflow into the code block. These have a key-value format.

Key

The key is how you refer to the value in the code. Technically, the key is a property of the Input object, so you refer to it with input.key

Value

Map a value from the workflow into the value field. This is what the code will run on.

Javascript code and output

The output of the code block step is the value of the return statement.

Typically, to achieve a custom function, you will define one or more Javascript functions in the Code to run field, call them on the code input, and then return the result.

API calls

Use the Javascript Fetch API to make API calls to connect to your apps inside the code.

Where the code runs

Note that the code runs in the cloud and not in the browser of the user running the feature.

Last updated