studio-web
latest
false
- 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
- User interface
- Managing API workflows
- Consuming API workflows
- Building your first API workflow
- Paging over HTTP calls
- Extracting worker hierarchy from Workday

Studio Web User Guide
Last updated Sep 2, 2025
Extracting worker hierarchy from Workday
linkThe following tutorial demonstrates how to effectively use key features of API workflows:
- Input and output schemas
- Connector activities
- Connector HTTP activities
- JavaScript expressions
- Formatting and transforming responses
- Publishing workflows to Orchestrator
A valid connection to Workday is required.
- Create an API workflow.
- Open Data manager and add the firstname and lastname properties as input. You can reference these properties later through the
$workflow.input
object. - Add a Connector and configure it to use the following Workday (Rest) activity: Search Workers by Name or ID.
- For the Search string or ID field, open the Expression editor and write the following:
$workflow.input.firstName + " " + $workflow.input.lastName
$workflow.input.firstName + " " + $workflow.input.lastName
- For the Search string or ID field, open the Expression editor and write the following:
- Debug your workflow and notice the successful response. Yet, zero workers were found.
- Add an If activity, and use the following snippet as the Condition:
$context.outputs.Workers_1.content.length <= 0
$context.outputs.Workers_1.content.length <= 0 - For the Then branch of the If activity, add a Response activity, and configure it as follows:
- Type—Failure
- Details—
{ "notFound": "No workers found for given input" }
{ "notFound": "No workers found for given input" }
- Debug your workflow again. Since you did not provide the required input, the workflow automatically proceeds to this response and sets the workflow status to Failed.
-
Define a Debug
configuration with the following payload:
{ "firstName": "Betty", "lastName": "Liu" }
{ "firstName": "Betty", "lastName": "Liu" } -
Debug your workflow until you begin to see results in the content
property of the Output schema.
- For the Else branch of the If activity, add a Loop > For Each activity, and configure it as follows:
- In—
$context.outputs.Workers_1.content
$context.outputs.Workers_1.content - Item name—currentItem
- Accumulate results—On
- In—
- In the For Each activity body, add three Workday REST HTTP Request activities for the Workday (REST) connector:
- Workday REST HTTP Request 1: Find Direct Reports
- Workday REST HTTP Request 2: Find Organization Details
- Workday REST HTTP Request 2: Find Peers
- Configure the Workday REST HTTP Request 1: Find Direct Reports activity as follows:
- Method—GET
- Request URL—Where
"/common/v1/uipath_dpt1/workers/" + $currentItem.id + "/directReports"
"/common/v1/uipath_dpt1/workers/" + $currentItem.id + "/directReports"uipath_dpt1/workers
is part of the sandbox definition.
- Configure the Workday REST HTTP Request 2: Find Organization Details activity as follows:
- Method—GET
- Request URL—Where
"/common/v1/uipath_dpt1/supervisoryOrganizations/" + $currentItem.primaryJob.supervisoryOrganization.id
"/common/v1/uipath_dpt1/supervisoryOrganizations/" + $currentItem.primaryJob.supervisoryOrganization.iduipath_dpt1/supervisoryOrganizations
is part of the sandbox definition.
- Configure the Workday REST HTTP Request 3: Find Peers activity as follows:
- Method—GET
- Request URL—Where
"/common/v1/uipath_dpt1/supervisoryOrganizations/" + $currentItem.primaryJob.supervisoryOrganization.id + "/workers"
"/common/v1/uipath_dpt1/supervisoryOrganizations/" + $currentItem.primaryJob.supervisoryOrganization.id + "/workers"uipath_dpt1/supervisoryOrganizations
is part of the sandbox definition.
- Debug your workflow again. Notice that the workflow successfully loops a specified number of times (based on the number of results from the first activity) over these three HTTP requests.
- In the For Each activity body, add a Script activity after the previous three Workday REST HTTP Request activities.
- To configure the Script activity, use the Autopilot generator in the Expression editor and provide the following prompt:
"From the previous 3 activities, create 3 objects. Object 1 is "manager" and should return the descriptor as name and person.email as email. Object 2 is peers from the 3rd http request and should loop over all results and return descriptor as "name" and primaryworkemail as "email". Last, add an object "reports" that loops over all first http results and report name (descriptor) and primaryworkemail as email."
The generated JavaScript code should look like the following:
return { // Details on the worker manager: { name: $currentItem.descriptor, email: $currentItem.person.email }, // Details for their peers peers: $context.outputs.Workday_REST_HTTP_Request_1.content.data.map(peer => ({ name: peer.descriptor, email: peer.primaryWorkEmail })).filter(peers => peers.name !== $currentItem.descriptor), // Filter out the employee itself, // Details for their direct reports reports: $context.outputs.Workday_REST_HTTP_Request_3.content.data.map(report => ({ name: report.descriptor, email: report.primaryWorkEmail })) }
return { // Details on the worker manager: { name: $currentItem.descriptor, email: $currentItem.person.email }, // Details for their peers peers: $context.outputs.Workday_REST_HTTP_Request_1.content.data.map(peer => ({ name: peer.descriptor, email: peer.primaryWorkEmail })).filter(peers => peers.name !== $currentItem.descriptor), // Filter out the employee itself, // Details for their direct reports reports: $context.outputs.Workday_REST_HTTP_Request_3.content.data.map(report => ({ name: report.descriptor, email: report.primaryWorkEmail })) } - Outside of the For Each loop, add a Response activity and configure it as follows:
- Type—Success
- Details
$context.outputs.For_Each_1.results
$context.outputs.For_Each_1.results
- Debug your workflow end to end. You should have a successful execution and response schema should meet your needs.
- Generate the Output schema of the successful execution of your workflow:
- Navigate to the Output section of the Run output panel.
- Select Copy to clipboard.
- Navigate to the Output section of the Data Manager panel.
- Select Generate From Payload.
- Paste the output copied from Output > Run output.
Your API workflow now includes input and output schemas, allowing it to be invoked across the platform. - Publish your API workflow to Orchestrator.