- Release notes
- Getting started
- For administrators
- RPA workflow projects
- Creating an RPA workflow from an idea
- Creating a project
- How to start an RPA workflow
- Managing project files and folders
- Connecting RPA workflows to your accounts
- Configuring activities
- Managing the activities in a project
- Passing values between activities
- Iterating through items
- Managing the data in a project
- Configuring a project to use your data
- Using file and folder resources
- App projects
- Agentic processes
- Agents
- Solutions - Preview
- API workflows - Preview

Studio Web User Guide
The Script activity uses JavaScript to enable custom data manipulation within your workflow. It integrates into API workflows, allowing you to:
- Extract, format, and restructure API responses.
- Aggregate and consolidate data.
- Perform calculations and data transformations.
- Standardize data formats for later steps.
Use the Script activity to refine nested or fragmented API responses before passing them to subsequent workflow activities.
- On your API workflow designer canvas, select the plus (+) icon. The Add activity menu appears.
- Select Script.
- In the Properties panel, expand the Expression editor, then write your JavaScript logic in the Code panel.
- Test the workflow to execute the activity and generate output fields for later use.
- Use the
return
statement to efficiently structure JSON outputs. - Use
.map()
to transform arrays into structured objects. - Use Autopilot expression generator to automatically generate JavaScript based on workflow context, minimizing manual coding effort.
The following example consolidates data from multiple workflow steps into a structured JSON object using the Script activity. This approach is especially helpful with Workday APIs, which often require several endpoint calls to retrieve complete datasets, such as employee details, managers, and direct reports.
Open the Test configuration window, then paste and save the following JSON syntax:
{
"first_name": "Betty",
"last_name": "Liu"
}
{
"first_name": "Betty",
"last_name": "Liu"
}
- Using
$context.outputs
to retrieve data from previous API calls. - Using
.map()
to transform arrays into structured lists of reports. - Combining multiple API responses into a single JSON object.