Script step
-
- UpdatedAug 1, 2024
- 5 minutes to read
- Xanadu
- Create Workflows
Add custom JavaScript to execute within a reusable action. While most core actions and steps fit common use cases, you can build a Script step to execute behavior not satisfied by the core steps.
Roles and availability
Fields
The Script step includes separate input and output variables that enable you to map JavaScript data to Workflow Studio data. By defining input and output variables within the step, you can define what Workflow Studio data is available within your script, and which scripting variables are available to other steps in your action.
Action error evaluation
- If this step fails
- Data type: Choice
Option to continue running the next step or go to error evaluation. To use the step status code or message for a custom action error condition, see Action error evaluation.
Example
This example builds a JSON payload that can be easily updated or changed and added to a subsequent REST step.
By creating an output variable that represents the payload, you can drag the [Payload] data pill into the REST step Body field.