21.2 API Workflows in Studio Web
Key Takeaways
API workflows are built in Studio Web and run on cloud-managed serverless infrastructure without robot machines.
Activities include Connector, HTTP, Script, If, For Each, Do While, Assign, Try Catch, Wait, Log Message, Response, and Base64 file conversions.
Expressions and scripts use JavaScript; inside loops use
$inputfor the previous object's output.Manual HTTP requests go out through serverless robots, while connector-based calls go through Integration Service.
Published API workflows run as Orchestrator processes and serve as agent tools and Maestro tasks.
21.2 API Workflows in Studio Web
Core Concept: API workflows are headless workflows built in Studio Web that chain API calls and transform data on UiPath's cloud-managed, serverless infrastructure. They run fast, need no robot machine, and can serve as reusable APIs, as tools for agents, or as tasks in Maestro processes.
API Workflows Versus RPA Workflows
| API workflow | RPA workflow | |
|---|---|---|
| Built in | Studio Web | Studio or Studio Web |
| Runs on | Cloud-managed serverless infrastructure | Robots on machines (or serverless robots) |
| Interacts through | APIs only | UI and APIs |
| Expressions | JavaScript | VB.NET or C# |
| Typical use | System-to-system integrations, data transformation, tools for agents | Anything that needs UI automation or desktop applications |
The Activities
| Activity | Purpose |
|---|---|
| Connector | Call an Integration Service connector operation through a connection |
| HTTP | Send an HTTP request, with manual authentication or connector-based authentication |
| Script | Run JavaScript to transform data |
| If | Branch on a condition |
| For Each / Do While | Loop over items or while a condition holds |
| Assign | Set values |
| Try Catch | Handle errors |
| Wait | Pause for a time |
| Log Message | Write a log entry |
| Response | End the workflow early with a Success or Failure response |
| File to Base64 / Base64 to File | Convert files for API payloads |
Tips from UiPath's documentation:
- Define clear input and output schemas, so other UiPath products can call the workflow correctly.
- Inside For Each and Do While, use
$inputinstead of$contextto access the previous object's output. - Use Autopilot to generate context-aware JavaScript expressions, and validate them in the expression editor's output panel before running.
- Test quickly with the Run Output panel, which shows inputs and outputs you can expand or copy.
Outbound Traffic and IP Allow Lists
Calls inside the UiPath platform, for example to Orchestrator, need no allow-listing. External calls do, and the source depends on the activity:
| Activity | Authentication | Outbound path |
|---|---|---|
| HTTP Request | Manual | Serverless robots (serverless static IPs) |
| HTTP Request | Connector-based | Integration Service (Integration Service IPs) |
| Connector | Not applicable | Integration Service |
If a partner's firewall blocks requests, check which path the activity uses and allow the matching IP range.
Publishing and Consuming
- From Orchestrator: publish the API workflow; it appears as a process. Start a job from Automations > Processes, supply the input (the request schema), and read the response in the job details.
- As an agent tool: add it to an agent with Add tool > API workflow and describe its inputs clearly so the agent can call it. The agent then uses only the data the API workflow returns, which limits what the model sees.
- In Maestro: use API workflows as tasks that encapsulate API chaining and data transformation, keeping the main process readable.
Worked Example: Enriching a New Lead
- Input schema:
email(string). - Connector activity: search the CRM for a contact with that email.
- If the contact exists, Response with Success and the contact ID.
- Otherwise, an HTTP activity with manual authentication calls a company-data API.
- A Script activity maps the response to the CRM's fields in JavaScript.
- A Connector activity creates the contact.
- Try Catch around steps 4 to 6 returns a Failure response with a clear message if the external API fails.
- Response with Success and the new contact ID.
The workflow runs in a few seconds without any robot machine, and the sales agent that calls it as a tool never sees the raw data from the external API.
Design Guidelines
- Keep each API workflow focused on one integration task with a clear contract, so it can be reused by processes, agents, and Maestro alike.
- Validate inputs first and return a Failure response with a clear message when required values are missing.
- Handle partial failures: decide what happens if the second of three API calls fails, and use Try Catch to return a meaningful response.
- Log identifiers, not payloads, to keep sensitive data out of logs.
- Prefer connectors when one exists, because they manage authentication and tokens; use manual HTTP only when necessary.
Key Terms
- Input and output schema: the JSON structure of the request and response, which callers such as agents rely on.
$contextand$input: expression variables for accessing workflow data; inside loops,$inputholds the previous object's output.- Run Output panel: the design-time view of each activity's inputs and outputs during a test run.
- Platform connector: a connector for UiPath services, such as Orchestrator or Data Fabric, used from API workflows.
Common Traps
- Writing VB.NET expressions: API workflows use JavaScript.
- Forgetting to allow serverless IPs for manual HTTP calls to firewalled systems.
- Using
$contextinside loops where$inputholds the previous object's output. - Trying to automate a UI: API workflows cannot; use an RPA workflow.
An API workflow calls a partner API through an HTTP activity with manual authentication, and the partner's firewall blocks the requests. Which IPs must the partner allow?
The developer's workstation IP.
Integration Service IPs.
The Orchestrator tenant's web IP.
The serverless static IPs, because manual HTTP requests go out through serverless robots.
Which statement about API workflows is correct?
They run on cloud-managed serverless infrastructure, use JavaScript expressions, and cannot automate user interfaces.
They require an unattended robot machine.
They use VB.NET expressions like Studio workflows.
They can only be started by agents.
How does an API workflow end early with an error result for its caller?
By throwing an exception from a Log Message activity.
With a Response activity configured as Failure.
By stopping the job in Orchestrator.
With a Wait activity of zero seconds.
Sections you finish are checked off in the contents.