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

Studio Web User Guide
Last updated Sep 2, 2025
If
linkThe If activity enables conditional branches within API workflows to create dynamic execution paths based on data-driven conditions. Use the If activity for workflows that require different actions depending on real-time API responses, user inputs, or system states.
Using the If activity
linkTo add an If activity to your workflow:
- On your API workflow designer canvas, select the plus (+) icon. The Add activity menu appears.
- Select If.
- In the Properties panel, write the expression in the Condition field.
- Add activities to the Then and Else branches as needed.
- Test the workflow to execute the activity and generate output fields for later use.
If activity example
linkThe following example ensures that a transaction sync workflow only processes active customers who have made at least one
transaction in the last 24 hours. If the conditions are not met, the workflow exits with a failure response.
Open the Debug configuration window, then paste and save the following JSON syntax:
{
"id": 12345,
"name": "John Doe",
"isActive": true,
"balance": 2500.75,
"createdAt": "2025-03-25T12:00:00Z",
"tags": [
"premium",
"verified",
"active"
],
"address": {
"street": "123 Main St",
"city": "New York",
"state": "NY",
"zipCode": "10001",
"coordinates": {
"latitude": 40.7128,
"longitude": -74.006
}
},
"transactions": [
{
"transactionId": "txn_001",
"amount": 150.5,
"currency": "USD",
"timestamp": "2025-03-25T10:30:00Z"
},
{
"transactionId": "txn_002",
"amount": -75.25,
"currency": "USD",
"timestamp": "2025-03-23T08:15:00Z"
}
]
}
{
"id": 12345,
"name": "John Doe",
"isActive": true,
"balance": 2500.75,
"createdAt": "2025-03-25T12:00:00Z",
"tags": [
"premium",
"verified",
"active"
],
"address": {
"street": "123 Main St",
"city": "New York",
"state": "NY",
"zipCode": "10001",
"coordinates": {
"latitude": 40.7128,
"longitude": -74.006
}
},
"transactions": [
{
"transactionId": "txn_001",
"amount": 150.5,
"currency": "USD",
"timestamp": "2025-03-25T10:30:00Z"
},
{
"transactionId": "txn_002",
"amount": -75.25,
"currency": "USD",
"timestamp": "2025-03-23T08:15:00Z"
}
]
}
- On your API workflow designer canvas, add an If activity.
- Select the Condition field in the properties panel to open the Expression editor.
- Use the Autopilot expression generator to create your condition, and prompt it the following:
"Write a conditional statement that checks that the input request is for an active customer and that there is at least one transaction object that was created in the last 24 hours".
The response should look like this:
const now = new Date(); const twentyFourHoursAgo = new Date(now.getTime() - 24 * 60 * 60 * 1000); if ($workflow.input.isActive) { const recentTransactions = $workflow.input.transactions.filter(transaction => { const transactionTimestamp = new Date(transaction.timestamp); return transactionTimestamp > twentyFourHoursAgo; }); const hasRecentTransactions = recentTransactions.length > 0; hasRecentTransactions; } else { false; }
const now = new Date(); const twentyFourHoursAgo = new Date(now.getTime() - 24 * 60 * 60 * 1000); if ($workflow.input.isActive) { const recentTransactions = $workflow.input.transactions.filter(transaction => { const transactionTimestamp = new Date(transaction.timestamp); return transactionTimestamp > twentyFourHoursAgo; }); const hasRecentTransactions = recentTransactions.length > 0; hasRecentTransactions; } else { false; } - Check the Activity test input and Expression output panels to verify that the expression generates the expected results.
- Save the Condition configuration.
- To the Then branch, add a Response activity.
- Configure the response as follows:
- Type—Failure
- Details—Open the Expression editor and write the following:
{ message: "Customer is not active or no transaction to process" }
{ message: "Customer is not active or no transaction to process" }