Study guide
22.4 Coded Automations: Structure, Arguments & Invoking Workflows
UiPath Automation Developer Professional UiPath-ADPv1
Track your progress as you read
Finished sections get a check mark.
1 Chapter 1: Exam Overview & Blueprint Map
1.1 About the UiPath-ADPv1 Exam: Format, Fees & Policies 1.2 The Exam Topics Mapped to This Guide & a Study Plan
2 Chapter 2: REFramework Architecture & State Dynamics
2.1 State Machine Architecture & The Four Core States 2.2 Configuration Management: Settings, Constants, and Assets 2.3 Transaction Types & The Dispatcher vs. Performer Architecture 2.4 Adapting REFramework: Tabular Data, Collections & Linear Processes
3 Chapter 3: REFramework Exception Handling & Recovery
3.1 BusinessRuleException vs. System.Exception Handling Patterns 3.2 Retry Mechanisms: Queue Retries vs. REFramework MaxRetryNumber 3.3 Consecutive System Exceptions & Graceful Process Termination
4 Chapter 4: State Machines, Custom Log Fields & REFramework Testing
4.1 Building State Machine Projects in Studio 4.2 Logging Levels, Robot Logs & Custom Log Fields in REFramework 4.3 Testing a REFramework Project With and Without Orchestrator Queues
5 Chapter 5: LINQ Queries & DataTable Operations
5.1 LINQ Essentials for Collections & Filtering 5.2 Advanced DataTable Querying with LINQ 5.3 In-Memory DataTable Transformations & Column Operations
6 Chapter 6: Regex, DateTime, JSON & Invoke Activities
6.1 Regular Expressions & Text Parsing for Automation 6.2 DateTime Formatting, Timezone Conversions & TimeSpan Calculations 6.3 JSON Parsing, JSONPath & Serialization with Newtonsoft.Json 6.4 Invoke Method & Invoke Code Activities 6.5 Data Referencing in Invokes: DataTable, List & Dictionary Arguments
7 Chapter 7: Modern UI Automation & Unified Targeting
7.1 Modern Design Experience & The Unified Target Concept 7.2 Anchors, Relative Elements & UI Automation Activities 7.3 Dynamic Selectors, Variables & Wildcards in Selectors
8 Chapter 8: Object Repository, Computer Vision & Remote Runtime
8.1 Object Repository & UI Descriptor Libraries 8.2 AI Computer Vision for Unattended & Remote Interfaces 8.3 Automation in Virtual Environments & UiPath Remote Runtime
9 Chapter 9: Advanced UI Automation: Browser Modes, Agentic UI & macOS
9.1 Browser Automation with the WebDriver Protocol 9.2 Agentic UI Automation: ScreenPlay, Semantic Activities & Healing Agent 9.3 macOS Automation: Native Apps, Office Apps & AppleScript
10 Chapter 10: Advanced Control Flow & Exception Architecture
10.1 Flowcharts, Sequences & Parallel Control Flow Patterns 10.2 Global Exception Handler Architecture & ErrorAction Directives 10.3 TryCatch, Retry Scope & Custom Exception Architectures
11 Chapter 11: Orchestrator Queues & Transaction Management
11.1 Queue Architecture, SpecificContent & Transaction Lifecycles 11.2 Queue Items SLA, Postpone, Deadlines & Priority Scheduling 11.3 Bulk Operations, Transaction Status Updates & Queue Triggers
12 Chapter 12: Orchestrator Tenant & Folder Entities
12.1 Asset Types, Per-Robot Assets & External Credential Stores 12.2 Modern Folder Hierarchy, User/Robot Assignment & Permissions 12.3 Storage Buckets, Webhooks & Environment Promotion 12.4 Orchestrator Tags: Labels, Properties & Governance
13 Chapter 13: Unattended Execution, API Triggers & Cloud Robots
13.1 Unattended Job Execution: Folders, Priorities, Background vs. Foreground & Runtimes 13.2 API Triggers: Starting Jobs from External Systems over HTTP 13.3 Serverless and Cloud VM Robots: Cloud-Hosted Execution Options
14 Chapter 14: Monitoring, Recording & Solutions Management
14.1 Orchestrator Monitoring, Trigger Alerts & Job Health 14.2 Job and Transaction Recording: Troubleshooting Faulted Unattended Jobs 14.3 Solutions Management: Packaging and Deploying Automations with Their Resources
15 Chapter 15: Debugging, Remote Debugging & Profiling
15.1 Studio Debugging Tools: Breakpoints, Panels & Execution Control 15.2 Remote Debugging: Remote Machine and Unattended Robot Connections 15.3 Profile Execution: Finding Performance Bottlenecks in Studio
16 Chapter 16: RPA Testing & Test Suite
16.1 UiPath Test Suite Overview, Test Cases & Given-When-Then Structure 16.2 Data-Driven Testing, Test Verification Activities & Mock Activities 16.3 CI/CD Pipelines with uipcli & Test Manager Traceability
17 Chapter 17: Long-Running Workflows, Action Center & Apps
17.1 Long-Running Workflows: Persistence, Suspend and Resume 17.2 Action Center & Human-in-the-Loop Orchestration 17.3 UiPath Apps: Action Apps, Automations & Integration Service
18 Chapter 18: Trigger-Based Attended Automation & Callouts
18.1 Trigger-Based Attended Automation: Forms, Triggers & Global Variables 18.2 Running Local Triggers & the Event Inspection Tool 18.3 Callouts & Forms for Attended Guidance
19 Chapter 19: UiPath Assistant & Robot Sessions
19.1 UiPath Assistant: Automations, Reminders, Widgets & Configuration 19.2 Robot Session (Picture in Picture): Child Session vs. Virtual Desktop
20 Chapter 20: Autopilot for Developers & Autopilot for Everyone
20.1 Autopilot for Developers: AI Assistance in Studio and Studio Web 20.2 Autopilot for Everyone: Chat, Automations & Clipboard AI
21 Chapter 21: API Automation & Integration Service
21.1 Integration Service: Connectors, Connections & Connector Activities 21.2 API Workflows in Studio Web 21.3 HTTP Requests: Web APIs, the Orchestrator API & Connector Requests 21.4 Connector Builder: Custom Integration Service Connectors 21.5 Integration Service Event Triggers: Connected and Disconnected 21.6 GenAI Activities: Generative AI Inside Workflows
22 Chapter 22: Data Service, Context Grounding & Coded Workflows
22.1 Data Fabric (Data Service) Entities: Modeling Business Data 22.2 Data Fabric Activities and the Platform Connector 22.3 Context Grounding: Retrieval-Augmented Generation with Company Data 22.4 Coded Automations: Structure, Arguments & Invoking Workflows 22.5 Coded Automation Services: Orchestrator, UI Automation, Microsoft 365 & Custom Services
23 Chapter 23: Integrated Scenario Practice
23.1 Integrated Scenario Practice: Designing an End-to-End Solution
22.4 Coded Automations: Structure, Arguments & Invoking Workflows
Key Takeaways Explain This Topic AI
Coded automations come as coded workflows, coded test cases, and code source files, in Windows and Cross-platform projects.
Coded workflows inherit the CodedWorkflow partial class (from UiPath.CodedWorkflows), with one [Workflow] or [TestCase] entry point per file.
In arguments are method parameters, Out is the return type (a named tuple for several), and a name used in both is In/Out.
Low-code workflows call coded ones with Invoke Workflow File; coded workflows call others with the workflows object or RunWorkflow.
Use coded files for complex logic and .NET libraries, and low-code for reviewable process flow; coded automations cannot be remote debugged.
Last updated: September 2026
22.4 Coded Automations: Structure, Arguments & Invoking Workflows
Core Concept: Coded automations let you write automations in C# inside a Studio project, next to low-code .xaml workflows. They use services , which correspond to activity packages, and their coded automation APIs , which correspond to activities. Coded and low-code workflows can invoke each other.
The Three Types
- Type Purpose Entry point
- Coded workflow A workflow written in C# A method attributed [Workflow]
- Coded test case A test case written in C# A method attributed [TestCase]
- Code source file Helper classes, models, interfaces, and custom services used by other coded files None
Coded automations are available only in Windows and Cross-platform projects. Types defined in code, such as enums, can also be used as inputs in low-code workflows.
Structure of a Coded Workflow using UiPath.CodedWorkflows;
- namespace MyProject
- {
- public class ApproveLoan : CodedWorkflow
- {
- [Workflow]
- public bool Execute(double loanRate)
- {
- Log($"Evaluating rate {loanRate}");
- return loanRate < 0.08;
- }
- }
- }
Namespace: generated from the project name, plus the folder name for files in folders ("My project" becomes Myproject , and a file in folder "place" uses Myproject.place ).
Base class: coded workflows and test cases inherit the CodedWorkflow partial class from the UiPath.CodedWorkflows package, which inherits CodedWorkflowBase . Because the class is partial, you can extend it in a code source file, for example to add properties for custom services.
Entry point: the method is named Execute() by default and attributed [Workflow] or [TestCase] ; you can rename it as long as the attribute stays. Only one entry point is allowed per file.
Package: UiPath.CodedWorkflows is added automatically when you create a coded file, or when a new project uses version 23.10 or later of packages such as System, Testing, or UIAutomation activities.
Useful base-class members
- Member Use
- Log(message, level, additionalLogFields) Write a log message, optionally with extra log fields
RunWorkflow(path, inputArguments, timeout, isolated, targetSession) Invoke another workflow and get its output and in/out arguments
- RunWorkflowAsync(...) , Delay(...) , DelayAsync(...) Asynchronous invocation and waits
- BuildClient(scope) An HttpClient with an access token, for calling Orchestrator's API
- GetRunningJobInformation() Information about the running job
- services Access to built-in services such as logging, the Orchestrator client, and workflow invocation
- Arguments
Arguments are declared on the entry point method:
- Argument kind How to declare it Example
- In Method parameters public void Execute(string customerName, decimal loanAmount)
- Out The return type public bool Execute(double loanRate)
Several outputs A named tuple as the return type public (double loanAmount, string financialNeed) Execute(double interestRate, double loanAmount)
In/Out A name that appears as both parameter and output loanAmount in the tuple example above
An argument named Output is always treated as In/Out.
- Invoking in Both Directions
- Low-code to coded
Use Invoke Workflow File and select the .cs file. In Windows projects, change the file filter from workflow files to All Files to see .cs files. With System.Activities 24.10 and later, the coded workflow's arguments are imported automatically into the activity.
Coded to low-code (or coded)
workflows object: strongly typed calls to the project's workflows, for example int result = workflows.Increment(random); .
RunWorkflow : pass the file path and a dictionary of inputs; the result dictionary holds the outputs: var outputs = RunWorkflow("Workflows\\OpenTerminal.xaml",
- new Dictionary<string, object> { { "in_TransactionNumber", "TXN-88412" } });
- var token = outputs["out_SessionToken"].ToString();
- When to Choose Coded or Low-Code
- Situation Better fit
- Complex data transformations, algorithms, or reusable helper logic Coded
- Integrating .NET libraries from NuGet Coded
- Process flow that business stakeholders review, such as REFramework states Low-code
- Quick UI automation with visual recording and validation Low-code, or coded with the Object Repository
- Teams that review changes in Git diffs Coded files diff and merge more easily than XAML
Most projects mix both: low-code for the process skeleton, coded workflows or source files for the heavy logic.
Worked Example: Moving Validation Logic into Code
An invoice performer has a 60-activity low-code workflow that validates line items with nested loops and If activities. The team:
Creates a code source file with an InvoiceLine class and a LineValidator helper that returns a list of problems.
Creates a coded workflow ValidateInvoice.cs whose entry point is public (bool isValid, string reason) Execute(DataTable lines) , so it has one In argument and two Out arguments.
Replaces the old workflow in Process.xaml with Invoke Workflow File pointing to ValidateInvoice.cs ; the arguments lines , isValid , and reason are imported automatically.
Throws a BusinessRuleException in Process.xaml when isValid is False, so REFramework still marks the item as a business exception.
Adds a coded test case that feeds sample lines to the validator and checks the result with the testing service.
The process flow stays visible in low-code, while the validation logic becomes shorter, testable, and easy to review in Git.
Limitations to Remember
Coded automations cannot be remote debugged .
One [Workflow] or [TestCase] entry point per file.
Coded automations require Windows or Cross-platform projects, not Windows - Legacy.