studio
2024.10
false
- Release Notes
- Getting Started
- Setup and Configuration
- Automation Projects
- Dependencies
- Types of Workflows
- Control Flow
- File Comparison
- Automation Best Practices
- Source Control Integration
- Debugging
- Logging
- The Diagnostic Tool
- Workflow Analyzer
- About Workflow Analyzer
- ST-NMG-001 - Variables Naming Convention
- ST-NMG-002 - Arguments Naming Convention
- ST-NMG-004 - Display Name Duplication
- ST-NMG-005 - Variable Overrides Variable
- ST-NMG-006 - Variable Overrides Argument
- ST-NMG-008 - Variable Length Exceeded
- ST-NMG-009 - Prefix Datatable Variables
- ST-NMG-011 - Prefix Datatable Arguments
- ST-NMG-012 - Argument Default Values
- ST-NMG-016 - Argument Length Exceeded
- ST-NMG-017 - Class name matches default namespace
- ST-DBP-002 - High Arguments Count
- ST-DBP-003 - Empty Catch Block
- ST-DBP-007 - Multiple Flowchart Layers
- ST-DPB-010 - Multiple instances of [Workflow] or [Test Case]
- ST-DBP-020 - Undefined Output Properties
- ST-DBP-021 - Hardcoded Timeout
- ST-DBP-023 - Empty Workflow
- ST-DBP-024 - Persistence Activity Check
- ST-DBP-025 - Variables Serialization Prerequisite
- ST-DBP-026 - Delay Activity Usage
- ST-DBP-027 - Persistence Best Practice
- ST-DBP-028 - Arguments Serialization Prerequisite
- ST-USG-005 - Hardcoded Activity Arguments
- ST-USG-009 - Unused Variables
- ST-USG-010 - Unused Dependencies
- ST-USG-014 - Package Restrictions
- ST-USG-017 - Invalid parameter modifier
- ST-USG-020 - Minimum Log Messages
- ST-USG-024 - Unused Saved for Later
- ST-USG-025 - Saved Value Misuse
- ST-USG-026 - Activity Restrictions
- ST-USG-027 - Required Packages
- ST-USG-028 - Restrict Invoke File Templates
- ST-USG-032 - Required Tags
- ST-USG-034 - Automation Hub URL
- Variables
- Arguments
- Imported Namespaces
- Coded automations
- Introduction
- Registering custom services
- Before and After contexts
- Generating code
- Generating coded test case from manual test cases
- Trigger-based Attended Automation
- Recording
- UI Elements
- Selectors
- Object Repository
- Data Scraping
- Image and Text Automation
- Citrix Technologies Automation
- RDP Automation
- VMware Horizon Automation
- Salesforce Automation
- SAP Automation
- macOS UI Automation
- The ScreenScrapeJavaSupport Tool
- The WebDriver Protocol
- Extensions
- About extensions
- SetupExtensions tool
- UiPathRemoteRuntime.exe is not running in the remote session
- UiPath Remote Runtime blocks Citrix session from being closed
- UiPath Remote Runtime causes memory leak
- UiPath.UIAutomation.Activities package and UiPath Remote Runtime versions mismatch
- The required UiPath extension is not installed on the remote machine
- Screen resolution settings
- Group Policies
- Cannot communicate with the browser
- Chrome extension is removed automatically
- The extension may have been corrupted
- Check if the extension for Chrome is installed and enabled
- Check if ChromeNativeMessaging.exe is running
- Check if ComSpec variable is defined correctly
- Enable access to file URLs and Incognito mode
- Multiple browser profiles
- Group Policy conflict
- Known issues specific to MV3 extensions
- List of extensions for Chrome
- Chrome Extension on Mac
- Group Policies
- Cannot communicate with the browser
- Edge extension is removed automatically
- The extension may have been corrupted
- Check if the Extension for Microsoft Edge is installed and enabled
- Check if ChromeNativeMessaging.exe is running
- Check if ComSpec variable is defined correctly
- Enable access to file URLs and InPrivate mode
- Multiple browser profiles
- Group Policy conflict
- Known issues specific to MV3 extensions
- List of extensions for Edge
- Extension for Safari
- Extension for VMware Horizon
- Extension for Amazon WorkSpaces
- SAP Solution Manager plugin
- Excel Add-in
- Studio testing
- Troubleshooting
- About troubleshooting
- Assembly compilation errors
- Microsoft App-V support and limitations
- Internet Explorer X64 troubleshooting
- Microsoft Office issues
- Identifying UI elements in PDF with Accessibility options
- Repairing Active Accessibility support
- Validation of large Windows-legacy projects takes longer than expected

Studio User Guide
Last updated Sep 3, 2025
Quickstart guide
linkThis quickstart guide helps you embark on the journey of working with coded automations. You will learn how to create coded automations following a tutorial that shows how to create a coded workflow that generates random numbers between 1-100, and performs addition or subtract operations based on whether the numbers are even or odd.
What are coded automations?
link- Coded workflows - used for designing workflows in code.
- Coded test cases - used for designing test cases.
- Code source files - used for creating code that you can later call in other coded file types.
Visit the Introduction for coded automations to learn more.
Scenario
linkIn this tutorial we use the RandomNumber coded automation API to
generate random decimal numbers within the specified range. We then check if the
generated numbers are even, using a custom method named
IsEven
, and
perform addition or subtraction based on that condition.
Create the coded workflow
linkCreate the coded workflow within your Studio project, and
install the necessary dependencies.
- Install Testing.Activities 23.10, because the scenario involves using the RandomNumber coded automation API from the Testing service.
-
Create a coded workflow by selecting New, and then Coded Workflow
from the File group.
Coded automations are structured with namespaces, helper classes, and entry point methods. The base class,
CodedWorkflow
, is used for both coded workflows and test cases, and it provides access to necessary interfaces and services. The entry point method, namedExecute()
, is crucial for running these automations and can be customized with input and output arguments.
Design the coded workflow
linkWrite the code in the Studio IDE that consists of a
dedicated code editor, file tabs, and breadcrumbs for easy navigation.
-
In the coded workflow, but outside of the
Execute()
method, create a custom method namedIsEven
.This method returns aboolean
value, that represents if thedecimal
variable inputted is an even number or not.Check out the code example below:private bool IsEven(decimal number) { // Check if a decimal number is even return (number % 2 == 0); }
private bool IsEven(decimal number) { // Check if a decimal number is even return (number % 2 == 0); }Tip: If you don't want to create a custom method in a separate code source file, then you can create it within the coded workflow or coded test case, but outside theExecute()
method. -
Inside the Execute method use the RandomNumber coded automation API to
create two
decimal
variables with a random value, and print them out in the console usingConsole.WriteLine
.Check out the code example below:// Generate random numbers within a specified range (e.g., 1 to 100) decimal num1 = testing.RandomNumber(1, 100); decimal num2 = testing.RandomNumber(1, 100); Console.WriteLine($"Generated numbers: {num1} and {num2}");
// Generate random numbers within a specified range (e.g., 1 to 100) decimal num1 = testing.RandomNumber(1, 100); decimal num2 = testing.RandomNumber(1, 100); Console.WriteLine($"Generated numbers: {num1} and {num2}");Note: You write coded automations like you would write code, using coded automation APIs available through UiPath services, and other custom C# classes, or .NET class libraries available from thenuget.org
feed. In coded automations, services are equivalent to activity packages used in low-code automations. These services, such as System.Activities, UiAutomation.Activities, and Testing.Activities, come with coded automation APIs that you can use for building coded automations. -
Create an If statement, with the condition that if both numbers are
even, then the automation should add them together. The Else clause
should subtract the numbers, if at least one of them is odd. Both results should
be printed out in the console using
Console.WriteLine
.Check out the code example below:if (IsEven(num1) && IsEven(num2)) { // Both numbers are even, so add them together decimal sum = num1 + num2; Console.WriteLine($"Both numbers are even. Sum: {sum}"); } else { // At least one number is odd, so subtract them decimal difference = num1 - num2; Console.WriteLine($"At least one number is odd. Difference: {difference}"); }
if (IsEven(num1) && IsEven(num2)) { // Both numbers are even, so add them together decimal sum = num1 + num2; Console.WriteLine($"Both numbers are even. Sum: {sum}"); } else { // At least one number is odd, so subtract them decimal difference = num1 - num2; Console.WriteLine($"At least one number is odd. Difference: {difference}"); }
Manage the coded workflow process
linkAfter you create and design a coded workflow, you can
validate it, using the Workflow Analyzer, debug it, run it, and then publish it
to Orchestrator.
-
In the Design ribbon, click Analyze File and then Validate
File to check the coded workflow file for C# compiler errors.
Visit About Workflow Analyzer to read about the Workflow Analyzer. -
In the Debug ribbon, click Debug File to debug the coded workflow
file and check for inconsistencies at runtime.
- Either in the Debug or Design ribbon, click Debug File then Run File, to run the coded workflow file that you created.
-
Select Publish in the Design ribbon.
The Publish Process dialog appears.
-
In the Publish options tab, select where to publish the project. The
available options depend on the type of project you are publishing.
For Processes:
- Orchestrator Tenant Processes Feed, Orchestrator Personal Workspace Feed
- Assistant (Robot Defaults) - the default package location for the
Robot and Assistant,
C:\ProgramData\UiPath\Packages
. Projects published here automatically appear in the Assistant. The option is not available if Studio is connected to Orchestrator. These options are available if Studio is connected to Orchestrator. - Custom - either a custom NuGet feed URL or local folder. Adding an API Key is optional.
-
Click Publish.
A NUPKG file is created and uploaded to Orchestrator, the custom NuGet feed, or saved in the local directory.
Sample project
To follow the steps of this tutorial and try it out yourself, you can download the following sample project: First Coded Workflow.
Next steps
Visit the resources below to enhance your knowledge on coded automations: