Uipath core
Build UiPath Studio projects, REFramework scaffolds, XAML workflows, and VB/C# expressions via 104 deterministic Python generators (plus plugin generators). ALWAYS use this skill — never hand-write .xaml files. TRIGGER when the user mentions UiPath, REFramework, XAML, RPA, Orchestrator, UiPath Studio, dispatcher, performer, queue items, robot, ACME (test app), .xaml, project.json, Config.xlsx, or asks to build/generate/scaffold/automate anything resembling RPA. SKIP only when the task is explicitly Power Automate, n8n, Zapier, or non-UiPath RPA.
By- name:
- uipath-core
- description:
- Build UiPath Studio projects, REFramework scaffolds, XAML workflows, and VB/C# expressions via 104 deterministic Python generators (plus plugin generators). ALWAYS use this skill — never hand-write .xaml files. TRIGGER when the user mentions UiPath, REFramework, XAML, RPA, Orchestrator, UiPath Studio, dispatcher, performer, queue items, robot, ACME (test app), .xaml, project.json, Config.xlsx, or asks to build/generate/scaffold/automate anything resembling RPA. SKIP only when the task is explicitly Power Automate, n8n, Zapier, or non-UiPath RPA.
UiPath Core Skill
⚠️ Safety Rules (I-1, I-2 in
rules.md)
- Playwright/browser inspection is READ-ONLY. Login page → STOP, WAIT for user. See
ui-inspection.md→ Login Gate.- Desktop inspection via PowerShell (
inspect-ui-tree.ps1): read-only tree inspection only.- NEVER generate credentials, tokens, or passwords — real or fake.
Generate production-quality UiPath automation artifacts using real Studio-exported templates and comprehensive reference documentation. Template baseline: Studio 24.10 Windows.
Hard Rule: Never Write .xaml by Hand
If you are about to use the Write tool with a .xaml extension, STOP. Every .xaml file in this skill MUST come from python -m uipath_core.scaffold_project or python scripts/generate_workflow.py. Hand-written XAML bypasses lint rules 1–122 and produces unrunnable workflows. If generator output is wrong, fix the JSON spec — do not edit .xaml manually except for narrow modify_framework.py operations.
This rule overrides any plan you would have produced from training memory.
Planning Workflow (read this BEFORE drafting any plan)
When the user hands you a PDD, requirements doc, or "build a UiPath project that does X" — STOP before drafting architecture. Read this section first; it overrides any plan you would have produced from training memory. The full text of every gate below lives in references/scaffolding.md § "Generating a Full Project" — this is the planner-side hoist.
PLAN SELF-CHECK — answer BEFORE presenting your plan to the user
- For EACH workflow in my plan: does it implement the PDD's specified approach, or did I substitute a "better" alternative? (e.g., InvokeCode SHA1 instead of browser automation of sha1-online.com) → If ANY substitution exists: REMOVE it and implement the PDD way. Propose the alternative AFTER.
- Does my plan include an explicit inspection step for EVERY target app? → Browser apps: "Inspect [app] with Playwright" (if Playwright MCP available) → Desktop apps: "Inspect [app] with PowerShell" (if PowerShell available on Windows) → If ANY app lacks an inspection step and the tool is available: ADD it now.
If you cannot answer YES to all checks, revise your plan before presenting it.
Echo-back requirement: the produced plan MUST contain a PLAN SELF-CHECK: block (in Phase 0 or as Phase 0.5) with two ✓ lines, one per box, naming the specifics — for example:
PLAN SELF-CHECK:
✓ No PDD substitutions — SHA1 computed via sha1-online.com browser flow as PDD specifies
✓ Phase 2 includes inspection for every target app: System1 + SHA1Online
For a single-app or non-UI process, the second line still appears — e.g. ✓ Phase 2 explicitly notes no UI inspection required (no browser/desktop apps in scope). A plan without this echo-back block is incomplete; revise before presenting.
PLAN OUTPUT FORMAT — present your plan using this structure
Phase 0: Architecture decision — Sequence vs Dispatcher+Performer (P-2); A-1 wiring
Phase 1: Workflows + arguments — one entry per .xaml with In/Out/InOut signatures
Phase 2: EACH app to inspect — one bullet per target app, e.g. "Inspect acme-test.com with Playwright"
Phase 2b: Write selectors.json (apps → screens → elements with taxonomy_type)
Phase 2c: generate_object_repository.py --from-selectors selectors.json --project-dir <each project>
Phase 2d: Pass --project-dir to every generate_workflow.py call (auto-wires obj_repo refs)
Phase 3: Generate sub-workflows ONE AT A TIME — validate_xaml --lint after EACH file
Phase 3b: modify_framework.py wire-uielement <project> <AppName> for EACH app with UI
Phase 3c: (Dispatcher only) wire SCAFFOLD.DISPATCHER_GET_ITEM marker — generate snippet first (G-3)
Phase 4: Wire Main.xaml — orchestration only, log bookends (A-7)
Phase 5: Project-level validation — validate_xaml <project_folder> --lint
Phase 6: Output Config.xlsx required keys grouped by sheet — validate_xaml --config-keys <project>
If Phase 2 is empty or missing, you are violating the skill rules. Even when no UI inspection is needed (no browser/desktop apps), state that explicitly: Phase 2: no UI inspection required (no browser/desktop apps in scope).
Per-phase reference anchors
| Phase | Read before completing |
|---|---|
| 0 | scaffolding.md → CRITICAL: Architecture Selection for PDDs (P-2) |
| 1 | decomposition.md → Universal Rules 1–8, naming + arguments (Rule 8 = credentials) |
| 2 | ui-inspection.md → Playwright MCP workflow + Login Gate (I-2); ui-inspection-reference.md for desktop |
| 2b | cheat-sheet.md → selectors.json schema |
| 2c | scripts/generate_object_repository.py (Lint 94 is ERROR if skipped) |
| 2d | generation.md → Wiring Object Repository References |
| 3 | cheat-sheet.md → JSON spec patterns; scripts/generate_workflow.py (Rules G-1, G-2) |
| 3b | scripts/modify_framework.py wire-uielement; decomposition.md § UiElement chain |
| 3c | scripts/modify_framework.py replace-marker SCAFFOLD.DISPATCHER_GET_ITEM (Rule G-3) |
| 4 | decomposition.md § Login/Launch + REFramework wiring; A-7 log bookends |
| 5 | scripts/validate_xaml <project> --lint |
| 6 | scripts/validate_xaml --config-keys <project>; config-sample.md |
Config layout rule of thumb
When listing required Config.xlsx keys (Phase 6), apply this rule before falling back to config-sample.md's decision flowchart:
- URLs, API endpoints, file/network paths, shared values across projects, or anything whose value may change frequently → Assets sheet. They are environment-specific, fetched from Orchestrator at
InitAllSettings, and admins update them without redeploying. If you expect the value to be tuned post-deployment (timeouts, thresholds, recipient lists, feature flags, batch sizes), it belongs here too — Settings/Constants require a redeploy to change. - Credential asset NAMES → Settings sheet. The string in the cell is just a name passed to
GetRobotCredential; storing it in Assets would trigger a needlessGetRobotAssetround-trip. The credential value itself never appears in Config.xlsx — fetch it at point of use. - Project identity (queue name, process name, processes-to-kill list) → Settings sheet. Local to the project, never changes per environment.
- Framework knobs (retry counts, log message templates) → Constants sheet. Identical across dev/staging/prod.
validate_xaml --config-keys <project> auto-classifies via this rule and emits a per-key reason — review the suggestion before manually editing Config.xlsx.
Compat-v2 (version-band) requirement — ENFORCED: every scaffold_project.py invocation MUST include --band <stable_year> (e.g., --band 25). To pick the band: run python scripts/resolve_nuget.py --all and read the major year of UiPath.System.Activities in the output — that's the latest stable. Available band profiles live under references/version-profiles/UiPath.System.Activities/<year>.<minor>.json. Every dependency MUST be resolved via python scripts/resolve_nuget.py <package> — no version literals from training memory (G-5). If project.json is generated without versionBand, lints 120–122 will REJECT it. The 23.10.x and 24.x bands are end-of-life and MUST NOT be used for new projects in 2026.
Final gate
If you are about to present an architectural plan and have NOT produced a Phase 2: inspection list with one entry per target app (or an explicit "no UI in scope" line), you are violating skill rules — go back and add Phase 2 first.
When To Read Which Reference
Start here. Match the user's task to the right file, then read only what's needed. For files > 200 lines, use grep or line-range reads — never read entire large files or XAML assets.
Common Tasks (check these first)
| Task | Read first |
|---|---|
| Generate a XAML workflow (any kind) | cheat-sheet.md → JSON spec patterns → scripts/generate_workflow.py (G-1) |
| Scaffold a project | scaffolding.md → Template Selection → run scripts/scaffold_project.py |
| Plan a new project (PDD → architecture) | scaffolding.md → PLAN SELF-CHECK & Phase 0–6 (READ BEFORE PLANNING) |
| Inspect a web app (selectors) | ui-inspection.md → Playwright MCP workflow → playwright-selectors.md |
| Validate XAML | Run scripts/validate_xaml <project> --lint |
| Fix a specific lint warning | lint-reference.md → search by lint number |
| Write an expression (VB.NET/C#) | expr-foundations.md (start here for any expression task) |
| Decomposition / project structure | decomposition.md → Decomposition rules (Universal 1-8, Browser 9-13, Desktop 14) |
| Fix a user's .xaml file | skill-guide.md → Example 6 |
| Tasks, form tasks | → uipath-tasks skill (read its SKILL.md) |
Activity-Specific Reference
| Task | File | Section guidance (for large files) |
|---|---|---|
| Pick the right activity for an intent | references/routing-index.md (auto-generated) |
Grep for the user's intent or the closest activity name. Don't guess generator names from filenames. |
| Core activities (Assign, Log, Delay, InputDialog) | xaml-foundations.md (165 lines) |
Read in full |
| Control flow (If, ForEach, While, Flowchart) | xaml-control-flow.md (208 lines) |
Read in full |
| DataTable ops, file system | xaml-data.md (255 lines) |
Grep for activity name |
| Error handling, TryCatch, Throw, RetryScope | xaml-error-handling.md (194 lines) |
Read in full |
| InvokeWorkflowFile, InvokeCode, InvokeMethod | xaml-invoke.md (175 lines) |
Read in full |
| Orchestrator, queues, HTTP, credentials | xaml-orchestrator.md (293 lines) |
Grep for activity name |
| Excel, Email, PDF activities | xaml-integrations.md (285 lines) |
Grep: ## Excel, ## Email, or ## PDF |
| Build/fix selectors | xaml-ui-automation.md (576 lines) |
Don't read in full. Grep: ## Selector Reference or specific selector type |
| UI automation XAML (NClick, NTypeInto, etc.) | xaml-ui-automation.md |
Selector guidance only. XAML generation via generate_workflow.py (G-1) |
Expression Reference (large files — use targeted reads)
| Task | File | Section guidance |
|---|---|---|
| DataTable expressions (Select, Compute, LINQ) | expr-datatable.md (432 lines) |
Grep: ## Select, ## Compute, ## LINQ, ## Filter |
| String/DateTime/numeric expressions | expr-strings-datetime.md (502 lines) |
Grep: ## String, ## DateTime, ## Numeric, ## Regex |
| JSON, collections, type conversions | expr-collections-json.md (462 lines) |
Grep: ## JSON, ## Dictionary, ## List, ## LINQ |
Project & Configuration
| Task | Read first |
|---|---|
| Choose template or variant | scaffolding.md → Choosing the Right Variant |
| Browser automation with Playwright | ui-inspection.md → Playwright MCP workflow |
| Desktop app inspection | ui-inspection.md → Desktop Inspection → ui-inspection-reference.md |
| Login/Launch pattern | decomposition.md → Login/Launch section |
| Config.xlsx keys and structure | config-sample.md → three-sheet reference, decision flowchart |
| Extract Config keys from project | Run validate_xaml <project> --lint — lint 39 |
| Lint regression tests | Run scripts/run_lint_tests.py |
| Ground rules (all rule definitions) | rules.md — single source of truth for G/I/A/P/S rules |
| project.json schema and configuration fields | scaffolding.md → Key project.json Configuration Fields |
Ground Rules
Full rule definitions with rationale:
references/rules.md. Rules below are referenced by ID.
- G-4 — Never generate XAML from scratch. Copy from closest template and modify.
- G-5 — Never guess NuGet package versions. Run
scripts/resolve_nuget.py. - G-1 — ⛔ Create .xaml files ONLY via
scripts/generate_workflow.py. Never hand-write. Seegeneration.md§ Workflow Generation CLI. - P-1 — Follow the PDD exactly. Implement the specified approach faithfully — propose alternatives separately.
- P-2 — Architecture selection: PDD describes BOTH reading AND processing items? → Dispatcher + Performer. See
scaffolding.md. - A-5 — Modular decomposition. Break into
Workflows/<AppName>/subfolders. Seedecomposition.md. - I-2 — ⛔ HALT at login gates during Playwright inspection. End your response, wait for user.
- G-3 — ⛔ Framework wiring: GENERATE FIRST, WIRE SECOND. Snippets MUST come from generator output. See
scaffolding.mdPhase 3c. - G-2 — ⛔ JSON specs: WRITE TO DISK, NEVER INLINE. See
cheat-sheet.md§ type keys for valid types.
CRITICAL: Project Context Check (Always Do This First)
Before generating ANY XAML, determine project context:
A) project.json EXISTS (inside existing project):
- Generate the .xaml file inside the project directory
- Check
dependencies— add missing NuGet packages:python3 scripts/resolve_nuget.py --add <project_dir> PackageName
B) project.json DOES NOT EXIST:
- Scaffold first — a standalone .xaml is useless without project.json
- Use
scripts/scaffold_project.py(seescaffolding.md) - Do NOT create the project folder before scaffolding. The script creates
<o>/<n>/automatically. Pre-creating causes duplicate nesting.
Capabilities
- Generate XAML workflow files — copy from real Studio exports and modify
- Scaffold UiPath projects — Simple sequence, REFramework Dispatcher, or REFramework Performer
- Write expressions — VB.NET and C# for UiPath activities (LINQ, DataTable, JSON, DateTime, etc.)
- Build selectors — strict, fuzzy, dynamic, wildcard, regex selectors for web/desktop/SAP
- HTTP API integration — OAuth token flows, retry policies, query parameters, response handling
- Tasks tasks — → Fully decoupled to uipath-tasks skill (generators, lint rules, scaffold hooks all live in
uipath-tasks/extensions/, loaded viaplugin_loader.py) - UI automation — NApplicationCard, NClick, NTypeInto, NSelectItem, NGetText, Extract Table Data, Check App State — via
scripts/generate_activities - Error handling & workflow — TryCatch, RetryScope, Throw/Rethrow, InvokeWorkflowFile, AddQueueItem, GetRobotCredential, BuildDataTable, IfElseIfV2, MultipleAssign — via
scripts/generate_activities - File system operations — Copy/Move/Delete files, Create Directory, Path Exists
- Invoke Code/Method — inline C#/VB.NET code blocks, instance/static method calls
Reference Files
| File | Coverage |
|---|---|
references/xaml-foundations.md |
XAML file structure, namespace declarations, core activities (Assign, Log, InputDialog, MessageBox, Delay), variable & argument declarations |
references/xaml-control-flow.md |
If, IfElseIf, ForEach, ForEachRow, While, DoWhile, Break/Continue, ForEachFile, Flowchart, State Machine, annotations |
references/xaml-data.md |
BuildDataTable, AddDataRow, FilterDataTable, MergeDataTable, SortDataTable, OutputDataTable, JoinDataTables, LookupDataTable, DeserializeJSON, file system ops |
references/xaml-error-handling.md |
TryCatch, Throw/Rethrow, exception types, RetryScope (incl. NCheckState condition) |
references/xaml-invoke.md |
InvokeWorkflowFile, InvokeCode, InvokeMethod |
references/xaml-orchestrator.md |
GetRobotAsset, GetRobotCredential, AddQueueItem, GetQueueItem, SetTransactionStatus, HTTP Request. Tasks → uipath-tasks skill |
references/xaml-integrations.md |
Excel Classic Workbook (ReadRange, WriteRange, WriteCell), Email/Integration Service (GetIMAP, SendMail), PDF (ReadPDFText, ReadPDFWithOCR) |
references/xaml-ui-automation.md |
Selector construction, dynamic selectors, fuzzy/regex, anchor targeting, desktop frameworks, Version table. For XAML generation use generators — this file is for selector guidance and activity property reference. Large file — use grep or line-range reads. |
references/expr-foundations.md |
VB.NET + C# expression syntax, null safety patterns. Read first for any expression task |
references/expr-datatable.md |
DataTable operations: Select, Compute, filter, sort, lookup, merge, clone, column ops, row iteration. Large file — grep for section. |
references/expr-strings-datetime.md |
String (split, join, trim, replace, format), DateTime (parse, format, diff, business days), file/path, numeric, regex. Large file — grep for section. |
references/expr-collections-json.md |
Array/List, Dictionary, JSON (JObject, JArray, parse, query, build), LINQ on typed collections, type conversions, Queue Item. Large file — grep for section. |
references/routing-index.md |
Activity selection index — auto-generated from references/annotations/*.json. Maps user intent → generator with description + use_when per activity, plus a "don't auto-generate" section listing wizard-only activities. Consult this BEFORE guessing a generator name. Regenerate with uipath-core/scripts/generate_routing_index.py. |
references/golden-templates.md |
Template catalog — patterns extracted from each real template file |
references/scaffolding.md |
Template selection, NuGet mapping, XAML validation, project scaffolding (variants, dispatcher/performer, transaction types), full project generation checklist |
references/decomposition.md |
Naming conventions, decomposition rules (universal 1-8, browser 9-13, desktop 14), common process patterns, argument design, Login/Launch pattern, REFramework Init/Close, UiElement chain |
references/generation.md |
Object Repository, Workflow Generation CLI (JSON spec format, 104 core generators + plugin extensions), Activity Generators (usage pattern, what model provides vs what generators lock down) |
references/ui-inspection.md |
Playwright MCP workflow (login gate, 5-step process, element mapping), Desktop inspection (PowerShell, inspect-ui-tree.ps1, framework detection) |
references/skill-guide.md |
Index + examples. Routes to scaffolding/decomposition/generation/ui-inspection. Contains 7 worked examples + anti-example |
references/lint-reference.md |
85 lint rules by severity, searchable by lint number (core rules; plugins add more — uipath-tasks registers AC-26..AC-34) |
references/playwright-selectors.md |
Playwright MCP → UiPath selector mapping |
references/config-sample.md |
Config.xlsx three-sheet reference (Settings, Constants, Assets), key naming conventions, sheet placement decision flowchart, required keys output format |
references/cheat-sheet.md |
JSON spec patterns (multiple_assign, if, try_catch, foreach_row, pick_login_validation, filter_data_table, add_queue_item, selectors.json), modify_framework.py CLI+Python API, valid enum values, naming, quick rules |
references/cheat-sheet.md § Desktop Form-Filling |
Desktop form-filling: tab nav, idx selectors, save verification, data externalization |
references/ui-inspection-reference.md |
inspect-ui-tree.ps1 reference — UIA→UiPath property mapping, framework detection, WinForms |
references/rules.md |
Ground Rules Reference — single source of truth for all generation (G), inspection (I), architecture (A), PDD (P), SAP (S), and skill authoring (K) rules. Other docs reference by ID |
Scripts
All
scripts/paths below are relative to this skill's directory (.claude/skills/uipath-core/). Invoke from the skill root:cd .claude/skills/uipath-core && python3 scripts/<script>.py ...
| File | Purpose |
|---|---|
scripts/validate_xaml |
Validate generated XAML — structural checks + lint rules (core + plugin). Use --golden for asset templates. See lint-reference.md for full rule table. |
scripts/resolve_nuget.py |
Resolve real NuGet versions. Query UiPath feed for latest stable. Validate project.json. Add/update deps in existing project.json (--add). |
scripts/scaffold_project.py |
Scaffold UiPath projects (sequence / dispatcher / performer). Customizes Config.xlsx. Dispatcher replaces GetQueueItem with DataTable row indexing. |
scripts/config_xlsx_manager.py |
Add/list/validate Config.xlsx keys. Cross-references XAML Config() refs vs actual sheets. |
scripts/modify_framework.py |
Insert InvokeWorkflowFile into framework files, replace SCAFFOLD.* markers, wire UiElement argument chain (wire-uielement), add variables with auto type normalization (add-variables), replace placeholder expressions (set-expression). ⛔ G-8: Never Edit/Write .xaml directly — use this script or generate_workflow.py. |
scripts/generate_activities |
Deterministic XAML generators for 95 core activities. Locks down enums, versions, child elements. MANDATORY for NTypeInto, NClick, NGetText, NCheckState, NApplicationCard, etc. Plugin skills add more (e.g., Tasks, SAP WinGUI). |
scripts/generate_workflow.py |
Generate complete .xaml files from JSON specs. 104 core generators + plugin generators loaded via plugin_loader.py. Covers ALL activities including Pick login validation, TryCatch, ForEachRow, NExtractData, NCheckState. Pass --project-dir <project> to auto-wire Object Repository references (Reference=/ContentHash= on TargetAnchorable) from .objects/refs.json. ⛔ Do NOT write .xaml by hand — use this CLI instead. |
scripts/generate_object_repository.py |
Generate Object Repository (.objects/ tree). CLI: python3 generate_object_repository.py --from-selectors selectors.json --project-dir <dir>. Reads selectors.json (written during Playwright inspection) with full app/screen/element hierarchy. Lint 94 is ERROR — project cannot pass validation without populated Object Repository. |
scripts/inspect-ui-tree.ps1 |
Windows-only. Inspect desktop app UI tree via UIA API. Run via Bash (powershell -File). |
scripts/regression_test.py |
Regression tests — validates templates, scaffolding, naming conventions, line count accuracy, skill integrity |
scripts/run_lint_tests.py |
Lint regression: verifies bad XAML test cases trigger expected lints. Run after modifying lint rules. |
Battle-test scripts (manual-only)
scripts/battle_test_studio.py and scripts/battle_test_activities.py are NOT run by CI and have side-effects: they shell out to uip rpa create-project, scaffold real UiPath Studio Desktop projects under the system temp dir, and invoke Studio via IPC. Run them manually after generator changes (to confirm Studio still accepts the produced XAML) and before cutting a release. Requirements: UiPath Studio Desktop installed locally, @uipath/cli (npm i -g @uipath/cli) on PATH, and a free Studio editor process available for IPC. Pair with scripts/grade_battle_test.py to score the resulting projects.
Key Architecture Rules
Full definitions:
references/rules.md§ Architecture Rules (A-1 through A-12).
App initialization (A-1): ALL apps open and ready by end of InitAllApplications.xaml. Action workflows ONLY attach (OpenMode="Never"). Wire UiElement chain: python3 scripts/modify_framework.py wire-uielement <project> <AppName>.
Key constraints: no flat files in Workflows/ (must be in app subfolders), login stays inside AppName_Launch.xaml (no separate AppName_Login.xaml), navigation uses shared Utils/Browser_NavigateToUrl.xaml (A-6), persistence activities stay in Main.xaml (A-2), SetTransactionStatus.xaml never modified (A-4), dispatchers pass Nothing for in_TransactionItem.
Login/Launch Workflow Pattern
See decomposition.md → "Login/Launch Workflow Pattern" for the full recipe, required XAML structure, argument design, UiElement reference chain, and common mistakes. Key rule: login stays inside AppName_Launch.xaml — NEVER create a separate AppName_Login.xaml. Copy structure from golden sample WebAppName_Launch.xaml.
Quick Validation Reference
For detailed lint rules by number, see lint-reference.md. The most critical categories:
🔴 Studio crash — Inline Result= on modern activities, hallucinated enum values (AttachMode="ByUrl", Version="V3"/"V4", ElementType="InputBoxText"), missing xmlns declarations, hallucinated properties (NApplicationCard Url=, NCheckState Appears=, NTypeInto EmptyField=, AddQueueItem.SpecificContent). See cheat-sheet.md → Valid Enum Values.
🟡 Compile error / silent data loss — Wrong enum namespace (UIAutomation vs UIAutomationNext), C# syntax in Throw expressions, InteractionMode on activities that don't support it (only NClick/NTypeInto have it), QueueName= instead of QueueType=, empty Out/InOut argument bindings, direction tag mismatches.
🟢 Production / security — Credentials via GetRobotCredential inside the workflow (never as arguments), API/network wrapped in RetryScope, URLs from Config (never hardcoded), browser IsIncognito="True", log bookends on every workflow.
Desktop App Automation
When automating a desktop application (not browser/web):
Get the executable path first. Before generating NApplicationCard XAML, you MUST have the full
.exepath. Never use placeholders. ASK → STOP → WAIT. UWP apps use the package AppId.Desktop vs Browser differences: Desktop uses
TargetApp.FilePath(noBrowserType/Url/IsIncognito),InteractionMode=HardwareEventsorSimulate(NOTDebuggerApi). Selectors use<wnd app='...' />withautomationid,cls,aaname,roleattributes.Inspection is mandatory when PowerShell is available (Windows) — run
inspect-ui-tree.ps1BEFORE generating desktop XAML.WinForms tab names vs group box names: When
inspect-ui-tree.ps1shows a TabControl, children at depth 2 are TabItems (actual tab names for navigation). Children at depth 3 are GroupBoxes (visual containers INSIDE a tab, NOT navigation targets). Seedecomposition.md→ Rule 14 supplement andui-inspection-reference.md→ WinForms Tab Control Hierarchy.
Naming Conventions
Variables: camelCase with type prefix — strName, intCount, boolSuccess, dt_Report, dr_Row, arr_Files, dict_Config, dtmStart, dblAmount, jo_Response, secstrPassword, qi_Item, mm_Mail.
Arguments: {direction}_{typePrefix}{Name} — in_strUserName, out_boolSuccess, io_dt_Data.
Workflow files: PascalCase with underscores — WebApp_CreateRecord.xaml, App_Close.xaml.
See cheat-sheet.md → Naming Quick Reference for the full type prefix table.
Selectors — Always Default to Strict
Generators default to SearchSteps="Selector" (strict). Use FuzzySelector only when user requests or strict proven unreliable. Always populate BOTH FullSelectorArgument and FuzzySelectorArgument.
Tested Models
This skill is developed and tested with Claude Opus and Claude Sonnet. The prompt engineering (HALT semantics, routing table placement, urgency tiers) is Claude-optimized. Other LLMs may work but are untested — expect to adapt the prompt layer.
Open this reference as its own page
UiPath XAML Cheat Sheet
Quick-reference for generator commands and rules. For XAML output, always use generators — never hand-write activity XAML. Full 95-generator API with all parameters: see skill-guide.md § Activity Generators.
⛔ Workflow Creation: JSON Spec → .xaml (PRIMARY)
python3 scripts/generate_workflow.py spec.json Workflows/ACME/ACME_Launch.xaml --project-dir <project>
--project-dir auto-wires Object Repository references (Reference=/ContentHash= on TargetAnchorable) from .objects/refs.json. Always pass it after Object Repository generation.
Pre-validate specs (catches hallucinated types like Dictionary(String,Object) before generation):
python3 scripts/generate_workflow.py --validate-spec spec1.json spec2.json spec3.json
⛔ Rules G-1, G-2 — write spec to disk first, never hand-write .xaml. See rules.md for rationale and generation.md for full spec format.
Minimal spec:
{"class_name": "AppName_Action",
"arguments": [{"name": "io_uiApp", "direction": "InOut", "type": "UiElement"}],
"activities": [
{"gen": "log_message", "args": {"message_expr": "\"[START] AppName_Action\""}},
{"gen": "napplicationcard_attach",
"args": {"display_name": "App", "ui_element_variable": "io_uiApp"},
"children": [
{"gen": "nclick", "args": {"display_name": "Click 'Submit'", "selector": "<webctrl id='btn' tag='BUTTON' />"}}
]},
{"gen": "log_message", "args": {"message_expr": "\"[END] AppName_Action\""}}
]}
Argument/Variable Type Keys (short forms — ALWAYS use these)
Spec "type" |
XAML output | ⛔ NEVER use |
|---|---|---|
"String" |
x:String |
|
"Int32" |
x:Int32 |
|
"Int64" |
x:Int64 |
|
"Boolean" |
x:Boolean |
|
"Double" |
x:Double |
|
"Decimal" |
x:Decimal |
|
"Object" |
x:Object |
|
"DateTime" |
s:DateTime |
|
"TimeSpan" |
s:TimeSpan |
|
"SecureString" |
ss:SecureString |
|
"UiElement" |
ui:UiElement |
|
"QueueItem" |
ui:QueueItem |
|
"GenericValue" |
ui:GenericValue |
|
"DataTable" |
sd:DataTable |
|
"DataRow" |
sd:DataRow |
|
"Dictionary" |
scg:Dictionary(x:String, x:Object) |
Dictionary(String,Object) |
"Array_String" |
s:String[] |
|
"Array_Int32" |
s:Int32[] |
|
"Array_Object" |
s:Object[] |
|
"JObject" |
njl:JObject |
|
"JArray" |
njl:JArray |
|
"MailMessage" |
snm:MailMessage |
The generator auto-maps these 22 shortcuts. Using long-form types like Dictionary(String,Object) crashes Studio.
JSON Spec Patterns (common trip-ups)
multiple_assign — assignments is array of [target, expression] pairs:
{"gen": "multiple_assign", "args": {
"display_name": "Extract Fields",
"assignments": [
["strClientID", "strRaw.Split({\"Client ID:\",\"Client Name:\"}, StringSplitOptions.None)(1).Trim()"],
["strHash", "strRawResult.Trim()"]
]
}}
assign — single assignment:
{"gen": "assign", "args": {"to_variable": "strUrl", "value_expression": "String.Format(\"{0}/login\", in_strBaseUrl)"}}
nselectitem — item_variable is a VB expression (quoted string for literal):
{"gen": "nselectitem", "args": {"display_name": "Select 'Completed'", "selector": "<webctrl id='status' tag='SELECT' />", "item_variable": "\"Completed\""}}
if — uses then_children / else_children (not then_content):
{"gen": "if", "args": {"condition_expression": "String.IsNullOrEmpty(strValue)"},
"then_children": [{"gen": "throw", "args": {"exception_expression": "New BusinessRuleException(\"Empty value\")"}}],
"else_children": [{"gen": "log_message", "args": {"message_expr": "\"Value: \" & strValue"}}]}
try_catch — uses try_children, catches array with children:
{"gen": "try_catch", "args": {"catches": [{"exception_type": "System.Exception", "name": "ex"}]},
"try_children": [{"gen": "log_message", "args": {"message_expr": "\"Trying...\""}}]}
foreach_row — uses children for body:
{"gen": "foreach_row", "args": {"datatable_variable": "dt_WorkItems", "row_variable": "row"},
"children": [{"gen": "log_message", "args": {"message_expr": "row(\"WIID\").ToString"}}]}
pick_login_validation — inside napplicationcard_open children. REQUIRED: spec must declare variables strErrorText (String) and uiErrorElement (UiElement) — the generator references them internally:
{"gen": "pick_login_validation", "args": {
"success_selector": "<webctrl tag='H1' aaname='Dashboard' />",
"error_selector": "<webctrl tag='DIV' class='alert alert-danger' />"
}}
Spec variables must include: {"name": "strErrorText", "type": "String"} and {"name": "uiErrorElement", "type": "UiElement"}.
nextractdata — extract_metadata is REQUIRED (UiPath throws 'Value for required activity argument Extract metadata was not supplied' without it). Must contain <extract> XML with <row> and <column> definitions:
{"gen": "nextractdata", "args": {
"display_name": "Extract Data 'Work Items'",
"output_variable": "dt_WorkItems",
"extract_metadata": "<extract><row exact='1'><column exact='1' name='WIID' attr='innertext' tag='TD' /><column exact='1' name='Description' attr='innertext' tag='TD' /><column exact='1' name='Type' attr='innertext' tag='TD' /></row></extract>",
"extract_data_settings": "<extractSettings><setting name='TextProcessing' value='Exact text' /></extractSettings>",
"table_selector": "<webctrl tag='TABLE' id='theTable' />",
"next_link_selector": "<webctrl tag='A' aaname='Next' />",
"max_results": 0
}}
filter_data_table — datatable_variable (NOT source_datatable), filters are [col, op, value, bool_op] or [col, op, value, bool_op, type].
op must be a UiPath FilterOperator enum value (ALL CAPS): EQ, NE, LT, LE, GT, GE, CONTAINS, STARTS_WITH, ENDS_WITH, EMPTY, NOT_EMPTY. NOT symbolic operators (=, !=, <, > — crash) or mixed-case (Contains, IsEmpty — auto-normalized but use CAPS). For EMPTY/NOT_EMPTY: value is ignored. For numeric comparisons: add 5th element "x:Int32":
{"gen": "filter_data_table", "args": {
"datatable_variable": "dt_WorkItems",
"filters": [["Type", "EQ", "WI5", "And"], ["Status", "EMPTY", "", "And"], ["Count", "GT", "10", "And", "x:Int32"]],
"output_variable": "dt_Filtered"
}}
add_queue_item — queue_name_config (NOT queue_name_variable), item_fields is a dict {key: vb_expression}:
{"gen": "add_queue_item", "args": {
"queue_name_config": "in_Config(\"OrchestratorQueueName\").ToString",
"folder_path_config": "in_Config(\"OrchestratorQueueFolder\").ToString",
"item_fields": {"WIID": "strWIID", "ClientID": "strClientID"},
"reference_variable": "strWIID"
}}
Desktop App Launch (with path from argument)
{"gen": "napplicationcard_desktop_open", "args": {
"display_name": "Open AppName",
"file_path_variable": "in_strAppPath",
"out_ui_element": "out_uiAppName",
"target_app_selector": "<wnd app='appname.exe' title='App Title*' />"
},
"children": [...]
}
Important: Use in_strAppPath argument (not hardcoded path). Lint 104 warns on C:\Users\... paths.
invoke_workflow — JSON spec arguments format
Arguments is a dict of {arg_name: [direction, type, value_expression]} arrays (NOT dicts):
{"gen": "invoke_workflow", "args": {
"workflow_path": "Workflows\\AppName\\AppName_FillForm.xaml",
"display_name": "Invoke AppName_FillForm",
"arguments": {
"io_uiApp": ["InOut", "UiElement", "uiApp"],
"in_strFirstName": ["In", "String", "\"John\""],
"in_boolActive": ["In", "Boolean", "True"],
"out_strResult": ["Out", "String", "strResult"]
}
}}
⛔ NOT {"in_strName": {"direction": "In", "type": "String", "value": "..."}} — dict-of-dicts crashes at generation time.
Object Repository Binding in JSON Specs (Rule G-9)
After generate_object_repository.py produces refs.json, inject references into every UI activity spec:
{"gen": "nclick", "args": {
"display_name": "Click 'Login'",
"selector": "<webctrl tag='BUTTON' aaname='Login' />",
"obj_repo": {"reference": "LIB/ELEM", "content_hash": "HASH", "guid": "GUID"}
}}
obj_repokeys:reference,content_hash,guid— fromrefs.json → elements → "App/Screen/Element"obj_repo_appkeys:reference,content_hash— fromrefs.json → apps → "AppName"(for napplicationcard_open/desktop_open)- Skip
obj_repofor NCheckState targeting elements NOT in selectors.json (e.g., group box labels used as wait conditions)
selectors.json (Phase 2b — write after Playwright inspection)
python3 scripts/generate_object_repository.py --from-selectors selectors.json --project-dir ./CCSH_Dispatcher
{"apps": [{
"name": "ACME System 1",
"selector": "<html app='msedge.exe' title='ACME System 1*' />",
"browser_type": "Edge",
"screens": [
{"name": "Login", "url": "https://acme-test.example.com/login", "elements": [
{"name": "Email", "selector": "<webctrl id='email' tag='INPUT' />", "taxonomy_type": "Input"},
{"name": "Password", "selector": "<webctrl id='password' tag='INPUT' />","taxonomy_type": "Password"},
{"name": "LoginButton", "selector": "<webctrl tag='BUTTON' aaname='Login' />","taxonomy_type": "Button"},
{"name": "Dashboard", "selector": "<webctrl tag='H1' aaname='Dashboard' />","taxonomy_type": "Text"},
{"name": "ErrorMessage", "selector": "<webctrl tag='DIV' class='alert' />", "taxonomy_type": "Text"}
]},
{"name": "WorkItems", "url": "https://acme-test.example.com/work-items", "elements": [
{"name": "Table", "selector": "<webctrl tag='TABLE' />", "taxonomy_type": "Text"},
{"name": "NextPage", "selector": "<webctrl tag='A' aaname='>' />", "taxonomy_type": "Link"}
]}
]
}]}
taxonomy_type: Input | Password | Button | Dropdown | Link | CheckBox | RadioButton | Text
Desktop app selectors.json — use <ctrl> selectors with name and role for WinForms desktop controls:
{"apps": [{
"name": "MyCRM",
"selector": "<wnd app='mycrm.exe' title='My CRM*' />",
"screens": [
{"name": "PeopleTab", "elements": [
{"name": "FirstName", "selector": "<ctrl name='First' role='editable text' />", "taxonomy_type": "Input"},
{"name": "SaveButton", "selector": "<ctrl name='Save' role='push button' />", "taxonomy_type": "Button"}
]}
]
}]}
App type is auto-detected from selector prefix: <wnd> → desktop, <html> → browser. Override with "type": "desktop" or "type": "browser" if needed.
Tag-attribute mapping for desktop apps:
<wnd>tag:aaname,ctrlname,ctrlid,cls,app,title,idx<ctrl>tag:name,role,automationid,labeledby,text,idx<uia>tag:name,role,automationid,cls,idx
⚠️ aaname is ONLY valid on <wnd> tags. <ctrl> and <uia> use name instead.
Generator Quick Reference (for single-activity insertion into existing files)
from scripts.generate_activities import *
Pick the right generator with references/routing-index.md — auto-generated from
references/annotations/*.json, lists every activity with its description,
use_when, and (where authored) alternatives. Wizard-only activities are
listed in the "don't auto-generate" section so you can stop guessing.
For full generator signatures and parameter reference → generation.md § Activity Generators.
The previously hand-maintained "most-used generators" table that lived here was
removed in favor of the auto-generated index — it covered 14 of 95 generators
and rotted whenever new ones landed.
Framework Wiring (modify_framework.py)
⛔ Rule G-3 — all XAML snippets passed to insert-invoke/replace-marker MUST come from generator output. Never hand-write, especially for FilterDataTable, AddQueueItem, BuildDataTable, NExtractData, or TryCatch.
⛔ Snippet argument = XAML content, never a file path. modify_framework.py validates that the snippet is actual XML and rejects file paths, JSON, or other non-XAML text.
CLI commands (use these — don't import Python functions directly):
# Wire UiElement chain (adds arguments across Init→Main→Process→Close)
python3 scripts/modify_framework.py wire-uielement <project_dir> <AppName>
# Insert XAML snippet before </Sequence> in framework file
python3 scripts/modify_framework.py insert-invoke <filepath> <xaml_snippet>
# Replace a SCAFFOLD marker with XAML content
python3 scripts/modify_framework.py replace-marker <filepath> <marker_name> <xaml_snippet>
# Add variables to a framework file (creates Sequence.Variables block if needed)
python3 scripts/modify_framework.py add-variables <filepath> varName1:x:String varName2:x:Int32 ...
# List available markers in a file
python3 scripts/modify_framework.py list-markers <filepath>
⛔ NEVER add variables to framework files via Write/Edit tool. Use add-variables — it handles indent, creates the <Sequence.Variables> block if missing, and skips duplicates.
Python API (only if CLI isn't enough — use correct names):
from scripts.modify_framework import cmd_insert_invoke, cmd_replace_marker, cmd_wire_uielement, cmd_add_variables
# ⛔ NOT insert_invoke_before_close, NOT replace_marker (these don't exist)
Generator Python API gotchas (when calling from helper scripts):
# gen_if: condition_expression (NOT condition), NO then_sequence_idref
gen_if(condition_expression='x > 0', id_ref='If_1', then_content=body, else_content='')
# gen_multiple_assign: assignments is list of [target, expression] ARRAYS
gen_multiple_assign(assignments=[["strA", "row(\"Col\").ToString"]], id_ref='MA_1')
# gen_invoke_workflow: use raw strings for Windows paths, types need x: prefix
# arguments is a DICT: {arg_name: (direction, type, value_expression)}
gen_invoke_workflow(workflow_path=r'Workflows\Utils\App_Close.xaml', ...,
arguments={"in_strUrl": ("In", "x:String", "in_Config(\"Url\").ToString"), "io_uiApp": ("InOut", "ui:UiElement", "io_uiApp")})
# ⛔ NOT "String" → must be "x:String". NOT "UiElement" → must be "ui:UiElement"
# ⛔ NOT a list of tuples → must be a dict keyed by argument name
# gen_filter_data_table: datatable_variable (NOT source_datatable)
gen_filter_data_table(datatable_variable='dt_Data', filters=[...], id_ref='FDT_1')
# gen_add_queue_item: queue_name_config (NOT queue_name_variable), item_fields is a DICT (NOT list/fields/items)
gen_add_queue_item(queue_name_config='in_Config("OrchestratorQueueName").ToString', id_ref='AQI_1',
item_fields={"WIID": "strWIID", "ClientID": "strClientID"})
Variable names: Pass BARE names (no brackets). Generators wrap automatically: "strEmail" → Text="[strEmail]"
Selectors: Pass raw selector strings: "<webctrl tag='INPUT' id='email' />" → XML-escaped in TargetAnchorable
Object Repository: Pass obj_repo=refs["elements"]["AppName/ScreenName/ElementName"] to bind activities to the Object Repository. Pass obj_repo_app=refs["apps"]["AppName"] to gen_napplicationcard_open(). Call generate_object_repository(apps, project_dir) after scaffold_project() to create .objects/ tree.
Usage Examples
# Login workflow body
body = gen_getrobotcredential("in_strCredentialName", "strUsername", "secstrPassword", "GetRobotCredential_1")
body += "\n" + gen_ntypeinto("Type Into 'Email'", "<webctrl tag='INPUT' type='email' />", "strUsername", "NTypeInto_1", scope)
body += "\n" + gen_ntypeinto("Type Into 'Password'", "<webctrl tag='INPUT' type='password' />", "secstrPassword", "NTypeInto_2", scope, is_secure=True)
body += "\n" + gen_nclick("Click 'Login'", "<webctrl tag='BUTTON' aaname='Login' />", "NClick_1", scope)
# Wrap in NApplicationCard
card = gen_napplicationcard_open("Edge WebApp", "in_strAppUrl", "out_uiWebApp", scope, "NApplicationCard_1", body, "Sequence_2")
Valid Enum Values (crash if wrong)
| Attribute | Valid | ❌ Hallucinated |
|---|---|---|
AttachMode |
SingleWindow, ByInstance |
ByUrl |
OpenMode |
Always, IfNotOpen, Never |
|
CloseMode |
Always, Never, IfOpenedByAppBrowser |
|
InteractionMode |
DebuggerApi, Simulate, WindowMessages, HardwareEvents, SameAsCard |
Hardware |
Version (NApplicationCard) |
V2, V1 |
V3, V4 |
Version (NClick/NCheck/NTypeInto/NGetText/NCheckState) |
V5 |
|
Version (TargetAnchorable) |
V6 |
Naming Quick Reference
| Type | Variable | In Arg | Out Arg |
|---|---|---|---|
| String | strName |
in_strName |
out_strName |
| Int32 | intCount |
in_intCount |
out_intCount |
| Boolean | boolSuccess |
in_boolFlag |
out_boolSuccess |
| DataTable | dt_Report |
in_dt_Data |
out_dt_Report |
| DataRow | dr_Row |
in_dr_Row |
out_dr_Row |
| Array/List | arr_Files / list_Items |
in_arr_Files |
out_list_Items |
| Dictionary | dict_Config |
in_dict_Config |
out_dict_Config |
| DateTime | dtmStart |
in_dtmDeadline |
out_dtmStart |
| Double/Decimal | dblAmount / decPrice |
in_dblAmount |
out_decPrice |
| JObject/JArray | jo_Response / ja_Results |
in_jo_Data |
out_ja_Results |
| SecureString | secstrPassword |
— | — |
| UiElement | uiWebApp |
in_uiApp |
out_uiWebApp |
| MailMessage | mm_Mail |
in_mmMail |
— |
| QueueItem | qi_Item |
— | — |
Workflow files: PascalCase with underscores — WebApp_CreateRecord.xaml, App_Close.xaml, Api_FetchInvoices.xaml
Quick Rules
XAML syntax (crash if wrong):
- Enum namespace:
UiPath.UIAutomationNext.Enums— NOTUIAutomation.Enums. Do NOT "fix"UIAutomationNextwhen copying templates - Child element for target:
.Target>— NEVER.TargetAnchorable>(that's the TYPE, not the element name) - NTypeInto:
ClickBeforeMode(notClickBeforeTyping),EmptyFieldModevalid values:None,SingleLine,MultiLine(NOTClear— crashes Studio) - Child activity
InteractionMode:SameAsCard— NOT a specific mode likeSimulate - SearchSteps: default
"Selector"(strict)."FuzzySelector"only when strict proven unreliable - Throw:
[New BusinessRuleException("msg")](VB.NET) — NOT C#throw new - Passwords:
SecureText=— neverText= - AddQueueItem:
.ItemInformation— NEVER.SpecificContent - BuildDataTable:
TableInfo="..."XSD — NEVER.Columns/DataTableColumnInfo - Launch workflows: NO NGoToUrl —
NApplicationCard OpenMode="Always"+TargetApp Url=opens the browser at the URL
Architecture (full definitions: rules.md § A-1 through A-12, P-1 through P-3, I-1 through I-4):
- Browser defaults:
IsIncognito="True",InteractionMode="Simulate",AttachMode="SingleWindow"(A-9) - Desktop defaults: NO IsIncognito,
SimulateorHardwareEvents,AttachMode="ByInstance"(A-9) - URLs from Config (A-8), credentials inside workflow (A-3), API/network RetryScope (A-11)
- Navigation: generic
Browser_NavigateToUrl.xaml(A-6). One browser per web app (A-10) - App close:
App_Close.xamlONLY from CloseAllApplications. CloseAll ≠ KillAll (lint 65) - REFramework: never modify SetTransactionStatus (A-4). PDD adherence (P-1)
- Playwright: READ-ONLY (I-1), login gate → HALT (I-2)
- After generating: Config.xlsx keys grouped by sheet, run
validate_xaml --lint
Desktop Form-Filling Patterns
Patterns for automating WinForms/WPF desktop apps. For web automation see xaml-ui-automation.md.
Tab Navigation (Rule 14): Desktop navigation is a separate workflow from screen action — same principle as browser rule 9. Create AppName_NavigateToScreen.xaml (clicks tab/menu + waits) and AppName_FillScreen.xaml (fills fields only). Use ncheckstate to verify the target tab loaded — never use Delay.
Navigate workflow (DesktopApp_NavigateToCompanyTab.xaml):
{"gen": "nclick", "args": {"display_name": "Click 'Company' Tab", "selector": "<ctrl name='Company' role='tab item' />"}},
{"gen": "ncheckstate", "args": {"display_name": "Wait for Company tab fields", "selector": "<ctrl name='CompanyName' role='editable text' />", "if_exists_children": [{"gen": "log_message", "args": {"message_expr": "\"Company tab loaded\"", "level": "Trace"}}], "if_not_exists_children": [{"gen": "throw", "args": {"exception_expression": "New TimeoutException(\"Company tab did not load within timeout\")"}}]}}
IMPORTANT: Always provide if_not_exists_children with a Throw in navigation/wait NCheckState patterns. Empty IfNotExists = silent failure (lint 111).
Fill workflow (DesktopApp_FillCompanyTab.xaml) — no tab click, just fields:
{"gen": "ntypeinto", "args": {"display_name": "Type Into 'CompanyName'", "selector": "...", "text_variable": "in_strCompanyName"}}
CheckBox Handling: Use ncheck (NOT nclick) for checkboxes. NCheck is idempotent: Action="Check" on an already-checked box does nothing. NClick toggles state and is not deterministic (lint 112). When taxonomy_type is "CheckBox", always use the ncheck generator.
{"gen": "ncheck", "args": {"display_name": "Check Active", "selector": "<ctrl name='Active' role='check box' />", "action": "Check"}}
Index-Based Selector Mitigation: WinForms often doesn't expose ctrlname/AutomationId. Use UI Explorer in Studio to find them, scope with parent container title, document fragile selectors, test on different data states.
Save/Submit Verification: Click Save → NCheckState for error dialog → Throw on error, log on success. Lint 103 warns on UI-heavy workflows without TryCatch.
Desktop App Launch: Use napplicationcard_desktop_open with file_path_variable from InArgument — never hardcode C:\Users\.... Lint 104 catches this.
Desktop Scaffold: When scaffolding a desktop-only project, always pass target="desktop" to scaffold_project.py to exclude browser utilities (Browser_NavigateToUrl.xaml). The default target="both" includes browser utils that will be flagged by lint 102 (orphaned workflow).
Error Handling: Wrap the entire UI block in TryCatch (Lint 103). Catch block should log the error and take a screenshot via take_screenshot_and_save.
Hallucinated Properties (Common LLM Mistakes)
These property names look plausible but crash Studio. Generators avoid all of these automatically.
NApplicationCard Url=→ use<uix:TargetApp Url=...>child.TargetAnchorable Selector=→ useFullSelectorArgument=.<uix:Selector>→ doesn't existNCheckState Appears=→ use.IfExists/.IfNotExistschildren.<uix:NClick.TargetAnchorable>→ child is.Target>not.TargetAnchorable>NTypeInto ClickBeforeTyping=/EmptyField=→ useClickBeforeMode/EmptyFieldModeAddQueueItem.SpecificContent→.ItemInformation..ItemInformationwith singleInArgument x:TypeArguments="scg:Dictionary(...)"→ crash. Use flat<InArgument x:TypeArguments="x:String" x:Key="Name">[value]</InArgument>entries directly under.ItemInformationBuildDataTable.Columns/DataTableColumnInfo→ don't exist, useTableInfoXSD.MultipleAssign.Body/AssignOperationSet/MultipleAssignBody/AssignItem→ don't exist. Correct:.AssignOperations>scg:List x:TypeArguments="ui:AssignOperation">ui:AssignOperation(lint 52)FilterDataTable.FilterRowsCollection→.Filters.FilterOperationArgument ColumnName=→ doesn't exist, use.Columnchild element withInArgument.FilterOperationArgument Value=→ doesn't exist, use.Operandchild element withInArgument.FilterOperationArgument Operand="EQ"(operator as Operand attr) → wrong,Operator="EQ"is the attribute for the comparison operator,.Operandis the child element for the value being compared against. ALWAYS usegen_filter_data_table()— never hand-write FilterDataTable XAML.
Open this reference as its own page
Config.xlsx — Three-Sheet Reference
UiPath REFramework projects use Data/Config.xlsx with three sheets: Settings, Constants, and Assets. The scaffold script copies the template with framework defaults. When generating workflows, add all project-specific keys to the correct sheet.
How InitAllSettings.xaml Processes Config.xlsx
- Reads Settings + Constants sheets → stores each row's Name/Value directly into the
Configdictionary - Reads Assets sheet → for each row, calls
GetRobotAssetwith theAssetcolumn value from Orchestrator → stores the result inConfigunder theNamecolumn key - Assets always overwrite Settings/Constants if the same Name exists (by design — Orchestrator is the source of truth for environment-specific values)
All three sheets merge into a single Config dictionary — workflows access any key the same way: Config("KeyName").ToString.
Sheet 1: Settings (project identity & credential references)
Purpose: Values that identify the project within Orchestrator and reference credential assets by name. These are local to the Excel file, don't require API calls, and rarely change once deployed.
| Column | Description |
|---|---|
| Name | Config dictionary key |
| Value | Local value (string, number, or boolean) |
| Description | Human-readable explanation |
Framework defaults (auto-generated by scaffold)
| Name | Value | Description |
|---|---|---|
OrchestratorQueueName |
MyQueue |
Queue name — must match Orchestrator |
OrchestratorQueueFolder |
Shared |
Orchestrator folder containing the queue |
logF_BusinessProcessName |
MyProcess |
Process name for logging |
ProcessesToKill |
msedge;EXCEL |
Semicolon-separated process names killed at Init and End. Used by KillAllProcesses.xaml |
Project-specific keys (you add these)
| Name | Value | Description |
|---|---|---|
WebApp_CredentialAssetName |
WebApp_Credential |
Orchestrator Credential asset name for WebApp login |
API_CredentialAssetName |
API_Credential |
Orchestrator Credential asset name for API auth |
HRPortal_CredentialAsset |
HRPortal_Credential |
Orchestrator Credential asset name for HR Portal |
Why credentials stay in Settings: CredentialAssetName entries are just name strings passed to GetRobotCredential inside the workflow that needs them. Putting them in Assets would trigger an unnecessary GetRobotAsset call just to fetch a string that never changes per environment. The actual secret retrieval happens via GetRobotCredential at the point of use.
Sheet 2: Constants (immutable framework values)
Purpose: Values that never change regardless of environment (dev/staging/prod). Framework behavior, log message templates, retry configuration.
| Column | Description |
|---|---|
| Name | Config dictionary key |
| Value | Immutable value |
| Description | Human-readable explanation |
Framework defaults (auto-generated by scaffold)
| Name | Value | Description |
|---|---|---|
MaxRetryNumber |
0 |
Must be 0 for Orchestrator queues; >0 for local retry |
MaxConsecutiveSystemExceptions |
0 |
Consecutive system exceptions before stopping (0 = disabled) |
ExScreenshotsFolderPath |
Exceptions_Screenshots |
Screenshot save path (relative or absolute) |
RetryNumberGetTransactionItem |
2 |
Retries for GetTransactionItem activity |
RetryNumberSetTransactionStatus |
2 |
Retries for SetTransactionStatus activity |
ShouldMarkJobAsFaulted |
False |
Mark job as Faulted on init error or max consecutive exceptions |
LogMessage_GetTransactionData |
Processing Transaction Number: |
Log message prefix |
LogMessage_GetTransactionDataError |
Error getting transaction data... |
Log message prefix |
LogMessage_Success |
Transaction Successful. |
Log message |
LogMessage_BusinessRuleException |
Business rule exception. |
Log message |
LogMessage_ApplicationException |
System exception. |
Log message |
ExceptionMessage_ConsecutiveErrors |
The maximum number of... |
Error message |
Project-specific constants (add when needed)
| Name | Value | Description |
|---|---|---|
MaxLoginAttempts |
3 |
Fixed retry limit for app login |
TransactionTimeoutMinutes |
10 |
Hard timeout per transaction |
Rule of thumb: If the value would be identical in dev, staging, and production, it belongs in Constants.
Sheet 3: Assets (Orchestrator-managed, environment-specific)
Purpose: Values fetched from Orchestrator Assets at runtime. Use for anything that changes between environments, is shared across multiple automations, or that admins need to update without redeploying.
| Column | Description |
|---|---|
| Name | Config dictionary key (how workflows reference it) |
| Asset | Orchestrator Asset name (what InitAllSettings fetches) |
| OrchestratorAssetFolder | Orchestrator folder containing the asset (blank for default) |
| Description | Note: "Assets will always overwrite other config" |
Project-specific keys (you add these)
| Name | Asset | OrchestratorAssetFolder | Description |
|---|---|---|---|
WebApp_Url |
WebApp_ApplicationUrl |
Shared |
the target web application login URL |
WebApp_BaseUrl |
WebApp_BaseUrl |
Shared |
WebApp base URL for dynamic page construction |
WebApp_CreateTaskUrl |
WebApp_CreateTaskUrl |
Shared |
Direct URL to create task page |
SHA1Online_Url |
SHA1Online_Url |
Shared |
SHA1 Online tool URL |
API_BaseUrl |
API_BaseEndpoint |
Shared |
REST API base endpoint |
DownloadFolder |
Process_DownloadFolder |
Download folder path (varies per machine/env) | |
ReportOutputPath |
Process_ReportOutputPath |
Report output path | |
EmailRecipients |
Process_EmailRecipients |
Shared |
Notification recipients (shared across projects) |
What belongs in Assets
- URLs and endpoints — application URLs, API base URLs, page-specific URLs (different per environment)
- File/network paths — download folders, output paths, shared drives (different per machine/env)
- Shared configuration — values used by multiple automations (email recipients, department codes)
- Admin-tunable values — timeouts, thresholds, feature flags that admins adjust without redeploying
- Environment-specific identifiers — server names, database connection strings (name only, not credentials)
What does NOT belong in Assets
- Credentials — use
GetRobotCredentialdirectly (Credential asset type, not Text asset) - Credential asset names — just strings, keep in Settings to avoid unnecessary API calls
- Framework constants — retry counts, log messages (never change per environment)
- Queue/process identity —
OrchestratorQueueName,logF_BusinessProcessName(project-bound)
How Config Is Used in Workflows
Retrieval: Config("KeyName").ToString — Config values are Object type, always call .ToString for string operations. Works identically regardless of which sheet the key came from.
Passed via arguments: Main.xaml reads Config, passes values to sub-workflows:
InvokeWorkflow: WebApp_Launch.xaml
in_strUrl = Config("WebApp_Url").ToString
in_strCredentialAssetName = Config("WebApp_CredentialAssetName").ToString
Dynamic URLs: Concatenate base URL with runtime values:
strTargetUrl = String.Format("{0}/work-item/{1}", Config("WebApp_BaseUrl").ToString, strWIID)
Key Naming Convention
| Pattern | Example | Sheet | Use for |
|---|---|---|---|
AppName_Url |
WebApp_Url |
Assets | App login/home URL |
AppName_BaseUrl |
WebApp_BaseUrl |
Assets | Base URL for dynamic page construction |
AppName_PageUrl |
WebApp_CreateTaskUrl |
Assets | Direct URL to specific page |
API_BaseUrl |
API_BaseUrl |
Assets | REST API base endpoint |
AppName_CredentialAssetName |
WebApp_CredentialAssetName |
Settings | Orchestrator Credential asset name |
OrchestratorQueueName |
OrchestratorQueueName |
Settings | Queue identity |
MaxRetryNumber |
MaxRetryNumber |
Constants | Framework retry config |
Required Config.xlsx Keys Output
After generating workflows, always list the Config.xlsx keys the user needs to add, grouped by sheet:
Required Config.xlsx entries:
Settings sheet:
WebApp_CredentialAssetName — Orchestrator Credential asset for WebApp login
Assets sheet:
WebApp_Url — the target web application login URL (Asset: WebApp_ApplicationUrl)
WebApp_BaseUrl — WebApp base URL for dynamic pages (Asset: WebApp_BaseUrl)
SHA1Online_Url — SHA1 Online tool URL (Asset: SHA1Online_Url)
Constants sheet:
(none — framework defaults sufficient)
This helps the user set up both Config.xlsx and the corresponding Orchestrator Assets before running the automation.
Decision Flowchart
Is this a credential (password, API key, secret, token)?
→ YES: Don't put in Config.xlsx at all. Use GetRobotCredential directly.
Is this the NAME of a credential asset?
→ YES: Settings sheet (just a string, no API call needed)
Does this value change between dev/staging/prod environments?
→ YES: Assets sheet (fetched from Orchestrator)
Is this value shared across multiple automations?
→ YES: Assets sheet (single source of truth in Orchestrator)
Could an admin need to change this without redeploying?
→ YES: Assets sheet
Is this a framework constant (retry count, log message, path template)?
→ YES: Constants sheet
Is this project identity (queue name, process name)?
→ YES: Settings sheet
Open this reference as its own page
Workflow Decomposition Patterns
Naming conventions, decomposition rules, common process patterns, argument design, Login/Launch pattern, and REFramework Init/Close. For scaffolding see scaffolding.md. For XAML generation see generation.md.
Every process must be decomposed into focused sub-workflows. Main.xaml orchestrates via InvokeWorkflowFile — it should never contain business logic, UI interactions, or data processing directly.
Naming Convention
Files follow AppName_Action.xaml pattern. All generated workflows go inside a Workflows/ folder. Subfolder name = the AppName prefix from the file names (the actual application name, never generic categories like "App1" or "GenericApp"):
ProjectRoot/
├── Main.xaml # Orchestrator only — InvokeWorkflow calls
├── Workflows/
│ ├── WebApp/ # Folder = app name "WebApp"
│ │ ├── WebApp_Launch.xaml # Open browser + login + wait for home page
│ │ └── WebApp_DownloadReport.xaml # Click download, wait, save file
│ ├── InventoryManager/ # Folder = app name "InventoryManager"
│ │ ├── InventoryManager_Launch.xaml
│ │ ├── InventoryManager_EnterRecord.xaml
│ │ └── InventoryManager_Close.xaml
│ ├── Email/ # Folder = "Email" (service, not an app)
│ │ ├── Email_GetMessages.xaml
│ │ └── Email_SaveAttachments.xaml
│ └── Utils/ # Shared utilities (no UI, cross-app)
│ ├── Browser_NavigateToUrl.xaml # Generic URL navigation (reusable across all browser apps)
│ ├── App_Close.xaml
│ ├── Process_TransformData.xaml
│ └── Process_ValidateReport.xaml
└── Framework/ # REFramework or shared framework files
Rules: Main.xaml stays at project root. Every other workflow goes in Workflows/<AppName>/ where <AppName> matches the file prefix. Utils/ is for cross-app utilities. InvokeWorkflowFile paths: "Workflows\\WebApp\\WebApp_Launch.xaml".
Decomposition Rules
Universal rules (all projects):
- One UI scope per workflow — each file works inside ONE
NApplicationCardor one app window. If you need to switch apps, that's a new workflow. - ≤150 lines per file — if a workflow exceeds this, split it. Long workflows are unreadable and untestable.
- Reusable navigation —
Workflows/Utils/Browser_NavigateToUrl.xamltakesin_strUrlandio_uiBrowseras arguments — always a FULL URL, never concatenated inside the workflow. URL-first: always navigate by URL (NGoToUrl) when possible, UI clicks as last resort. This is a shared utility used by all browser apps in the project — never create app-specific NavigateTo workflows.- Config pattern: Store base URL + path segments in Config.xlsx Assets sheet (environment-specific, fetched from Orchestrator):
WebApp_BaseURL=https://webapp-example.comWebApp_LoginPath=loginWebApp_WorkItemsPath=work-items
- Caller assembles full URL via
String.Format("{0}/{1}", in_Config("WebApp_BaseURL").ToString, in_Config("WebApp_LoginPath").ToString)in InvokeWorkflowFile arguments (useConfig(only in Main.xaml; everywhere else it'sin_Config() - Workflow receives complete URL in
in_strUrl— ⛔ NEVER concatenate insideUrl=attributes on NGoToUrl/TargetApp
- Config pattern: Store base URL + path segments in Config.xlsx Assets sheet (environment-specific, fetched from Orchestrator):
- ALL apps open and ready in InitAllApplications — every application the process interacts with (whether it requires login or just opening a URL) MUST be launched, logged in if needed, and in a ready-to-use state by the time InitAllApplications completes. Process.xaml and action workflows ONLY attach to already-open apps (
OpenMode="Never",AttachMode="SingleWindow",InUiElement="[io_uiAppName]"). They NEVER open, launch, or log into anything. Lint 47 catchesOpenMode != "Never"outside Launch workflows.- InitAllApplications delegates to
AppName_Launch.xamlsub-workflows (one per app) - Each Launch workflow: opens the app (
OpenMode="Always"), logs in if needed, validates login, outputsout_uiAppName - Simple apps (no login): Launch still opens the browser at the target URL — the UiElement must still flow through the chain
- Desktop apps: Launch opens the application, waits for ready state (Check App State), outputs UiElement
- Never inline app open/close inside business logic workflows — Launch/Close are shared across all processes using that app. In REFramework: every app with UI interaction MUST be opened in
InitAllApplications.xamlvia a dedicatedAppName_Launch.xamlworkflow (InvokeWorkflowFile). Login stays inside Launch — never create a separateAppName_Login.xaml. Launch handles: open app → login (if needed) → verify ready state. Process.xaml and action workflows useOpenMode="Never"+AttachMode="SingleWindow"to attach to the already-open app. Similarly,CloseAllApplications.xamlinvokesApp_Close.xamlorAppName_Close.xamlfor each app.
- InitAllApplications delegates to
- No UI in data workflows —
Process_TransformData.xamldoes DataTable operations, regex, calculations. Zero UI activities. - Persistence activities stay in Main.xaml —
WaitForFormTaskAndResume,CreateFormTask+wait pairs are persistence points. They ONLY work in the entry-point file. - Log bookends on every workflow — first and last activity:
LogMessage "[START/END] AppName_Action". Applies to Main.xaml AND all sub-workflows. - Credentials retrieved where used, NEVER passed as arguments —
GetRobotCredentialinside the workflow that uses them. Passin_strCredentialAssetName(the asset name string) — NEVER passin_strUsername/in_strPassword/in_secPassword.
Browser-specific rules (web app automation):
9. Navigation is a separate workflow from page action — first invoke Browser_NavigateToUrl.xaml (from Utils/), then invoke AppName_DoAction.xaml. Never combine "get there" and "do stuff" in one file. Never create app-specific NavigateTo workflows (WebApp_NavigateTo.xaml etc.) — the generic Browser_NavigateToUrl.xaml handles all URL navigation; the caller passes the full URL from Config. Wrap navigation invocations in RetryScope with NCheckState condition targeting the first element the next workflow will interact with (not a generic header) → see xaml-error-handling.md → NCheckState condition pattern.
10. No logout workflow — IsIncognito="True" is default, so closing the browser kills the session. Use generic App_Close.xaml (arg: in_uiApp InArgument(UiElement), CloseMode="Always") for BOTH web and desktop apps. Do NOT generate AppName_Logout.xaml workflows. App_Close.xaml is EXCLUSIVELY invoked from CloseAllApplications.xaml — NEVER from Process.xaml or action workflows. Apps stay open across transactions; the End Process state handles closing. CloseAllApplications invokes App_Close once per app — it must NOT contain KillProcess activities (that's KillAllProcesses' job).
11. One browser instance per web app — each web app gets its own incognito browser with a distinct UiElement variable in Main (e.g., uiWebApp, uiSHA1Online). Never share tabs across apps. Close each separately via App_Close.xaml (pass in_uiApp ← uiAppName). Action workflows and Process.xaml use IN/OUT args (io_uiWebApp) to preserve updated references.
12. Extraction workflows return ALL data — filtering is a separate step — AppName_ExtractData.xaml scrapes/reads the full dataset and outputs the raw DataTable. Filtering (e.g., Select("[Type] = 'WI5'"), status checks, date ranges) belongs in the calling workflow or a dedicated Process_FilterData.xaml. This keeps extraction reusable across projects that need different filter criteria. Never embed business-specific filters inside a generic extraction workflow.
13. Wrap API/network activities in RetryScope — any activity that calls a web service can fail transiently. Wrap in RetryScope (3 retries, 5s interval). Activities: AddQueueItem, BulkAddQueueItems, GetQueueItem, GetRobotAsset, GetRobotCredential, SetTransactionStatus, SetTransactionProgress, QueryEntityRecords. Exception: NetHttpRequest has built-in retry (RetryCount, RetryPolicyType, RetryStatusCodes properties) — do NOT wrap in RetryScope (redundant double-retry). Exception: REFramework Framework/ files use transaction-level retry. See cheat-sheet.md → RetryScope for complete XAML sample.
Desktop-specific rules (desktop app automation):
14. Desktop navigation is a separate workflow from screen action — for desktop apps with tabs, menus, tree views, or multi-screen flows, navigate to the target screen in a dedicated AppName_NavigateToScreen.xaml workflow, then invoke the action workflow AppName_FillScreen.xaml. Never mix "get to the screen" with "fill the form" in one file. Unlike browser apps (which use a single generic Browser_NavigateToUrl.xaml for all URL navigation), desktop navigation is app-specific — each navigation step gets its own workflow named AppName_NavigateTo<ScreenName>.xaml. The navigation workflow clicks the tab/menu/tree node and waits for the target screen to load (use NCheckState to verify a field on the target screen is visible). The action workflow assumes the screen is already active and only fills/reads fields.
WRONG — tab navigation mixed with form filling:
DesktopApp_FillPeopleTab.xaml
├── NClick 'People' Tab ← navigation
├── Delay 500ms ← fragile wait
├── NTypeInto 'FirstName' ← form action
└── NTypeInto 'LastName' ← form action
CORRECT — navigation and action are separate workflows:
Main.xaml (or Process.xaml)
├── InvokeWorkflow: DesktopApp_NavigateToPeopleTab.xaml (io_uiDesktopApp)
├── InvokeWorkflow: DesktopApp_FillPeopleTab.xaml (io_uiDesktopApp, in_strFirstName, in_strLastName)
Navigation is reusable (other workflows may also need to reach the People tab). Failures are pinpointed (tab click timeout vs field not found). Delays are replaced with NCheckState waits (reliable, not time-based).
WinForms Tab Detection Pitfall (Rule 14 supplement)
When inspecting a WinForms app with tabs via inspect-ui-tree.ps1, the tree shows ALL elements in the active tab's hierarchy. Do not confuse GroupBox names inside tabs with tab names.
The inspection tree shows:
[1] TabControl -> Click tab item
[2] === People === <- TabItem (depth 2 = child of TabControl)
[3] === Name: === <- GroupBox (depth 3 = INSIDE People tab)
[3] === Phone === <- GroupBox (depth 3 = INSIDE People tab, NOT a tab)
[3] === Address === <- GroupBox (depth 3 = INSIDE People tab, NOT a tab)
Reading the hierarchy:
- Depth 2 under TabControl = TabItems (navigation targets). These are the actual tab names you click.
- Depth 3 under a TabItem = GroupBoxes/containers (visual grouping inside that tab). Do NOT use these as tab names.
Critical: The PowerShell tree only expands the active tab. Other tabs appear as unexpanded TabItems at depth 2. If you only see one TabItem expanded with GroupBoxes inside, those GroupBoxes are containers inside that tab — not separate tabs.
To get all tab names: Look for ALL children of TabControl at depth 2, or ask the user to confirm the tab names listed in the application.
Wrong decomposition (used GroupBox names as tab names):
DesktopApp_NavigateToPhoneTab.xaml <- "Phone" is a GroupBox inside Company tab
DesktopApp_NavigateToAddressTab.xaml <- "Address" is a GroupBox inside Other tab
Correct decomposition (used actual TabItem names):
DesktopApp_NavigateToCompanyTab.xaml <- "Company" is the actual tab name
DesktopApp_NavigateToOtherTab.xaml <- "Other" is the actual tab name
The fill workflows can use descriptive names based on content: DesktopApp_FillCompanyTab.xaml fills phone fields that happen to be on the Company tab.
Common Process Patterns
Pattern: Web Report Download (simple sequence — NOT REFramework)
Main.xaml — variable: uiWebApp (type: UiElement)
├── InvokeWorkflow: Workflows\WebApp\WebApp_Launch.xaml (in_strUrl, in_strCredentialAssetName, out_uiWebApp → uiWebApp)
│ └── in_strUrl = Config("WebApp_Url").ToString — NEVER hardcode URLs
├── InvokeWorkflow: Workflows\Utils\Browser_NavigateToUrl.xaml (in_strUrl, io_uiBrowser ← uiWebApp)
│ └── in_strUrl = Config("WebApp_ReportsUrl").ToString
├── InvokeWorkflow: Workflows\WebApp\WebApp_DownloadReport.xaml (in_strReportName, out_strFilePath, io_uiWebApp ← uiWebApp)
├── InvokeWorkflow: Workflows\Utils\Process_ValidateReport.xaml (in_strFilePath, out_boolValid)
└── InvokeWorkflow: Workflows\Utils\App_Close.xaml (in_uiApp ← uiWebApp)
⚠️ App_Close in Main.xaml is ONLY valid for simple sequences. In REFramework, CloseAllApplications handles all app closing — NEVER invoke App_Close from Process.xaml or action workflows.
Pattern: Multiple Web Apps (Rule 11 — simple sequence or REFramework Main-level view)
Main.xaml — variables: uiWebApp, uiSHA1Online (both type: UiElement)
├── InvokeWorkflow: WebApp_Launch.xaml (in_strUrl, in_strCredentialAssetName, out_uiWebApp → uiWebApp)
├── InvokeWorkflow: Browser_NavigateToUrl.xaml (in_strUrl, io_uiBrowser ← uiWebApp) ← shared util
├── InvokeWorkflow: WebApp_GetWorkItems.xaml (out_dt_WorkItems, io_uiWebApp ← uiWebApp)
│
├── InvokeWorkflow: SHA1Online_Launch.xaml (in_strUrl, out_uiSHA1Online → uiSHA1Online) ← separate browser
├── InvokeWorkflow: SHA1Online_ComputeHash.xaml (in_strInput, out_strHash, io_uiSHA1Online ← uiSHA1Online)
│
├── InvokeWorkflow: WebApp_UpdateRecord.xaml (in_strHash, io_uiWebApp ← uiWebApp) ← back to WebApp browser
└── CloseAllApplications handles all closing (REFramework) or App_Close per app (simple sequence)
Each web app gets its own incognito browser. Never share tabs across different apps. UiElement arg directions: Launch = OUT (creates reference), action workflows = IN/OUT (preserves updates), App_Close = IN (just closes, CloseAllApplications ONLY).
Pattern: Navigate then Act (Rule 9 — separate navigation from page action)
WRONG — navigation mixed with page action in one workflow:
WebApp_CreateTask.xaml
├── NGoToUrl → /create-task ← navigation
├── NTypeInto → Task Name field ← page action
├── NTypeInto → Description field ← page action
└── NClick → Submit button ← page action
CORRECT — navigation and page action are separate invocations:
Main.xaml (or Process.xaml)
├── InvokeWorkflow: Browser_NavigateToUrl.xaml (in_strUrl = in_Config("WebApp_CreateTaskUrl").ToString, io_uiBrowser)
├── InvokeWorkflow: WebApp_CreateTask.xaml (in_strTaskName, in_strDescription, out_boolSuccess)
...
Navigation is reusable (other workflows may also need to reach /create-task). Failures are pinpointed (navigation timeout vs form field not found).
Pattern: Desktop App Data Entry (from Excel)
Main.xaml
├── InvokeWorkflow: Workflows\Utils\Excel_ReadInputData.xaml (in_strFilePath, out_dt_Data)
├── ForEach row in dt_Data:
│ ├── InvokeWorkflow: Workflows\InventoryManager\InventoryManager_Launch.xaml (in_strExePath) — only if not running
│ ├── InvokeWorkflow: Workflows\InventoryManager\InventoryManager_NavigateToNewRecord.xaml (io_uiApp) — navigate to entry screen
│ ├── InvokeWorkflow: Workflows\InventoryManager\InventoryManager_EnterRecord.xaml (in_strField1, in_strField2, ...)
│ └── InvokeWorkflow: Workflows\InventoryManager\InventoryManager_SaveRecord.xaml (out_boolSuccess)
└── InvokeWorkflow: Workflows\InventoryManager\InventoryManager_Close.xaml ()
Pattern: Desktop Multi-Tab Form (Rule 14 — navigate then fill per tab)
Main.xaml — variable: uiDesktopApp (type: UiElement)
├── InvokeWorkflow: DesktopApp_Launch.xaml (in_strAppPath, out_uiDesktopApp → uiDesktopApp)
├── InvokeWorkflow: DesktopApp_NavigateToPeopleTab.xaml (io_uiDesktopApp ← uiDesktopApp)
├── InvokeWorkflow: DesktopApp_FillPeopleTab.xaml (io_uiDesktopApp, in_strFirstName, in_strLastName, ...)
├── InvokeWorkflow: DesktopApp_NavigateToCompanyTab.xaml (io_uiDesktopApp)
├── InvokeWorkflow: DesktopApp_FillCompanyTab.xaml (io_uiDesktopApp, in_strCompanyName, ...)
├── InvokeWorkflow: DesktopApp_NavigateToOtherTab.xaml (io_uiDesktopApp)
├── InvokeWorkflow: DesktopApp_FillOtherTab.xaml (io_uiDesktopApp, in_strNotes, ...)
└── InvokeWorkflow: Workflows\Utils\App_Close.xaml (in_uiApp ← uiDesktopApp)
Each NavigateTo workflow clicks the tab and verifies it loaded (NCheckState). Each Fill workflow only types into fields — no tab clicks.
Pattern: Email Processing (PO Approval with Tasks)
Main.xaml
├── InvokeWorkflow: Workflows\Email\Email_GetMessages.xaml (in_intTop, out_listMails)
├── ForEach mail in listMails:
│ ├── InvokeWorkflow: Workflows\Email\Email_ExtractPOData.xaml (in_mmMail, out_strVendor, out_dblAmount)
│ ├── InvokeWorkflow: Workflows\Email\Email_SaveAttachments.xaml (in_mmMail, in_strFolder, out_listFiles)
│ ├── If dblAmount > threshold:
│ │ ├── CreateFormTask (approval form) ← persistence point, MUST be in Main
│ │ └── WaitForFormTaskAndResume ← persistence point, MUST be in Main
│ └── LogMessage: "Processed email from {strVendor}"
└── LogMessage: "Processed {listMails.Count} emails"
⚠️ Persistence constraint:
CreateFormTaskandWaitForFormTaskAndResumeare persistence points — the workflow suspends and resumes at these activities. They MUST remain in Main.xaml (the entry-point file). Never move them into invoked sub-workflows.
Argument Design
Each sub-workflow communicates through typed arguments — never global variables:
- Inputs (
in_): Everything the workflow needs to do its job - Outputs (
out_): Results, status flags, extracted data - In/Out (
io_): Mutable objects passed through (DataTables, collections) - Keep argument count ≤ 7 per workflow. If you need more, consider a DataRow or Dictionary argument.
When NOT to Decompose
- Prototype/POC workflows — single file is fine for quick testing
- REFramework Process.xaml — this IS the transaction workflow, keep it focused but complete. NEVER create a wrapper like
Performer_Process.xamlthat Process.xaml delegates to — Process.xaml directly invokes action workflows (WebApp_ExtractData.xaml, etc.). Lint 75. - Utility workflows — small helpers (≤50 lines) don't need further splitting
Login/Launch Workflow Pattern (Phase 3 — XAML Generation Only)
⛔ This section is for XAML code generation (Phase 3). During Playwright inspection (Phase 2), NEVER type credentials, fill login forms, or click submit. See "ui-inspection.md" section below.
Login always lives inside AppName_Launch.xaml — NEVER create a separate AppName_Login.xaml. Whether the app requires login or not, the Launch workflow handles everything: open browser/app → login (if needed) → verify ready state. This keeps one workflow per app for InitAllApplications to invoke.
When generating ANY launch workflow, COPY the structure from assets/samples/common-workflows/Workflows/WebAppName/WebAppName_Launch.xaml. Do NOT invent a login pattern from scratch. The golden sample contains every required element:
Required XAML structure (in this exact order):
LogMessage→[START]NApplicationCard(Use App/Browser) — URL fromin_strUrlargument, NEVER hardcoded. MUST haveOutUiElement="[out_uiAppName]"to capture the browser/app instance for downstream workflows- → INSIDE the NApplicationCard.Body (minimal credential scope):
- Variables:
strUsername(String),secstrPassword(SecureString, NOT String) RetryScope→GetRobotCredentialwithAssetName="[in_strCredentialAssetName]",Username="[strUsername]",Password="[secstrPassword]"NTypeIntousername field →Text="[strUsername]"NTypeIntopassword field →SecureText="[secstrPassword]"(NOTText=— passwords useSecureText)NClicklogin buttonPickwith twoPickBranchfor login validation (MANDATORY — never skip this):- Branch 1 (Success): trigger =
NCheckStatewaiting for dashboard/home element →LogMessagesuccess - Branch 2 (Failure): trigger =
NCheckStatewaiting for error element →NGetTexterror message →Throwwith error details - Error element selector: Must come from Playwright inspection (ask user to simulate failed login). If not available, use placeholder:
<webctrl tag='DIV' class='PLACEHOLDER_ERROR_SELECTOR' />with<!-- TODO: Replace with real error selector -->
- Branch 1 (Success): trigger =
- Variables:
LogMessage→[END]
Arguments: in_strUrl (from Config), in_strCredentialAssetName (Orchestrator Credential asset name from Config), out_uiAppName (OutArgument(UiElement) — e.g., out_uiWebApp. Captured by NApplicationCard OutUiElement, flowed up through InitAllApplications to Main)
UiElement reference chain (CRITICAL — preserves browser/app instance across workflows):
Launch (out_uiWebApp — OUT)
→ InitAllApplications (out_uiWebApp — OUT) → outputs to Main.xaml
→ Main.xaml (variable: uiWebApp)
→ Process.xaml (io_uiWebApp — IN/OUT) → preserves updated reference
→ Action workflows (io_uiWebApp — IN/OUT) → preserves updated reference
→ Browser_NavigateToUrl (io_uiBrowser — IN/OUT) → generic util
→ CloseAllApplications (in_uiWebApp — IN)
→ App_Close.xaml (in_uiApp — IN) → just closes
Key rule: Process.xaml and all action workflows MUST use InOut direction for UiElement args. The browser reference can get updated (page refresh, navigation) and the updated reference must flow back to Main.
⛔ Process.xaml and action workflows NEVER invoke App_Close. Apps stay open across all transactions. Only CloseAllApplications (End Process state) closes apps.
⛔ Process.xaml available arguments: in_TransactionItem, in_Config, and io_ui* (UiElement args wired by modify_framework.py). in_TransactionNumber is NOT available — it lives in Main.xaml's state machine scope and is forwarded only to GetTransactionData.xaml and SetTransactionStatus.xaml. To reference transaction identity in Process.xaml, use fields from in_TransactionItem (e.g., in_TransactionItem("WIID").ToString for DataRow dispatchers, in_TransactionItem.SpecificContent("Key").ToString for QueueItem performers). Lint 100 catches this.
Common mistakes the model makes (all caught by golden sample comparison):
- ❌
GetRobotCredential ... Result="[strPassword]"—Resultproperty does NOT exist. UsePassword=andUsername= - ❌
Variable x:TypeArguments="x:String" Name="strPassword"— password MUST be SecureString (ss:SecureString) - ❌
NTypeInto ... Text="[strPassword]"for password — useSecureText="[secstrPassword]" - ❌ Credential retrieval OUTSIDE NApplicationCard — keep at minimal scope, INSIDE the browser session
- ❌ No login validation after clicking Login — ALWAYS use
Pick/PickBranchto verify success or catch errors - ❌ Missing
OutUiElement="[out_uiAppName]"on NApplicationCard — without this, downstream workflows have no UiElement reference. Declare asOutArgument(ui:UiElement)(e.g.,out_uiWebApp). Process.xaml and action workflows must useio_(InOut) direction to preserve updated references - ❌ UiElement typed as
x:Object— causes Option Strict BC30512 crash. All UiElement variables/arguments MUST useui:UiElementtype, neverx:Object. Same applies to ALL typed arguments:str*→x:String,int*→x:Int32,dt_*→sd:DataTable,bool*→x:Boolean. Lint 76 catches both single-file (naming conventions) and cross-file (caller vs target x:Property type) mismatches. - ❌
NGoToUrlinside Launch — redundant.NApplicationCardwithOpenMode="Always"andTargetApp Url=already opens the browser at the target URL. NGoToUrl is for mid-session navigation (Browser_NavigateToUrl.xaml), not initial launch. - ❌ Separate
AppName_Login.xaml— login belongs INSIDEAppName_Launch.xaml, not in a separate file - ❌ App-specific
AppName_NavigateTo.xaml— use the genericBrowser_NavigateToUrl.xamlfrom Utils/. The caller passes the full URL from Config. Never clone navigation per app - ❌ Hardcoded
Url="https://..."in TargetApp — useUrl="[in_strUrl]"from argument - ❌ URL concatenation
Url="[in_strUrl + "/login"]"— assemble full URL at caller level withString.Format, workflow receives completein_strUrl - ❌ Undeclared variables — model writes
[strSomething]in expressions but forgets to add<Variable x:TypeArguments="..." Name="strSomething" />. This causes Studio compile errors or silent runtime failures. EVERY variable referenced in[brackets]MUST have a matching<Variable>or<x:Property>declaration. Lint 67 catches this. - ❌ App_Close in Process.xaml or action workflows — apps stay open across transactions. Closing mid-process kills the browser for transaction 2+. App_Close is EXCLUSIVELY invoked from CloseAllApplications.xaml (End Process state). Lint 68 catches this.
- ❌ Redundant Process wrapper (e.g.
Performer_Process.xaml,WebApp_Process.xaml) — Process.xaml IS the process orchestrator. Creating a wrapper file that Process.xaml delegates to adds an unnecessary argument-passing layer (UiElement args get lost) and folder clutter. Process.xaml should directly invoke action workflows. Lint 75 catches this. - ❌ UiElement stored in Config dictionary (
in_Config("app_WebApp") = uiWebApp) — Config isDictionary(String, Object), losing type safety and breaking the typed argument chain. UiElement MUST flow via typed arguments: Launch (out_uiWebAppOutArgument) → InitAllApplications (out_uiWebAppOutArgument) → Main.xaml (variableuiWebApp) → Process.xaml (io_uiWebAppInOutArgument) → action workflows (io_uiWebAppInOutArgument). The REFramework template's InitAllApplications only hasin_Configby default — you MUST addout_ui*OutArgument x:Property declarations for each launched app. Lint 77/78 catch this. - ❌ InitAllApplications captures UiElement as Variable instead of Argument — if
out_uiWebAppfrom Launch lands in a local Variable inside InitAllApplications, it dead-ends there and never reaches Main.xaml. It must be declared as an OutArgument (<x:Property Name="out_uiWebApp" Type="OutArgument(ui:UiElement)" />), and Main.xaml's invoke of InitAllApplications must wireout_uiWebAppwith Direction=Out to a Main variable. Lint 77 catches this.
REFramework Init/Close — Delegate to Sub-Workflows
InitAllApplications.xaml and CloseAllApplications.xaml are orchestrators — they should use InvokeWorkflowFile to call dedicated launch/close workflows, NOT inline NApplicationCard or UI activities directly:
⛔ InitAllApplications.xaml scope: Launch + Login ONLY. This workflow opens applications and authenticates — nothing else. Navigation to specific pages, data extraction (scraping tables, reading files), filtering, and any business logic do NOT belong here. Common violation: dispatcher puts NavigateToWorkItems + ExtractWorkItems + FilterDataTable in InitAllApplications — this bloats Init with business logic that fails independently of app launch.
Dispatcher data loading belongs in GetTransactionData.xaml — on first call (in_TransactionNumber = 1), navigate to the data source, extract records into io_dt_TransactionData, then index. On subsequent calls, just index into the already-populated DataTable:
GetTransactionData.xaml (dispatcher pattern)
├── If io_dt_TransactionData Is Nothing OrElse io_dt_TransactionData.Rows.Count = 0
│ ├── InvokeWorkflow: Browser_NavigateToUrl.xaml (in_strUrl = in_Config("WebApp_WorkItemsUrl").ToString, io_uiBrowser)
│ ├── InvokeWorkflow: WebApp_ExtractData.xaml (extraction)
│ └── Assign: Filter io_dt_TransactionData (filtering)
├── If in_TransactionNumber <= io_dt_TransactionData.Rows.Count
│ ├── Then: out_TransactionItem = Rows(in_TransactionNumber - 1)
│ └── Else: out_TransactionItem = Nothing (end process)
This keeps InitAllApplications clean and puts data loading where the framework expects it — inside the transaction data retrieval logic, with proper retry handling from the surrounding RetryScope.
InitAllApplications.xaml — ⛔ NO GetRobotCredential, NO SecureString, NO navigation, NO extraction
├── Log [START]
├── InvokeWorkflow: Workflows\HRPortal\HRPortal_Launch.xaml
│ Arguments:
│ in_strUrl = String.Format("{0}/{1}", in_Config("HRPortal_BaseURL").ToString, in_Config("HRPortal_LoginPath").ToString)
│ in_strCredentialAssetName = in_Config("HRPortal_CredentialAsset").ToString
│ out_uiHRPortal → out_uiHRPortal ← Launch OUTPUT, flows up to Main
│ ⛔ Pass ONLY in_strCredentialAssetName (String) — NEVER in_secstrPassword (SecureString)
│ ⛔ GetRobotCredential lives INSIDE HRPortal_Launch.xaml, NOT here
│ ⛔ **Variable name in the invoke = InitAllApplications' OWN argument name (`out_uiHRPortal`), NOT Main's variable name (`uiHRPortal`).** Writing `[uiHRPortal]` here causes BC30451 "not declared" because `uiHRPortal` is Main's variable, not InitAllApplications'.
│ Correct XAML: `<OutArgument x:Key="out_uiHRPortal">[out_uiHRPortal]</OutArgument>`
│ Wrong XAML: `<OutArgument x:Key="out_uiHRPortal">[uiHRPortal]</OutArgument>` ← BC30451 crash
├── InvokeWorkflow: Workflows\SAP\SAP_Launch.xaml (in_strConnection)
└── Log [END]
Main.xaml — variable: uiHRPortal (type: UiElement)
├── InitAllApplications.xaml (out_uiHRPortal → uiHRPortal)
├── Process.xaml (io_uiHRPortal ← uiHRPortal) ← IN/OUT preserves updated ref
└── CloseAllApplications.xaml (in_uiHRPortal ← uiHRPortal)
CloseAllApplications.xaml
├── Log [START]
├── InvokeWorkflow: Workflows\Utils\App_Close.xaml (in_uiApp ← in_uiHRPortal)
├── InvokeWorkflow: Workflows\SAP\SAP_Close.xaml ()
└── Log [END]
⛔ Common violation: Model puts GetRobotCredential in InitAllApplications, then passes SecureString password as argument to Launch workflow. This is WRONG — credential retrieval belongs INSIDE the Launch workflow at minimal scope. InitAllApplications passes only the Orchestrator asset NAME (a plain String), not the actual credentials. Second common violation (dispatchers): Model puts navigation + extraction + filtering in InitAllApplications instead of GetTransactionData — this overloads Init with business logic and loses retry protection.
UiElement argument direction rules:
⚠️ XAML type is ui:UiElement, NEVER x:Object. Using x:Object causes Option Strict BC30512: "disallows implicit conversions from 'Object' to 'UiElement'". Lint 76.
| Workflow | Arg direction | XAML type | Reason |
|---|---|---|---|
AppName_Launch.xaml |
out_uiAppName (OUT) |
OutArgument(ui:UiElement) |
Creates the browser/app reference |
InitAllApplications.xaml |
out_uiAppName (OUT) |
OutArgument(ui:UiElement) |
Passes reference up to Main |
Process.xaml |
io_uiAppName (IN/OUT) |
InOutArgument(ui:UiElement) |
Must be IN/OUT — reference can update |
| Action workflows | io_uiAppName (IN/OUT) |
InOutArgument(ui:UiElement) |
Must be IN/OUT — preserves updated ref |
Browser_NavigateToUrl.xaml |
io_uiBrowser (IN/OUT) |
InOutArgument(ui:UiElement) |
Generic util, preserves ref |
CloseAllApplications.xaml |
in_uiAppName (IN) |
InArgument(ui:UiElement) |
Just passes to App_Close |
App_Close.xaml |
in_uiApp (IN) |
InArgument(ui:UiElement) |
Just closes |
For InvokeWorkflowFile argument bindings: <OutArgument x:TypeArguments="ui:UiElement" x:Key="out_uiWebApp">[uiWebApp]</OutArgument>
For Variable declarations: <Variable x:TypeArguments="ui:UiElement" Name="uiWebApp" />
Variable/argument name prefix → XAML type (lint 76 enforces this):
| Prefix | XAML type | xmlns required | Example |
|---|---|---|---|
ui, uiEl |
ui:UiElement |
xmlns:ui="http://schemas.uipath.com/workflow/activities" |
uiWebApp, out_uiSHA1Online |
str |
x:String |
(built-in) | strName, in_strUrl |
int |
x:Int32 |
(built-in) | intRetry, out_intCount |
dt_ |
sd:DataTable |
xmlns:sd="clr-namespace:System.Data;assembly=System.Data.Common" (already in framework templates) |
dt_Report, io_dt_WorkItems |
bool |
x:Boolean |
(built-in) | boolSuccess, out_boolFound |
dbl |
x:Double |
(built-in) | dblAmount |
secstr |
ss:SecureString |
xmlns:ss="clr-namespace:System.Security;assembly=System.Private.CoreLib" |
secstrPassword |
⚠️ NEVER use x:Object — Option Strict BC30512 crash. Always use the specific type.
This follows Rule #4 (Launch/Close always separate), Rule #1 (one UI scope per workflow), Rule #8 (credentials inside workflow), and Rule #10 (no logout for browser apps).
Open this reference as its own page
Collections, JSON & Type Expressions
Array/List operations, numeric operations, regex patterns, Dictionary operations, JSON (Newtonsoft.Json — JObject, JArray, parse, query, build, serialize), LINQ on typed collections, type conversions, Queue Item & Orchestrator expressions.
Contents
- Numeric Operations
- Regex Patterns
- Dictionary Operations
- JSON Operations (Newtonsoft.Json)
- LINQ on Typed Collections
- Type Conversions
- Queue Item & Orchestrator
Numeric Operations
' Rounding
Math.Round(3.14159, 2) ' 3.14 (banker's rounding by default!)
Math.Round(3.145, 2, MidpointRounding.AwayFromZero) ' 3.15 (standard rounding)
Math.Floor(3.9) ' 3 (always rounds down)
Math.Ceiling(3.1) ' 4 (always rounds up)
Math.Truncate(3.9) ' 3 (drops decimals, no rounding)
' Min / Max / Abs
Math.Min(intA, intB)
Math.Max(dblA, dblB)
Math.Abs(-42) ' 42
' Integer division & modulo
intTotal \ intBatchSize ' VB.NET integer division (backslash!)
intTotal Mod intBatchSize ' Remainder
' Random number (in Assign or Invoke Code)
New Random().Next(1, 100) ' Random int between 1-99
New Random().NextDouble() ' Random double between 0.0-1.0
' Percentage
CDbl(intPart) / CDbl(intTotal) * 100 ' Calculate percentage
Math.Round(CDbl(intPart) / CDbl(intTotal) * 100, 1) ' Rounded to 1 decimal
Banker's rounding gotcha: Math.Round(2.5) returns 2, not 3! Use MidpointRounding.AwayFromZero for standard rounding behavior.
Regex Patterns
Common patterns for UiPath automations:
' Email
"[\w\.-]+@[\w\.-]+\.\w+"
' Phone (US)
"\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}"
' Invoice number
"INV[-\s]?\d{4,10}"
' Currency amount
"\$?\d{1,3}(,\d{3})*(\.\d{2})?"
' Date patterns
"\d{1,2}[/\-]\d{1,2}[/\-]\d{2,4}"
' Postal code (US)
"\d{5}(-\d{4})?"
' Extract between delimiters
"(?<=START).*?(?=END)"
Dictionary Operations
' Initialize
New Dictionary(Of String, Object) From {{"key", "value"}}
' Access
dictConfig("key").ToString
' Safe access
If(dictConfig.ContainsKey("key"), dictConfig("key").ToString, "default")
' Add/Update
dictConfig("newKey") = "newValue"
' Remove
dictConfig.Remove("key")
' Iterate (in For Each with KeyValuePair(Of String, Object))
item.Key + " = " + item.Value.ToString
' Keys/Values
dictConfig.Keys.ToList
dictConfig.Values.ToList
' Count / Check
dictConfig.Count
dictConfig.ContainsKey("key")
dictConfig.ContainsValue(someValue)
' Merge two dictionaries (in Invoke Code or ForEach)
' For each kvp In dict2: dict1(kvp.Key) = kvp.Value
JSON Operations (Newtonsoft.Json)
Namespace: xmlns:njl="clr-namespace:Newtonsoft.Json.Linq;assembly=Newtonsoft.Json"
Required import: Newtonsoft.Json.Linq in NamespacesForImplementation
Variable types: njl:JObject, njl:JArray, njl:JToken
JObject — Create & Parse
' Create empty JObject
new JObject()
' Parse JSON string into JObject
JObject.Parse(strJsonString)
' Parse with error handling (in Assign — will throw if invalid)
JObject.Parse(strResponse)
' Create JObject with initial properties
JObject.Parse("{""key"": ""value"", ""count"": 42}")
' Serialize JObject back to string
jObj.ToString ' Pretty-printed (indented)
jObj.ToString(Newtonsoft.Json.Formatting.None) ' Compact, single line
JObject — Read Values (Chained Indexer)
' Single level access — returns JToken
jObj("propertyName")
' Access and convert to string
jObj("propertyName").ToString
' Chained indexer — nested access (2 levels deep)
jObj("validation")(str_FieldTitle)
' 3 levels deep
jObj("data")(str_RootKey)(str_ChildKey)
' Dynamic key from variable
jObj("data")(strDynamicKey).ToString.Trim
' Convert to specific types
jObj("count").Value(Of Integer)
jObj("amount").Value(Of Double)
jObj("isActive").Value(Of Boolean)
CInt(jObj("count"))
CDbl(jObj("amount"))
CBool(jObj("isActive"))
JObject — Null-Safe Access (Critical!)
' JToken access returns Nothing if key doesn't exist — ALWAYS null-check
If(Not jObj("key") Is Nothing, jObj("key").ToString.Trim, "")
' Nested null-safe
If(Not jObj("data")(strKey) Is Nothing, jObj("data")(strKey).ToString.Trim, "")
' Deep nested null-safe (check each level)
If(jObj("data") IsNot Nothing AndAlso jObj("data")(strKey) IsNot Nothing,
jObj("data")(strKey).ToString, "")
' Check if property exists
jObj.ContainsKey("propertyName")
jObj("propertyName") IsNot Nothing
JObject — Write Values
' Set property value (creates or overwrites)
jObj("validation")(str_FieldTitle) = new JObject()
' Set nested value via chained indexer
jObj("validation")(strField)(strStatusKey) = True
jObj("validation")(strField)(strStatusKey) = False
' Assign Boolean to JToken path
' In XAML: OutArgument x:TypeArguments="njl:JToken" and InArgument value [True] or [False]
' Add new property
jObj.Add("newProperty", "newValue")
jObj.Add("nested", new JObject())
' Remove property
jObj.Remove("propertyName")
' Merge from another JObject
jObj.Merge(jObjOther)
JArray Operations
' Parse JSON array
JArray.Parse(strJsonArrayString)
' Access from JObject
jObj("items") ' Returns JToken — cast to JArray if needed
CType(jObj("items"), JArray)
' Iterate (in For Each with JToken type)
' ForEach TypeArguments="njl:JToken" Values="[jArr]"
currentItem("propertyName").ToString
' Array count
jArr.Count
' Access by index
jArr(0)("propertyName").ToString
' Add item to array
jArr.Add(new JObject())
' LINQ on JArray
jArr.Where(Function(item) item("status").ToString = "active").Count
jArr.Select(Function(item) item("name").ToString).ToList
jArr.Any(Function(item) CBool(item("isValid")))
JToken Type Conversions
' JToken is the base type — JObject and JArray inherit from it
' In XAML Assign, use njl:JToken for both input and output types
' Check JToken type
jToken.Type ' returns JTokenType enum: Object, Array, String, Integer, Float, Boolean, Null
' Safe type checking
jToken.Type = Newtonsoft.Json.Linq.JTokenType.Null
jToken.Type = Newtonsoft.Json.Linq.JTokenType.Object
' Convert between types
CType(jToken, JObject) ' Cast JToken to JObject
CType(jToken, JArray) ' Cast JToken to JArray
Common UiPath JSON Patterns
' API response → JObject → extract values
JObject.Parse(strResponseBody)("data")("id").ToString
' Build request body (in Invoke Code)
Dim jBody As New JObject()
jBody.Add("name", strName)
jBody.Add("amount", decAmount)
jBody.ToString(Newtonsoft.Json.Formatting.None)
' Config dictionary to JSON key access (common REFramework pattern)
jObj("data")(dictConfig("JsonKeyName").ToString).ToString
' Validate extraction — check field exists and isn't a "not found" marker
Not String.IsNullOrEmpty(strValue) AndAlso
Not Regex.Match(strValue, strNotFoundPattern, RegexOptions.IgnoreCase).Success
' Safe field extraction with ContainsKey (from AddDataRow inline arrays)
If(jObj.ContainsKey("City"), jObj("City").ToString, "")
' Validate ALL required fields present — Split config + All LINQ
config("RequiredFields").ToString.Split(",").All(
Function(k) jObj(k) IsNot Nothing AndAlso
Not String.IsNullOrWhiteSpace(jObj(k).ToString))
' String truncation (common for DB/entity field length limits)
If(strValue.Length > 2000, strValue.Substring(0, 2000), strValue)
If(jObj("Correction").ToString.Length > 2000,
jObj("Correction").ToString.Substring(0, 2000),
jObj("Correction").ToString)
LINQ on Typed Collections
Beyond DataTables, LINQ is heavily used on typed lists (Data Service entities, custom objects).
Entity / Object List LINQ
' Select single property → List(Of String)
listEntities.Select(Function(item) item.RawInput).ToList()
' Where + FirstOrDefault + property access (VLOOKUP equivalent)
listEntities.Where(Function(r) r.RawInput.ToString().ToLower.Equals(strSearch)).FirstOrDefault().City
' Case-insensitive matching with .ToUpper
listEntities.Where(Function(r) r.RawInput.ToUpper.Equals(strKey.ToUpper)).FirstOrDefault().PropertyName
' Count matching (equality check)
listEntities.Where(Function(r) r.RawInput.ToUpper.Equals(strKey.ToUpper)).Count
' First (throws if empty) vs FirstOrDefault (returns Nothing)
listEntities.First().Id
listEntities.FirstOrDefault()?.PropertyName ' C# only — use If() wrapper in VB.NET
' Check existence
listEntities.Any(Function(r) r.PropertyName = strValue)
' All match condition
arrFields.All(Function(k) jObj(k) IsNot Nothing)
' Data Service entity properties with special characters use URL encoding:
' Space → _20_ | Apostrophe → _27_ | Accented chars preserved as-is
dsEntity.RequiresManualReview ' "entity field with spaces in schema" (spaces removed at word boundaries)
jObj.Company_20_Name ' "Company Name"
jObj.Additional_20_Info ' "Additional Info"
jObj.Street_20_Number_20_and_20_Name ' "Street Number and Name"
KeyValuePair Access
' Variable type: KeyValuePair(Of String, Double) — scg:KeyValuePair(x:String, x:Double)
kvp.Key ' String part
kvp.Value ' Double part
' Common pattern: algorithm returns best match as KeyValuePair
CurrentAddressMatchFound.Key ' The matched string
CurrentAddressMatchFound.Value ' The match score
Type Conversions
String ↔ Numeric
' String to Integer
CInt("42") / Integer.Parse("42") / Convert.ToInt32("42")
' String to Double
CDbl("3.14") / Double.Parse("3.14") / Convert.ToDouble("3.14")
' String to Decimal
CDec("99.99") / Decimal.Parse("99.99")
' Culture-aware parsing (for European decimals like "1.234,56")
Double.Parse(strValue, System.Globalization.CultureInfo.InvariantCulture)
Decimal.Parse(strValue, System.Globalization.NumberStyles.Any,
System.Globalization.CultureInfo.GetCultureInfo("pt-BR"))
' Numeric to formatted string
intValue.ToString
decAmount.ToString("F2") ' "99.99" — fixed 2 decimals
decAmount.ToString("N2") ' "1,234.56" — with thousands separator
decAmount.ToString("C") ' "$99.99" (locale-dependent currency)
decAmount.ToString("C2", System.Globalization.CultureInfo.GetCultureInfo("pt-BR")) ' "R$ 99,99"
intValue.ToString("D6") ' "000042" — zero-padded
dblRatio.ToString("P1") ' "85.5%" — percentage
' Safe numeric parse (in Invoke Code — TryParse returns Boolean)
Dim result As Integer
If Integer.TryParse(strInput, result) Then
' use result
End If
Boolean Conversions
' From string
CBool("True") / Boolean.Parse("true") / Convert.ToBoolean("true")
' From DataRow (common pattern from sample)
CBool(CurrentRow("Mandatory")) ' Direct cast from Object
Convert.ToBoolean(CurrentRow("IsActive"))
' From numeric
CBool(1) ' True (any non-zero = True)
CBool(0) ' False
DataRow Cell Access & Conversion
' String (most common — always safe)
CurrentRow("ColumnName").ToString
row("Column Name").ToString.Trim
' Numeric
CInt(CurrentRow("Amount"))
CDbl(CurrentRow("Price"))
Convert.ToDouble(row("Value"))
' Boolean
CBool(CurrentRow("IsRequired"))
' Date
DateTime.Parse(CurrentRow("Date").ToString)
CDate(CurrentRow("Date"))
' Null-safe (DataRow cells can be DBNull)
If(CurrentRow("Column") IsNot Nothing AndAlso
Not IsDBNull(CurrentRow("Column")) AndAlso
Not String.IsNullOrEmpty(CurrentRow("Column").ToString),
CurrentRow("Column").ToString.Trim, "")
' Shorthand: If column is always populated
CurrentRow("Column").ToString.Trim
JToken Conversions
' JToken to native types
jObj("count").Value(Of Integer)
jObj("amount").Value(Of Double)
jObj("isActive").Value(Of Boolean)
jObj("name").Value(Of String)
' VB.NET casting shortcuts also work
CInt(jObj("count"))
CDbl(jObj("amount"))
CBool(jObj("isActive"))
jObj("name").ToString ' Most common — always safe
' JToken to JObject/JArray
CType(jToken, JObject)
CType(jToken, JArray)
' Native types auto-convert when assigning TO JToken
' In XAML Assign with OutArgument njl:JToken and InArgument njl:JToken:
' [True] → JToken Boolean
' [42] → JToken Integer
' ["text"] → JToken String
' [new JObject()] → JToken Object
GenericValue (UiPath Proprietary Type)
gvValue.ToString
CInt(gvValue)
CDbl(gvValue)
Queue Item & Orchestrator
' Access QueueItem specific content
in_TransactionItem.SpecificContent("FieldName").ToString
' Safe access
If(in_TransactionItem.SpecificContent.ContainsKey("FieldName"),
in_TransactionItem.SpecificContent("FieldName").ToString, "")
' Queue item properties
in_TransactionItem.Reference
in_TransactionItem.Priority
in_TransactionItem.DeferDate
in_TransactionItem.DueDate
' Set transaction progress
"Processing item " + in_TransactionItem.Reference
Open this reference as its own page
DataTable Expressions
DataTable operations: Select/filter rows, Compute aggregates, sort, lookup, merge, clone, add/remove/rename columns, row iteration, Build Data Table expressions.
Contents
- DataTable Operations
- VB.NET
- LINQ on DataTable (VB.NET)
- LINQ on DataTable (C#)
- LINQ Query Syntax (VB.NET)
- LINQ Operator Reference
- Making LINQ Available (Cast / AsEnumerable)
- Useful LINQ Patterns (DataTable)
- VB.NET Aggregate Keyword (Query Syntax Alternative)
- Non-DataTable LINQ (Arrays, Lists, Collections)
- Robust DataTable Aggregation (Null-Safe Patterns)
DataTable Operations
VB.NET
' Row count
dtData.Rows.Count
' Column count
dtData.Columns.Count
' Access cell value
dtData.Rows(0)("ColumnName").ToString
dtData.Rows(intIndex)(intColIndex).ToString
' Select rows (returns DataRow array)
dtData.Select("[Status] = 'Active'")
dtData.Select("[Amount] > 1000", "[Date] DESC")
dtData.Select("[Name] LIKE '%smith%'")
' Clone structure (no data)
dtData.Clone
' Copy structure + data
dtData.Copy
' Add column
dtData.Columns.Add("NewColumn", GetType(String))
' Remove column
dtData.Columns.Remove("ColumnName")
' Check column exists
dtData.Columns.Contains("ColumnName")
' DefaultView sort + filter
dtData.DefaultView.Sort = "[Date] ASC"
dtData.DefaultView.RowFilter = "[Status] = 'Active'"
dtData.DefaultView.ToTable
LINQ on DataTable (VB.NET)
' Filter rows
dtData.AsEnumerable.Where(Function(row) row("Status").ToString = "Active").CopyToDataTable
' Filter with multiple conditions
dtData.AsEnumerable.Where(Function(row) _
row("Status").ToString = "Active" AndAlso _
CInt(row("Amount")) > 1000).CopyToDataTable
' Select distinct values (single column → array)
dtData.AsEnumerable.Select(Function(row) row("Category").ToString).Distinct.ToArray
' Select distinct rows (by specific columns → DataTable)
dtData.DefaultView.ToTable(True, "ColumnName")
dtData.DefaultView.ToTable(True, "Col1", "Col2") ' Multiple columns
' Sum / Average / Min / Max
dtData.AsEnumerable.Sum(Function(row) Convert.ToDouble(row("Amount")))
dtData.AsEnumerable.Average(Function(row) CDbl(row("Price")))
dtData.AsEnumerable.Min(Function(row) CInt(row("Quantity")))
dtData.AsEnumerable.Max(Function(row) CDate(row("Date")))
' Count with condition
dtData.AsEnumerable.Count(Function(row) row("Status").ToString = "Error")
' Group by (returns IGrouping — usually used in Invoke Code)
dtData.AsEnumerable.GroupBy(Function(row) row("Category").ToString)
' Group by + aggregate (sum per category)
dtData.AsEnumerable.GroupBy(Function(row) row("Category").ToString) _
.Select(Function(g) New Object() {g.Key, g.Sum(Function(r) CDbl(r("Amount")))})
' Order by (ascending)
dtData.AsEnumerable.OrderBy(Function(row) row("Name").ToString).CopyToDataTable
' Order by (descending)
dtData.AsEnumerable.OrderByDescending(Function(row) CDate(row("Date"))).CopyToDataTable
' Multi-column sort
dtData.AsEnumerable _
.OrderBy(Function(row) row("Category").ToString) _
.ThenByDescending(Function(row) CDbl(row("Amount"))) _
.CopyToDataTable
' Any / All
dtData.AsEnumerable.Any(Function(row) row("Status").ToString = "Error")
dtData.AsEnumerable.All(Function(row) CInt(row("Amount")) > 0)
' First / FirstOrDefault
dtData.AsEnumerable.First(Function(row) row("ID").ToString = strTargetID)
dtData.AsEnumerable.FirstOrDefault(Function(row) row("ID").ToString = strTargetID)
' Skip / Take (pagination)
dtData.AsEnumerable.Skip(10).Take(10).CopyToDataTable
' Select (transform) — project to new shape
dtData.AsEnumerable.Select(Function(row) row("Name").ToString.ToUpper).ToList
' Join two DataTables (Inner Join)
From row1 In dtTable1.AsEnumerable
Join row2 In dtTable2.AsEnumerable
On row1("ID").ToString Equals row2("ID").ToString
Select dtResult.LoadDataRow(New Object() {row1("Name"), row2("Value")}, True)
' Left Outer Join (keep all rows from dt1, null for unmatched dt2)
From row1 In dtTable1.AsEnumerable
Group Join row2 In dtTable2.AsEnumerable
On row1("ID").ToString Equals row2("ID").ToString Into matches = Group
From m In matches.DefaultIfEmpty()
Select dtResult.LoadDataRow(New Object() {
row1("Name"),
If(m IsNot Nothing, m("Value").ToString, "")}, True)
' Lookup value from another table (like VLOOKUP)
dtLookup.AsEnumerable.FirstOrDefault(
Function(row) row("Code").ToString = strSearchCode)?("Description")?.ToString
' Lookup with default value (safe — no NullReferenceException)
If(dtLookup.AsEnumerable.Any(Function(row) row("Code").ToString = strSearchCode),
dtLookup.AsEnumerable.First(Function(row) row("Code").ToString = strSearchCode)("Description").ToString,
"Not Found")
⚠ CRITICAL: CopyToDataTable() throws on empty results!
' BAD — throws InvalidOperationException if filter returns 0 rows:
dtData.AsEnumerable.Where(Function(row) row("Status").ToString = "X").CopyToDataTable
' SAFE — check first:
Dim filtered = dtData.AsEnumerable.Where(Function(row) row("Status").ToString = "X")
Dim dtResult = If(filtered.Any, filtered.CopyToDataTable, dtData.Clone)
' .Clone creates empty DataTable with same schema
' In single expression (safe):
If(dtData.AsEnumerable.Any(Function(row) row("Status").ToString = "X"),
dtData.AsEnumerable.Where(Function(row) row("Status").ToString = "X").CopyToDataTable,
dtData.Clone)
LINQ on DataTable (C#)
// Filter
dtData.AsEnumerable().Where(row => row["Status"].ToString() == "Active").CopyToDataTable()
// Sum
dtData.AsEnumerable().Sum(row => Convert.ToDouble(row["Amount"]))
// Group by
dtData.AsEnumerable().GroupBy(row => row["Category"].ToString())
// Order by
dtData.AsEnumerable().OrderBy(row => row["Name"].ToString()).CopyToDataTable()
// Safe CopyToDataTable
var filtered = dtData.AsEnumerable().Where(row => row["Status"].ToString() == "X");
var dtResult = filtered.Any() ? filtered.CopyToDataTable() : dtData.Clone();
LINQ Query Syntax (VB.NET)
UiPath supports two LINQ syntaxes. Method Syntax (above) is compact for simple operations. Query Syntax is clearer for complex operations like GroupBy with aggregation.
' --- Basic Query Syntax ---
' Filter + Select (equivalent to .Where().Select())
(From d In dtData.AsEnumerable
Where d("Status").ToString.Equals("Active")
Select d).CopyToDataTable
' Multi-condition filter
(From d In dtData.AsEnumerable
Where d("Status").ToString = "Active" AndAlso CInt(d("Amount")) > 1000
Select d).CopyToDataTable
' --- GroupBy: Split DataTable into List(Of List(Of DataRow)) ---
' Outer list = groups, inner list = group member rows
(From d In dtData.AsEnumerable
Group d By k=d("RegionCode").ToString.Trim Into grp=Group
Select grp.toList).toList
' --- GroupBy: Split DataTable into List(Of DataTable) ---
' Each group becomes its own DataTable — useful for per-group processing
(From d In dtData.AsEnumerable
Group d By k=d("RegionCode").ToString.Trim Into grp=Group
Select grp.CopyToDataTable).toList
' --- GroupBy + Aggregation with Let (report generation) ---
' The "Let" keyword stores intermediate calculations for each group
' This pattern builds a summary report DataTable in a single Assign:
' (dtReport must be pre-built with matching columns via Build Data Table)
(From d In dtData.AsEnumerable
Group d By k=d("RegionCode").ToString.Trim Into grp=Group
Let cs = grp.Sum(Function(rc) CInt("0" & rc("CaseCount").ToString))
Let cn = String.Join(";", grp.Select(Function(rn) rn("CaseName").ToString).toArray)
Let ra = New Object(){k, cs, cn}
Select dtReport.Rows.Add(ra)).CopyToDataTable
' Explanation:
' Line 1: iterate DataTable rows (d = current DataRow)
' Line 2: group by RegionCode (k = group key, grp = group members)
' Line 3: Let cs = sum of CaseCount for this group
' Line 4: Let cn = semicolon-joined CaseNames for this group
' Line 5: Let ra = Object array for the report row
' Line 6: add row to dtReport and return result
' --- GroupBy with Count ---
(From d In dtData.AsEnumerable
Group d By k=d("Category").ToString.Trim Into grp=Group
Let cnt = grp.Count
Let ra = New Object(){k, cnt}
Select dtReport.Rows.Add(ra)).CopyToDataTable
' --- GroupBy with multiple keys ---
(From d In dtData.AsEnumerable
Group d By k1=d("Region").ToString, k2=d("Year").ToString Into grp=Group
Let total = grp.Sum(Function(r) CDbl(r("Amount")))
Let ra = New Object(){k1, k2, total}
Select dtReport.Rows.Add(ra)).CopyToDataTable
⚠ GroupBy report pattern requires:
dtReportmust exist with matching columns (Build Data Table orNew DataTable)- Column count in
New Object(){...}must match dtReport column count CInt("0" & value)is a safe numeric conversion (empty string → 0)
LINQ Operator Reference
Complete taxonomy of available LINQ operators:
Filtering: Where
Projection: Select, SelectMany
Ordering: OrderBy, OrderByDescending, ThenBy, ThenByDescending, Reverse
Quantifiers: All, Any, Contains
Join: Join (inner), GroupJoin (left outer)
Grouping: GroupBy
Aggregation: Aggregate, Count, LongCount, Sum, Min, Max, Average
Partitioning: Skip, SkipWhile, Take, TakeWhile
Set: Distinct, Except, Intersect, Union
Conversion: AsEnumerable, Cast, OfType, ToArray, ToDictionary, ToList, ToLookup
Element Access: ElementAt, ElementAtOrDefault, First, FirstOrDefault,
Last, LastOrDefault, Single, SingleOrDefault
Concatenation: Concat, Append, Prepend
Generation: DefaultIfEmpty, Empty, Range, Repeat
Other: SequenceEqual, Zip
Making LINQ Available (Cast / AsEnumerable)
Required import: Ensure System.Linq is in the workflow's Imports panel.
Most UiPath templates include it by default, but if LINQ methods don't appear in IntelliSense, check imports.
' DataTable → requires AsEnumerable (System.Data.DataTableExtensions)
dtData.AsEnumerable.Where(Function(row) ...)
' MatchCollection (Regex) → requires Cast
Regex.Matches(strInput, strPattern) _
.Cast(Of Match) _
.Select(Function(m) m.Value).ToList
' Non-generic IEnumerable → Cast(Of T) or OfType(Of T)
someCollection.Cast(Of String).Where(Function(s) s.Length > 5).ToList
' OfType — filter + cast (skips items that don't match type, never throws)
mixedCollection.OfType(Of String).ToList
Useful LINQ Patterns (DataTable)
' --- Distinct rows by specific columns ---
dtData.DefaultView.ToTable(True, "ColumnName") ' Single column
dtData.DefaultView.ToTable(True, "Col1", "Col2") ' Multiple columns
' --- Remove empty rows ---
dtData.AsEnumerable.Where(Function(row) _
Not row.ItemArray.All(Function(field) _
field Is DBNull.Value OrElse String.IsNullOrWhiteSpace(field.ToString))).CopyToDataTable
' --- Find duplicates (rows appearing more than once by key column) ---
(From d In dtData.AsEnumerable
Group d By k=d("ID").ToString Into grp=Group
Where grp.Count > 1
Select grp).SelectMany(Function(g) g).CopyToDataTable
' --- Remove duplicates (keep first occurrence by key column) ---
(From d In dtData.AsEnumerable
Group d By k=d("ID").ToString Into grp=Group
Select grp.First).CopyToDataTable
' --- Column values to delimited string ---
String.Join(", ", dtData.AsEnumerable.Select(Function(row) row("Name").ToString))
' --- Check if value exists in DataTable column ---
dtData.AsEnumerable.Any(Function(row) row("Email").ToString.Equals(strSearch, StringComparison.OrdinalIgnoreCase))
' --- Except (rows in dt1 not in dt2, by key column) ---
Dim dt2Keys = dtTable2.AsEnumerable.Select(Function(r) r("ID").ToString).ToList
dtTable1.AsEnumerable.Where(Function(r) Not dt2Keys.Contains(r("ID").ToString)).CopyToDataTable
' --- Intersect (rows in both tables, by key column) ---
dtTable1.AsEnumerable.Where(Function(r) dt2Keys.Contains(r("ID").ToString)).CopyToDataTable
' --- Convert column values (e.g., trim all strings in all columns) ---
dtData.AsEnumerable.ToList.ForEach(Sub(row)
For Each col As DataColumn In dtData.Columns
If row(col) IsNot DBNull.Value Then row(col) = row(col).ToString.Trim
End If
Next)
' --- Enumerable.Range (generate sequence) ---
Enumerable.Range(1, 10).ToList ' {1, 2, 3, ..., 10}
Enumerable.Range(0, dtData.Rows.Count).Where(Function(i) i Mod 2 = 0) _
.Select(Function(i) dtData.Rows(i)).CopyToDataTable ' Every other row
VB.NET Aggregate Keyword (Query Syntax Alternative)
VB.NET offers the Aggregate ... Into syntax as an alternative to method syntax for aggregation.
This is unique to VB.NET and has no C# equivalent.
' --- Aggregate on simple arrays/lists ---
Dim arrValues() As Int32 = {2, 12, -8, 6, 14, 5}
intResult = Aggregate x In arrValues Into Min(x) ' -8
intResult = Aggregate x In arrValues Into Max(x) ' 14
intResult = Aggregate x In arrValues Into Sum(x) ' 31
dblResult = Aggregate x In arrValues Into Average(x) ' 5.166...
' --- Aggregate with type conversion (string values → numeric) ---
Dim arrStrings() As String = {"2", "12", "-8", "6", "14", "5"}
intResult = Aggregate x In arrStrings Into Min(CInt(x))
intResult = Aggregate x In arrStrings Into Sum(CInt(x))
' --- Aggregate on DataTable column ---
dblResult = Aggregate d In dtData.AsEnumerable Into Sum(CDbl(d("Amount").ToString))
Non-DataTable LINQ (Arrays, Lists, Collections)
LINQ works directly on arrays and lists without needing .AsEnumerable:
' --- Filter ---
Dim arrNums() As Int32 = {12, 34, 5, 8, 10, 2, 15, 7}
arrNums.Where(Function(x) x > 10).ToList ' {12, 34, 15}
arrNums.Where(Function(x) x > 10).ToArray ' Int32 array
' --- Short-form aggregation (numericals) ---
arrNums.Min() ' 2
arrNums.Max() ' 34
arrNums.Sum() ' 93
arrNums.Average() ' 11.625
' --- Lambda-form aggregation (non-numerical source) ---
Dim arrStrings() As String = {"2", "12", "8"}
arrStrings.Sum(Function(x) CInt(x)) ' 22
arrStrings.Min(Function(x) CInt(x)) ' 2
' --- Query syntax: filter + type projection ---
(From x In arrNums
Where x > 10
Select x.ToString()).ToList ' List(Of String): {"12","34","15"}
' --- Ordering ---
arrNums.OrderBy(Function(x) x).ToArray ' ascending
arrNums.OrderByDescending(Function(x) x).ToArray ' descending
' --- Partitioning ---
arrNums.Skip(2).Take(3).ToArray ' skip first 2, take next 3
arrNums.SkipWhile(Function(x) x < 20).ToArray ' skip until condition fails
arrNums.TakeWhile(Function(x) x < 20).ToArray ' take until condition fails
' --- Set operations ---
Dim arr1() As Int32 = {1, 2, 3, 4}
Dim arr2() As Int32 = {3, 4, 5, 6}
arr1.Except(arr2).ToArray ' {1, 2}
arr1.Intersect(arr2).ToArray ' {3, 4}
arr1.Union(arr2).ToArray ' {1, 2, 3, 4, 5, 6}
arr1.Concat(arr2).ToArray ' {1, 2, 3, 4, 3, 4, 5, 6} (with dupes)
' --- Check string array for partial match ---
arrKeywords.Any(Function(kw) strSubject.Contains(kw)) ' True if any keyword found
arrKeywords.All(Function(kw) strInput.Contains(kw)) ' True if ALL keywords found
' --- Generate sequence ---
Enumerable.Range(1, 12).ToList ' {1,2,...,12}
Enumerable.Range(0, 5).Select(Function(i) Now.AddDays(i).ToString("yyyy-MM-dd")).ToArray
Enumerable.Repeat("N/A", 10).ToArray ' 10 copies of "N/A"
Robust DataTable Aggregation (Null-Safe Patterns)
Real-world data often has empty, null, or non-parseable values. These patterns handle them:
' --- Robust Sum: safe from nulls, empty strings, and non-numeric values ---
(From d In dtData.AsEnumerable
Let v = d("Amount")
Let chk1 = Not (IsNothing(v) OrElse String.IsNullOrEmpty(v.ToString.Trim))
Let chk2 = If(chk1, Double.TryParse(v.ToString, Nothing), False)
Let x = If(chk2, Double.Parse(v.ToString), 0)
Select n = x).Sum()
' chk1: value is not null/empty
' chk2: value passes parse test (is a valid number)
' x: parsed value or 0 as default
' --- Simple safe sum (empty → 0, throws on non-numeric) ---
dtData.AsEnumerable.Sum(Function(x) CDbl("0" & x("Amount").ToString.Trim))
' Prepending "0" makes empty string parse as 0
' --- Duration string sum (HH:mm:ss strings → total TimeSpan) ---
Dim arrDurations() As String = {"01:15:00", "00:25:00", "00:45:00"}
TimeSpan.FromTicks(arrDurations.Sum(Function(x) CDate(x).TimeOfDay.Ticks))
' Result: 02:25:00 as TimeSpan
' --- Count non-empty values in a column ---
dtData.AsEnumerable.Count(Function(row) _
Not String.IsNullOrWhiteSpace(row("FieldName").ToString))
' --- Conditional aggregation (Sum only positive values) ---
dtData.AsEnumerable _
.Where(Function(row) CDbl("0" & row("Amount").ToString) > 0) _
.Sum(Function(row) CDbl(row("Amount").ToString))
Open this reference as its own page
Expression Foundations
VB.NET expression syntax, C# expression syntax, null safety patterns. Read this first for any expression task.
Contents
VB.NET Expressions
Common Patterns
' String interpolation (not supported in VB.NET expressions — use concatenation)
"Hello " + strName + ", welcome!"
' Ternary / inline If
If(boolCondition, "Yes", "No")
' Null coalescing
If(strValue, "default")
If(strValue IsNot Nothing, strValue, "default")
' Nothing check
strValue Is Nothing
strValue IsNot Nothing
String.IsNullOrEmpty(strValue)
String.IsNullOrWhiteSpace(strValue)
' Array initialization
New String() {"item1", "item2", "item3"}
New Object() {strName, intAge, True}
' List initialization
New List(Of String) From {"item1", "item2"}
' Dictionary initialization
New Dictionary(Of String, Object) From {
{"key1", "value1"},
{"key2", 42}
}
' Casting
CStr(objValue)
CInt(strNumber)
CDbl(strDecimal)
CBool(strBoolean)
CType(objValue, DataTable)
DirectCast(objValue, String)
Convert.ToInt32(strValue)
Convert.ToDateTime(strDate)
' Exception creation (for Throw activities)
New Exception("Processing failed: " + exception.Message)
New BusinessRuleException("Invalid invoice number")
New ApplicationException("System not responding")
' Global Variables access (UiPath global namespace pattern)
GlobalVariablesNamespace.GlobalVariables.config("SettingKey").ToString
CInt(GlobalVariablesNamespace.GlobalVariables.config("MaxRetries"))
' Document Understanding field access
DocumentDataExtracted.Data.GetFieldValue("FieldName").Value
DocumentDataExtracted.Data.GetFieldValue(strFieldName) IsNot Nothing
' Document Understanding — GetField API (more detailed access)
DocumentDataExtracted.Data.GetField("Company Name").IsMissing ' Boolean: field not found by DU
DocumentDataExtracted.Data.GetField("FieldName").Values ' collection of extracted values
DocumentDataExtracted.Data.GetField("FieldName").Values.First().Value ' first extracted value as string
DocumentDataExtracted.Data.GetField("FieldName").Values.FirstOrDefault ' Nothing if no values
' Safe field extraction pattern (null-safe, handles missing fields)
If(Not DocumentDataExtracted.Data.GetField("Company Name").IsMissing And _
DocumentDataExtracted.Data.GetField("Company Name").Values.FirstOrDefault IsNot Nothing, _
DocumentDataExtracted.Data.GetField("Company Name").Values.First().Value, _
"Marked as missing")
' .IsMissing = True → field not found at all by classifier
' .Values.FirstOrDefault = Nothing → field found but no value extracted
VB.NET String Concatenation: + vs &
' Both work in VB.NET UiPath expressions
"Hello " + strName ' + operator
"Hello " & strName ' & operator (VB.NET native)
' & is safer — auto-converts non-strings, + can fail on type mismatch
"Count: " & intCount ' Works (auto-ToString)
"Count: " + intCount.ToString ' Also works (explicit)
"Count: " + intCount ' May fail! String + Integer = error
' In XAML attributes, & must be entity-encoded as &
' So [str1 & str2] in XAML becomes:
' Expression="[str1 & str2]"
Multiline Expressions in XAML
Short expressions go inline in the JSON spec value. Long expressions work the same way — the generators handle xml:space="preserve" wrapping, 
 line breaks, and all XML entity encoding (", &, <) internally via _escape_vb_expr(). Write expressions in plain VB.NET/C# in the JSON spec; never pre-encode.
XAML entity encoding in expressions:
"→"(string literals inside XAML attributes)&→&(VB.NET concatenation operator)>→>(greater-than or used in strings likestr.Contains(">")<→<(less-than comparison)<>→<>(VB.NET not-equal operator — common in LINQ lambdas)
→ newline (XAML attribute formatting for multiline expressions)	→ tab (XAML attribute indentation — formatting only, not part of expression)
VB.NET comparison operators:
=(equal) /<>(not equal) — NOT==/!=like C#</>/<=/>=AndAlso/OrElse(short-circuit) — NOT&&/||Not(logical negation) — NOT!Is Nothing/IsNot Nothing— reference equality check
C# Expressions
Common Patterns
// String interpolation
$"Hello {strName}, welcome!"
// Ternary
boolCondition ? "Yes" : "No"
// Null coalescing
strValue ?? "default"
// Null conditional
strValue?.Trim()
dictConfig?.ContainsKey("key") ?? false
// Array
new string[] {"item1", "item2", "item3"}
new object[] {strName, intAge, true}
// List
new List<string> {"item1", "item2"}
// Dictionary
new Dictionary<string, object> {
{"key1", "value1"},
{"key2", 42}
}
// Casting
(string)objValue
int.Parse(strNumber)
Convert.ToInt32(strValue)
Convert.ToDateTime(strDate)
Null Safety Patterns
Critical for avoiding NullReferenceException in production:
VB.NET
' Safe DataRow access
If(row("Column") IsNot Nothing AndAlso Not String.IsNullOrEmpty(row("Column").ToString), row("Column").ToString.Trim, "")
' Safe dictionary access
If(dictConfig.ContainsKey("key"), dictConfig("key").ToString, "default")
' Safe string operations
If(String.IsNullOrEmpty(strInput), "", strInput.Trim.ToUpper)
' Null-safe chaining pattern
If(objResult IsNot Nothing, If(objResult.ToString IsNot Nothing, objResult.ToString.Trim, ""), "")
C#
// Safe DataRow
row["Column"]?.ToString()?.Trim() ?? ""
// Safe dictionary
dictConfig.ContainsKey("key") ? dictConfig["key"]?.ToString() ?? "default" : "default"
// TryGetValue pattern (in Invoke Code)
dictConfig.TryGetValue("key", out var val) ? val?.ToString() ?? "" : ""
Open this reference as its own page
String, DateTime & Utility Expressions
String operations (split, join, trim, pad, replace, regex, format), DateTime (parse, format, add, diff, business days), file/path operations, numeric operations, regex patterns.
Contents
String Operations
Core Methods
' Basic operations (same in VB.NET and C#)
strInput.Trim ' Remove leading/trailing whitespace
strInput.TrimStart / strInput.TrimEnd ' One side only
strInput.ToUpper / strInput.ToLower
strInput.Length
' Search
strInput.Contains("search") ' Boolean — case-sensitive!
strInput.StartsWith("prefix")
strInput.EndsWith("suffix")
strInput.IndexOf("search") ' Returns -1 if not found
strInput.LastIndexOf(".")
' Extract
strInput.Substring(5) ' From index 5 to end
strInput.Substring(5, 10) ' From index 5, take 10 chars
' Replace
strInput.Replace("old", "new")
strInput.Replace(vbCrLf, "") ' Remove line breaks
strInput.Replace(Environment.NewLine, " ") ' Replace line breaks with space
Split & Join
' Split — returns String array
strInput.Split({";"c}, StringSplitOptions.RemoveEmptyEntries)
strInput.Split({","c}) ' Single char delimiter
strInput.Split({" - "}, StringSplitOptions.None) ' String delimiter (no "c")
strInput.Split({vbCrLf, vbLf}, StringSplitOptions.RemoveEmptyEntries) ' By line
' Split and take specific part
strInput.Split({";"c})(0) ' First element
strInput.Split({";"c}).Last ' Last element (needs System.Linq)
' Join
String.Join(", ", arrItems)
String.Join(Environment.NewLine, listLines)
String.Join(" | ", dtRow.ItemArray.Select(Function(x) x.ToString).ToArray)
VB.NET quirk: Single character delimiters need "c" suffix: ","c. String delimiters use {"string"} array syntax without c. Getting this wrong is a common error.
Case-Insensitive Operations
' VB.NET — Contains is case-sensitive! Use these instead:
strInput.ToUpper.Contains("SEARCH")
strInput.IndexOf("search", StringComparison.OrdinalIgnoreCase) >= 0
' Case-insensitive comparison
String.Equals(str1, str2, StringComparison.OrdinalIgnoreCase)
str1.Equals(str2, StringComparison.OrdinalIgnoreCase)
String.Format & Concatenation
' Concatenation (primary method in VB.NET UiPath expressions)
"Processing: " + strName + " (ID: " + strId + ")"
' String.Format (use in Assign or expressions)
String.Format("Item {0} of {1}: {2}", intCurrent, intTotal, strName)
String.Format("{0:C2}", decAmount) ' Currency: "$1,234.56"
String.Format("{0:N2}", decNumber) ' Number: "1,234.56"
String.Format("{0:D8}", intNumber) ' Padded: "00000042"
String.Format("{0:P1}", dblRatio) ' Percent: "85.5%"
' VB.NET does NOT support $"interpolated strings" in UiPath expressions!
' Always use + concatenation or String.Format
Data Cleaning Patterns
' Remove all whitespace
strInput.Replace(" ", "")
' Normalize whitespace (collapse multiple spaces to one)
Regex.Replace(strInput, "\s+", " ").Trim
' Remove non-alphanumeric characters
Regex.Replace(strInput, "[^a-zA-Z0-9]", "")
' Remove non-numeric (keep only digits)
Regex.Replace(strInput, "[^\d]", "")
' Clean web-scraped text (common in UiPath)
strInput.Replace(vbCrLf, " ").Replace(vbLf, " ").Replace(vbTab, " ").Trim
' Remove diacritics/accents (normalize to ASCII)
' Requires Invoke Code — too complex for single expression
' Extract digits from string like "Total: $1,234.56"
Regex.Match(strInput, "[\d,]+\.?\d*").Value
' Extract text between two markers
Regex.Match(strInput, "(?<=Start:).*?(?=End:)").Value.Trim
Regex in Expressions
⚠️ Always add System.Text.RegularExpressions to NamespacesForImplementation so you can use short Regex.Match(...) form instead of the verbose System.Text.RegularExpressions.Regex.Match(...). All generated XAML must include this import.
Regex.Match(strInput, "\\d{3}-\\d{4}").Value
Regex.IsMatch(strInput, "^\\d+$")
Regex.Replace(strInput, "[^a-zA-Z0-9]", "")
Regex.Matches(strInput, "\\b\\w+@\\w+\\.\\w+\\b").Count
Regex.Match(strInput, "pattern", RegexOptions.IgnoreCase).Success
Regex.IsMatch(strInput, "pattern", RegexOptions.IgnoreCase)
' Named groups
Regex.Match(strInput, "(?<name>\\w+):(?<value>\\d+)").Groups("name").Value
' Common validation patterns
Regex.IsMatch(strValue, "^[A-Z]{2}\\d{9}$", RegexOptions.None)
Regex.Match(strText, "[\\d,]+\\.?\\d*", RegexOptions.None).Value
Safe extraction (always guard .Groups(N).Value)
Regex.Match(...).Groups(1).Value throws IndexOutOfRangeException when the match fails or the capture group is absent. Always check m.Success and m.Groups.Count before reading a capture. Use the If(...) ternary to fall back to a sentinel:
' Single-line safe extraction with fallback
out_strID = If(Regex.Match(in_strBody, "Client ID:\s*(.+)").Success, _
Regex.Match(in_strBody, "Client ID:\s*(.+)").Groups(1).Value.Trim(), _
String.Empty)
' Preferred: assign once, then guard — avoids re-running the regex
Dim m = Regex.Match(in_strBody, "Client ID:\s*(.+)")
out_strID = If(m.Success AndAlso m.Groups.Count > 1, m.Groups(1).Value.Trim(), String.Empty)
The two-line form (assign + guarded read) is the recommended idiom in spec authoring — it makes the failure mode explicit and avoids running the regex twice. Use the inline form only when expression-language constraints force a single statement.
Unicode Normalization & Diacritics Removal
' Remove diacritics/accents (ã→a, é→e, ñ→n)
' Decomposes characters, then strips combining marks via LINQ on chars
New String(strInput.Normalize(System.Text.NormalizationForm.FormD).Where( _
Function(c) System.Globalization.CharUnicodeInfo.GetUnicodeCategory(c) <> _
System.Globalization.UnicodeCategory.NonSpacingMark).ToArray())
' Practical: normalize + strip non-alpha for fuzzy matching
Regex.Replace( _
New String(strInput.Normalize(System.Text.NormalizationForm.FormD).Where( _
Function(c) System.Globalization.CharUnicodeInfo.GetUnicodeCategory(c) <> _
System.Globalization.UnicodeCategory.NonSpacingMark).ToArray()), _
"[^a-zA-Z]", "")
' Chain: String → Normalize → LINQ Where (filter chars) → ToArray → New String
' Works because String implements IEnumerable(Of Char)
Null/Empty Safety
' Check before operating
String.IsNullOrEmpty(strValue)
String.IsNullOrWhiteSpace(strValue)
' Safe chain pattern — use If() ternary
If(String.IsNullOrEmpty(strInput), "", strInput.Trim.ToUpper)
If(strInput IsNot Nothing, strInput.Trim, "")
' Safe from DataRow (common source of NullReferenceException)
If(row("Column") IsNot Nothing AndAlso Not String.IsNullOrEmpty(row("Column").ToString), row("Column").ToString.Trim, "")
Padding & Alignment
' Pad left (right-align text / zero-pad numbers)
strNumber.PadLeft(8, "0"c) ' "42" → "00000042"
intInvoice.ToString.PadLeft(6, "0"c) ' 123 → "000123"
' Pad right (left-align text)
strName.PadRight(20) ' "Alex" → "Alex "
strName.PadRight(20, "."c) ' "Alex" → "Alex................"
Encoding & Conversion
' Base64 encode/decode
Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(strInput))
System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(strBase64))
' URL encode/decode (for API parameters)
System.Net.WebUtility.UrlEncode(strInput) ' "hello world" → "hello+world"
System.Net.WebUtility.UrlDecode(strEncoded)
' HTML encode/decode (for web-scraped content)
System.Net.WebUtility.HtmlDecode(strHtml) ' "&" → "&"
System.Net.WebUtility.HtmlEncode(strText)
' SecureString to plain text (for credential handling)
New System.Net.NetworkCredential("", secureStr).Password
Common UiPath String Tasks
' Extract filename from path
System.IO.Path.GetFileName(strPath) ' "C:\Data\report.xlsx" → "report.xlsx"
System.IO.Path.GetFileNameWithoutExtension(strPath) ' → "report"
System.IO.Path.GetExtension(strPath) ' → ".xlsx"
' Build dynamic file path with timestamp
System.IO.Path.Combine(strFolder, "Report_" + Now.ToString("yyyyMMdd_HHmmss") + ".xlsx")
' Truncate string safely
If(strInput.Length > 100, strInput.Substring(0, 100) + "...", strInput)
' Extract email domain
strEmail.Split({"@"c})(1) ' "user@example.com" → "example.com"
' Count occurrences of a character
strInput.Length - strInput.Replace(",", "").Length ' count commas
' Multiline string in XAML expression (use vbCrLf)
"Line 1" + vbCrLf + "Line 2" + vbCrLf + "Line 3"
' Clean currency string for parsing
CDbl(strPrice.Replace("$", "").Replace(",", "").Trim) ' "$1,234.56" → 1234.56
CInt(Regex.Replace(strInput, "[^\d]", "")) ' "INV-00123" → 123
DateTime Operations
Core Operations
' Current date/time
DateTime.Now
DateTime.Today ' Date only, time = 00:00:00
DateTime.UtcNow
' Parse
DateTime.Parse("2024-01-15")
DateTime.ParseExact("15/01/2024", "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture)
DateTime.TryParse(strDate, dtResult)
' Arithmetic
dtDate.AddDays(7)
dtDate.AddMonths(-1)
dtDate.AddHours(3)
dtDate.AddMinutes(30)
DateDiff(DateInterval.Day, dtStart, dtEnd) ' VB.NET only
(dtEnd - dtStart).TotalDays ' Both VB.NET and C#
(dtEnd - dtStart).TotalHours
' Components
dtDate.Year / dtDate.Month / dtDate.Day
dtDate.Hour / dtDate.Minute / dtDate.Second
dtDate.DayOfWeek ' Returns DayOfWeek enum
dtDate.DayOfYear ' 1-366
dtDate.Date ' Date component only (strips time)
dtDate.TimeOfDay ' Returns TimeSpan
Format Tokens Reference
' Date formatting — dtDate.ToString("format")
dtDate.ToString("yyyy-MM-dd") ' "2024-01-15"
dtDate.ToString("dd/MM/yyyy") ' "15/01/2024"
dtDate.ToString("MM/dd/yyyy") ' "01/15/2024"
dtDate.ToString("yyyyMMdd") ' "20240115" (compact, good for filenames)
dtDate.ToString("yyyy-MM-dd HH:mm:ss") ' "2024-01-15 14:30:00" (24h)
dtDate.ToString("yyyy-MM-dd hh:mm:ss tt") ' "2024-01-15 02:30:00 PM" (12h)
dtDate.ToString("MMMM dd, yyyy") ' "January 15, 2024"
dtDate.ToString("MMM dd, yyyy") ' "Jan 15, 2024"
dtDate.ToString("ddd, MMM dd") ' "Mon, Jan 15"
dtDate.ToString("dddd, MMMM dd, yyyy") ' "Monday, January 15, 2024"
' Key tokens:
' yyyy=4-digit year yy=2-digit MM=month(01-12) M=month(1-12)
' dd=day(01-31) d=day(1-31) HH=hour24(00-23) hh=hour12(01-12)
' mm=minute(00-59) ss=second tt=AM/PM fff=milliseconds
' MMM=abbreviated month MMMM=full month ddd=abbreviated day dddd=full day
' Timestamp for filenames (no colons or slashes)
Now.ToString("yyyyMMdd_HHmmss") ' "20240115_143000"
' ISO 8601
dtDate.ToString("o") ' "2024-01-15T14:30:00.0000000"
dtDate.ToString("yyyy-MM-ddTHH:mm:ssZ") ' "2024-01-15T14:30:00Z"
' Culture-specific formatting
dtDate.ToString("d", New System.Globalization.CultureInfo("pt-BR")) ' "15/01/2024"
dtDate.ToString("D", New System.Globalization.CultureInfo("en-US")) ' "Monday, January 15, 2024"
First/Last Day & Period Boundaries
' First day of current month
New DateTime(Now.Year, Now.Month, 1)
' Last day of current month
New DateTime(Now.Year, Now.Month, DateTime.DaysInMonth(Now.Year, Now.Month))
' First day of next month
New DateTime(Now.Year, Now.Month, 1).AddMonths(1)
' First day of current year
New DateTime(Now.Year, 1, 1)
' Last day of current year
New DateTime(Now.Year, 12, 31)
' Start of today (midnight)
DateTime.Today ' or: Now.Date
' End of today (just before midnight)
DateTime.Today.AddDays(1).AddTicks(-1)
' Days in a month
DateTime.DaysInMonth(2024, 2) ' 29 (leap year)
' Is leap year
DateTime.IsLeapYear(2024) ' True
Business Day & Weekday Patterns
' Is weekday?
dtDate.DayOfWeek <> DayOfWeek.Saturday AndAlso dtDate.DayOfWeek <> DayOfWeek.Sunday
' Is weekend?
dtDate.DayOfWeek = DayOfWeek.Saturday OrElse dtDate.DayOfWeek = DayOfWeek.Sunday
' Next business day (simple — no holidays)
If(dtDate.DayOfWeek = DayOfWeek.Friday, dtDate.AddDays(3),
If(dtDate.DayOfWeek = DayOfWeek.Saturday, dtDate.AddDays(2), dtDate.AddDays(1)))
' Get day name
dtDate.DayOfWeek.ToString ' "Monday"
dtDate.ToString("dddd") ' "Monday" (locale-dependent)
' Start of week (Monday)
dtDate.AddDays(-(CInt(dtDate.DayOfWeek) + 6) Mod 7)
TimeSpan
' Create
New TimeSpan(1, 30, 0) ' 1 hour, 30 minutes, 0 seconds
TimeSpan.FromMinutes(90)
TimeSpan.FromHours(2.5)
TimeSpan.FromDays(7)
' From date difference
Dim tsDiff As TimeSpan = dtEnd - dtStart
tsDiff.TotalDays ' Double (e.g., 1.5)
tsDiff.TotalHours
tsDiff.TotalMinutes
tsDiff.Days ' Integer part only
' Format TimeSpan
tsDiff.ToString("hh\:mm\:ss") ' "01:30:00" (must escape colons!)
tsDiff.ToString("d\.hh\:mm") ' "1.01:30"
File & Path Operations
' Path operations (System.IO.Path)
Path.Combine(strFolder, strFileName)
Path.GetFileName(strFilePath) ' "file.xlsx"
Path.GetFileNameWithoutExtension(strPath) ' "file"
Path.GetExtension(strPath) ' ".xlsx"
Path.GetDirectoryName(strPath) ' parent folder
Path.GetTempPath ' temp folder (correct way)
Path.GetTempFileName ' temp file path
' ⚠️ Environment.SpecialFolder.Temp does NOT exist — compile error BC30456.
' Use Path.GetTempPath() instead. Valid SpecialFolders: Desktop, MyDocuments,
' LocalApplicationData, ApplicationData, CommonApplicationData, UserProfile.
' Directory operations (use in Invoke Code or assign)
Directory.GetFiles(strFolderPath, "*.xlsx")
Directory.GetFiles(strFolderPath, "*.pdf", SearchOption.AllDirectories)
Directory.GetDirectories(strFolderPath)
Directory.Exists(strFolderPath)
File.Exists(strFilePath)
Array & List Operations
Array (Fixed Size)
' Initialize (in Assign — variable type String[])
New String() {"item1", "item2", "item3"}
New Integer() {1, 2, 3}
' Initialize empty with size
New String(9) {} ' 10-element empty array (0-9)
' Access
arrItems(0) ' First element
arrItems(arrItems.Length - 1) ' Last element
' Properties
arrItems.Length ' Element count
arrItems.Contains("search") ' Boolean — case-sensitive
' LINQ on arrays (requires System.Linq imported)
arrItems.First ' First element (throws if empty)
arrItems.Last ' Last element
arrItems.FirstOrDefault ' First or Nothing
arrItems.Where(Function(x) x.Contains("test")).ToArray
arrItems.Select(Function(x) x.Trim.ToUpper).ToArray
arrItems.OrderBy(Function(x) x).ToArray
arrItems.Distinct.ToArray
arrItems.Any(Function(x) x = "target")
arrItems.Count(Function(x) x.StartsWith("A"))
' Convert
arrItems.ToList ' Array → List
String.Join(", ", arrItems) ' Array → delimited string
Split → Array Patterns (Very Common in UiPath)
' Single char delimiter — MUST use "c" suffix
strInput.Split({";"c}) ' Returns String()
strInput.Split({","c}, StringSplitOptions.RemoveEmptyEntries)
' String delimiter — NO "c" suffix, use string array
strInput.Split({"||"}, StringSplitOptions.None) ' Multi-char delimiter
strInput.Split({">"}, StringSplitOptions.None) ' Single-char as string also works
' Split + LINQ access
strInput.Split({">"}).First.ToString.Trim ' First part
strInput.Split({">"}).Last.ToString.Trim ' Last part
strInput.Split({";"c})(0) ' First by index
' Multiline split
strInput.Split({vbCrLf, vbLf}, StringSplitOptions.RemoveEmptyEntries)
strInput.Split({Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries)
VB.NET Split delimiter rules:
","c— char literal (single character, usescsuffix){","c}— char array (for Split overload, wraps in array){"||"}— string array (multi-character delimiter, NOcsuffix){";"c, ","c}— multiple char delimiters{" - ", " | "}— multiple string delimiters
List (Dynamic Size)
' Initialize (variable type List<String> = scg:List(x:String))
New List(Of String)
New List(Of String) From {"item1", "item2"}
' Add / Remove
listItems.Add("newItem")
listItems.AddRange(arrMoreItems)
listItems.Insert(0, "first") ' Insert at index
listItems.Remove("item1") ' Remove first occurrence
listItems.RemoveAt(0) ' Remove by index
listItems.Clear ' Remove all
' Access
listItems(0) ' By index
listItems.Count ' Element count (NOT .Length)
listItems.Contains("search")
listItems.IndexOf("item") ' Returns -1 if not found
' LINQ
listItems.Where(Function(x) x.Length > 3).ToList
listItems.Select(Function(x) x.ToUpper).ToList
listItems.OrderBy(Function(x) x).ToList
listItems.Distinct.ToList
' Convert
listItems.ToArray ' List → Array
Collection XAML Types
Use these type names in the variables array of the JSON spec for generate_workflow.py:
| JSON type | XAML TypeArguments |
|---|---|
"Array_String" |
s:String[] |
"scg:List(x:String)" |
scg:List(x:String) |
"scg:Dictionary(x:String, x:Object)" |
scg:Dictionary(x:String, x:Object) |
"scg:KeyValuePair(x:String, x:Double)" |
scg:KeyValuePair(x:String, x:Double) |
For gen_foreach(), pass the item type as item_type (e.g., "x:String"). The generator handles ActivityAction and DelegateInArgument wrapping.
Open this reference as its own page
XAML Generation & Object Repository
Object Repository, Workflow Generation CLI (JSON specs), and Activity Generators (94 core generators + additional from installed plugin skills). For project scaffolding see scaffolding.md. For decomposition rules see decomposition.md.
Object Repository
When a process has UI automation, generate an Object Repository to centrally manage all UI element definitions. This makes the project match Studio's native object-based targeting — elements are stored once in .objects/ and referenced from XAML via Reference + ContentHash attributes.
Generation Flow
from generate_object_repository import generate_object_repository
# 1. Define applications, screens, and elements from PDD analysis
apps = [{
"name": "ACME System1", # App display name
"selector": "<html app='msedge.exe' title='ACME' />", # Window selector
"url": "https://acme.example.com/login", # App URL
"browser_type": "Edge", # Edge | Chrome | Firefox
"screens": [{
"name": "Login",
"url": "https://acme.example.com/login",
"elements": [
{"name": "Username", "taxonomy_type": "Input", "selector": "<webctrl id='username' tag='INPUT' />"},
{"name": "Password", "taxonomy_type": "Password", "selector": "<webctrl id='password' tag='INPUT' />"},
{"name": "Login Btn", "taxonomy_type": "Button", "selector": "<webctrl id='loginBtn' tag='BUTTON' />"},
]
}]
}]
# 2. Generate .objects/ tree (call AFTER scaffold_project)
refs = generate_object_repository(apps, project_dir)
# 3. Pass references to activity generators
elem_ref = refs["elements"]["ACME System1/Login/Username"]
gen_ntypeinto("Type Into 'Username'", "<webctrl id='username' tag='INPUT' />",
"in_strUsername", "NTypeInto_1", scope_id, obj_repo=elem_ref)
app_ref = refs["apps"]["ACME System1"]
gen_napplicationcard_open("ACME System1", "strUrl", "elApp", scope_guid,
"NApplicationCard_1", body, body_seq,
target_app_selector="<html app='msedge.exe' title='ACME' />",
obj_repo_app=app_ref)
Taxonomy Types
| TaxonomyType | ElementType | Use for |
|---|---|---|
| Input | InputBox | Text fields |
| Password | InputBoxPassword | Password fields |
| Button | Button | Buttons, submit controls |
| Dropdown | DropDown | Select/dropdown controls |
| Link | Link | Hyperlinks |
| CheckBox | CheckBox | Checkboxes |
| RadioButton | RadioButton | Radio buttons |
| Text | Text | Read-only text elements |
What Gets Generated
.objects/— Full hierarchy: Library → App → AppVersion → Screen → Element.entities/— Empty (reserved for Studio).templates/— Empty (reserved for Studio).tmh/config.json— Test management hook config.screenshots/— Empty (Studio regenerates on first interaction)
XAML Integration
Activities get two extra attributes on TargetAnchorable:
Reference="LibraryId/ElementId"— links to Object Repository entryContentHash="..."— integrity check against Object Repository XML
NApplicationCard.TargetApp gets the same attributes linking to the screen-level reference.
Object Repository (Post-Generation)
After generating all workflow XAML files, if selectors.json exists in the project directory, generate the Object Repository:
python3 scripts/generate_object_repository.py --from-selectors <project>/selectors.json --project-dir <project>
This creates the .objects/ directory tree matching UiPath Studio's Object Repository format. This step is mandatory for UI automation projects — lint 94 catches missing Object Repositories.
Wiring Object Repository References into JSON Specs (MANDATORY)
After generating the Object Repository (Phase 2c), the returned refs.json contains reference paths and content hashes for every element. You MUST inject these into every UI activity's JSON spec args (Rule G-9):
For UI activities (ntypeinto, nclick, ncheck, ncheckstate, nselectitem, ngettext, nhover, etc.):
{"gen": "ntypeinto", "args": {
"display_name": "Type Into 'Email'",
"selector": "<webctrl id='email' tag='INPUT' />",
"text_variable": "strEmail",
"obj_repo": {
"reference": "tDVvDluzTB-bqL3Nni6-OA/CY0fwCmbTAiwxY-rk6gyEQ",
"content_hash": "j8tYRRS2SxtP12HUGLEwCw",
"guid": "a9b0fa4c-20c2-4c3c-9b53-a77cb07b31bb"
}
}}
Values come from refs.json → elements → "AppName/ScreenName/ElementName".
For NApplicationCard (browser open or desktop open):
{"gen": "napplicationcard_open", "args": {
"display_name": "ACME",
"url_variable": "in_strUrl",
"out_ui_element": "out_uiACME",
"target_app_selector": "<html app='msedge.exe' title='ACME' />",
"obj_repo_app": {
"reference": "tDVvDluzTB-bqL3Nni6-OA/XZmrq88iTjqxOKeVRByavw",
"content_hash": "_qeOSAtNnm39HJig9mPTCg"
}
}}
Values come from refs.json → apps → "AppName".
Skip obj_repo for: NCheckState activities that verify non-tracked elements (e.g., waiting for a group box label to appear — if the element isn't in selectors.json, it has no OR entry).
⛔ Without obj_repo bindings, selectors are hardcoded in every activity — the Object Repository exists but is unused. Refactoring a selector requires finding every inline copy across the project.
Workflow Generation CLI
scripts/generate_workflow.py is the PRIMARY way to create .xaml workflow files. The agent writes a JSON spec describing arguments, variables, and activities — the script calls all deterministic generators internally and outputs a complete, validated .xaml file.
⛔ Rule G-1 — Never write .xaml by hand. See rules.md for rationale.
Usage
python3 scripts/generate_workflow.py spec.json Workflows/ACME/ACME_Launch.xaml --project-dir <project>
The --project-dir flag enables automatic Object Repository wiring: the script loads .objects/refs.json and injects Reference= and ContentHash= attributes into every TargetAnchorable whose selector matches an Object Repository element. This replaces the need for manual obj_repo injection in JSON specs. Always pass --project-dir after the Object Repository has been generated (Phase 2c).
JSON Spec Format
{
"class_name": "ACME_Launch",
"arguments": [
{"name": "in_strUrl", "direction": "In", "type": "String"},
{"name": "out_uiACME", "direction": "Out", "type": "UiElement"}
],
"variables": [
{"name": "strUsername", "type": "String"},
{"name": "secstrPassword", "type": "SecureString"}
],
"activities": [
{"gen": "log_message", "args": {"message_expr": "\"[START] ACME_Launch\""}},
{
"gen": "napplicationcard_open",
"args": {"display_name": "ACME", "url_variable": "in_strUrl",
"out_ui_element": "out_uiACME",
"target_app_selector": "<html app='msedge.exe' title='ACME' />",
"obj_repo_app": {"reference": "LIB_ID/APP_ID", "content_hash": "HASH"}},
"children": [
{"gen": "ntypeinto", "args": {"display_name": "Type Into 'Email'",
"selector": "<webctrl id='email' tag='INPUT' />", "text_variable": "strUsername",
"obj_repo": {"reference": "LIB_ID/ELEM_ID", "content_hash": "HASH", "guid": "GUID"}}},
{"gen": "nclick", "args": {"display_name": "Click 'Login'",
"selector": "<webctrl tag='BUTTON' aaname='Login' />",
"obj_repo": {"reference": "LIB_ID/ELEM_ID", "content_hash": "HASH", "guid": "GUID"}}}
]
},
{"gen": "log_message", "args": {"message_expr": "\"[END] ACME_Launch\""}}
]
}
Supported Generators (gen field) — 94 core + plugin extensions
UI: ntypeinto, nclick, nhover, ndoubleclick, nrightclick, ngettext, ncheckstate, nselectitem, nkeyboardshortcuts, nmousescroll, ngotourl, ngeturl, nextractdata, pick_login_validation, napplicationcard_open, napplicationcard_attach, napplicationcard_close, napplicationcard_desktop_open
Control flow: if, if_else_if, switch, foreach, foreach_row, foreach_file, while, do_while, flowchart, state_machine, parallel, parallel_foreach
Error/invoke: try_catch, throw, rethrow, retryscope, invoke_workflow, invoke_code, invoke_method
Data: assign, multiple_assign, build_data_table, add_data_row, add_data_column, filter_data_table, sort_data_table, remove_duplicate_rows, output_data_table, join_data_tables, lookup_data_table, merge_data_table, generate_data_table, deserialize_json
Orchestrator: add_queue_item, get_queue_item, getrobotcredential, get_robot_asset, net_http_request
File: copy_file, move_file, delete_file, path_exists, create_directory, read_text_file, write_text_file, read_csv, write_csv
Excel/PDF/Email: read_range, write_range, write_cell, read_pdf_text, read_pdf_with_ocr, send_mail, get_imap_mail, save_mail_attachments
Database: database_connect, execute_query, execute_non_query
Tasks: create_form_task, wait_for_form_task
SAP WinGUI: sap_logon, sap_login, sap_call_transaction, sap_click_toolbar, sap_select_menu_item, sap_read_statusbar, sap_table_cell_scope, sap_status_bar_check, sap_type_into_cell
Dialogs/misc: input_dialog, message_box, log_message, comment, comment_out, delay, break, continue, kill_process, terminate_workflow, should_stop, add_log_fields, remove_log_fields, take_screenshot_and_save
Containers (with children): napplicationcard_open, napplicationcard_attach, napplicationcard_close, napplicationcard_desktop_open, retryscope, comment_out, while, do_while, foreach, foreach_row, foreach_file, parallel, parallel_foreach
Containers (named children): try_catch (try_children, finally_children, args.catches[].children), if (then_children, else_children), if_else_if (args.conditions[].children, else_children), switch (args.cases[].children, default_children), ncheckstate (if_exists_children, if_not_exists_children)
Type Shortcuts
| JSON type | XAML type |
|---|---|
| String | x:String |
| Int32 | x:Int32 |
| Boolean | x:Boolean |
| DataTable | sd:DataTable |
| SecureString | ss:SecureString |
| UiElement | ui:UiElement |
| Dictionary | scg:Dictionary(x:String, x:Object) |
| QueueItem | ui:QueueItem |
Activity Generators (MANDATORY for UI activities)
ALWAYS use scripts/generate_activities for UI automation activities. These generators produce structurally correct XAML with hardcoded enums, versions, and child elements from golden Studio 24.10 exports. Hand-writing these activities leads to hallucinated enum values, missing child elements, and Studio crashes.
Available Generators
| Generator | Activity | Key properties locked down |
|---|---|---|
gen_ntypeinto() |
NTypeInto | EmptyFieldMode (SingleLine/MultiLine/None), ClickBeforeMode enum, VerifyOptions block, Version=V5 |
gen_nclick() |
NClick | ClickType, MouseButton, KeyModifiers, Version=V5 |
gen_ngettext() |
NGetText | selector OR InUiElement (mutually exclusive), Version=V5 |
gen_ncheckstate() |
NCheckState | IfExists/IfNotExists Sequence blocks with ViewState, Version=V5 |
gen_ngotourl() |
NGoToUrl | Version=V3 with ViewState |
gen_napplicationcard_open() |
NApplicationCard | OpenMode=Always, CloseMode=Never, full OCR+TargetApp blocks |
gen_napplicationcard_attach() |
NApplicationCard | OpenMode=Never, CloseMode=Never, AttachMode=SingleWindow |
gen_napplicationcard_close() |
NApplicationCard | OpenMode=Never, CloseMode=Always |
gen_nselectitem() |
NSelectItem | Item= binding (dynamic or {x:Null}), Items list, Version=V1 |
gen_nextractdata() |
NExtractDataGeneric | ExtractedData (not Result!), Version=V5, backtick IdRef |
gen_add_queue_item() |
AddQueueItem | .ItemInformation (not .DictionaryCollection!), bare InArguments, QueueType (not QueueName!) |
gen_getrobotcredential() |
GetRobotCredential | CacheStrategy=None, TimeoutMS null |
gen_logmessage() |
LogMessage | Level validation (Info/Warn/Error/Trace) |
gen_throw() |
Throw | Exception expression |
gen_invoke_workflow() |
InvokeWorkflowFile | Arguments block with direction/type/key |
gen_retryscope() |
RetryScope | ActivityBody + Condition blocks |
gen_pick_login_validation() |
Pick (2-branch) | Complete login validation with NCheckState triggers |
gen_assign() |
Assign | To/Value with configurable TypeArguments |
gen_variables_block() |
Sequence.Variables / Flowchart.Variables | Auto-normalizes array types (x:String[] → s:String[]) |
gen_multiple_assign() |
MultipleAssign | scg:List > AssignOperation > To/Value element syntax, Capacity |
gen_foreach_row() |
ForEachRow | ActivityAction(sd:DataRow), DelegateInArgument, body Sequence |
gen_net_http_request() |
NetHttpRequest | uwah: namespace, all {x:Null} props, FormDataParts, built-in RetryCount/RetryPolicyType/RetryStatusCodes (NO RetryScope) |
gen_try_catch() |
TryCatch | ActivityAction per Catch, DelegateInArgument, specific→generic ordering |
gen_if() |
If | InArgument x:TypeArguments="x:Boolean" Condition element syntax |
gen_get_queue_item() |
GetQueueItem + RetryScope | QueueType (not QueueName!), .Reference/.TimeoutMS children, auto-wrapped |
gen_deserialize_json() |
DeserializeJson | ui: prefix, njl:JObject type, JsonString/JsonObject (not JsonInput/Output) |
gen_switch() |
Switch | x:TypeArguments, backtick IdRef, x:Key case labels, Switch.Default |
gen_foreach() |
ForEach | ui: prefix (not default ns!), ActivityAction, DelegateInArgument, CurrentIndex={x:Null} |
gen_foreach_file() |
ForEachFileX | Dual DelegateInArguments (FileInfo+Int32), si: namespace, no ContinueOnError |
gen_if_else_if() |
IfElseIfV2 | sc:BindingList, IfElseIfBlock (not IfElseIfV2Condition!), Else (not ElseBody!) |
gen_add_data_row() |
AddDataRow | ArrayRow attribute (not element), DataRow={x:Null} when using ArrayRow |
gen_add_data_column() |
AddDataColumn | TypeArguments for column type, all {x:Null} optional props |
gen_filter_data_table() |
FilterDataTable | .Filters (NOT FilterRowsCollection!), Operator="EQ" attr (NOT Operand!), .Column/.Operand child elements with InArgument (NOT ColumnName/Value attrs!). Operators: ALL CAPS — EQ NE LT LE GT GE CONTAINS STARTS_WITH ENDS_WITH EMPTY NOT_EMPTY. EMPTY/NOT_EMPTY use Operand="{x:Null}". Supports typed operands (5-tuple with x:Int32). NEVER hand-write — structure is complex and 100% hallucinated every time |
gen_get_robot_asset() |
GetRobotAsset + RetryScope | .Value element syntax (not Result!), auto-wrapped |
gen_output_data_table() |
OutputDataTable | Text property (not Output!) |
gen_sort_data_table() |
SortDataTable | ColumnName (not OrderByColumnName!), SortOrder (not OrderByType!) |
gen_remove_duplicate_rows() |
RemoveDuplicateRows | In-place or new output variable |
gen_while() |
While | Condition with XML entity encoding |
gen_do_while() |
DoWhile | Executes body at least once |
gen_delay() |
Delay | TimeSpan.FromSeconds expression |
gen_rethrow() |
Rethrow | Preserves stack trace |
gen_copy_file() |
CopyFile | Overwrite flag, {x:Null} resource props |
gen_move_file() |
MoveFile | Same structure as CopyFile |
gen_delete_file() |
DeleteFileX | NO ContinueOnError (X-suffix activity!) |
gen_path_exists() |
PathExists | PathType="File" or "Folder" |
gen_create_directory() |
CreateDirectory | Safe on existing dirs |
gen_input_dialog() |
InputDialog | Result element syntax, Options={x:Null} (use OptionsString!) |
gen_message_box() |
MessageBox | Caption/ChosenButton {x:Null} defaults |
gen_comment() |
Comment | Simple text annotation |
gen_comment_out() |
CommentOut | Wraps activities in disabled scope |
gen_invoke_code() |
InvokeCode | XML-encoded code string, In/Out/InOut arguments, Language="VBNet"/"CSharp" |
gen_invoke_method() |
InvokeMethod | Instance (TargetObject) vs static (TargetType), positional params |
gen_join_data_tables() |
JoinDataTables | JoinOperationArgument with Column1/Column2 (not Column!) |
gen_lookup_data_table() |
LookupDataTable | VLOOKUP-style: LookupColumnName + TargetColumnName |
gen_merge_data_table() |
MergeDataTable | MissingSchemaAction enum |
gen_generate_data_table() |
GenerateDataTable | ColumnSeparators as VB char array |
gen_ngeturl() |
NGetUrl | Version="V4", inside NApplicationCard scope |
gen_read_range() |
ReadRange (Excel) | Workbook classic, no Excel app needed |
gen_write_range() |
WriteRange (Excel) | Creates file if not exists |
gen_write_cell() |
WriteCell (Excel) | Dynamic cell address via VB expression |
gen_database_connect() |
DatabaseConnect | ConnectionSecureString (not ConnectionString!) |
gen_execute_query() |
ExecuteQuery | Parameterized @params, scg:Dictionary for params |
gen_execute_non_query() |
ExecuteNonQuery | Parameterized INSERT/UPDATE/DELETE |
gen_take_screenshot_and_save() |
TakeScreenshot+SaveImage | Paired pattern, ui:Image variable type, Target element |
gen_flowchart() |
Flowchart | av: namespace, __ReferenceID naming, StartNode, FlowDecision VisualBasicValue, x:Reference list |
gen_read_pdf_text() |
ReadPDFText | FileName (not FilePath), Text (not Result), PreserveFormatting={x:Null} |
gen_read_pdf_with_ocr() |
ReadPDFWithOCR | ActivityFunc delegate with sd:Image/sd1:Rectangle types, ui:GoogleOCR engine, Image=[Image] binding |
gen_send_mail() |
SendMail | Integration Service connection, AttachmentsBackup/ConnectionDetailsBackupSlot boilerplate, ~15 {x:Null} props |
gen_build_data_table() |
BuildDataTable | XSD schema in TableInfo attribute (NOT child elements!), self-closing tag. Prevents lint 48 hallucinations |
gen_create_form_task() |
CreateFormTask | Tasks form with {} JSON escape, FormData direction-typed bindings, TaskOutput (NOT TaskObject!), ~15 {x:Null} props |
gen_wait_for_form_task() |
WaitForFormTaskAndResume | Persistence point — MUST be in Main.xaml. TaskInput (NOT TaskObject!), paired with CreateFormTask |
gen_get_imap_mail() |
GetIMAPMailMessages | Integration Service email, ConnectionDetailsBackupSlot boilerplate, ~12 {x:Null} props |
gen_save_mail_attachments() |
SaveMailAttachments | Correct IEnumerable(x:String) output type (NOT List(String)!), filter wildcard |
gen_napplicationcard_desktop_open() |
NApplicationCard (desktop) | TargetApp.FilePath (NOT Url!), no IsIncognito/BrowserType, Simulate or HardwareEvents (NOT DebuggerApi!) |
gen_nhover() |
NHover | HoverTime (seconds), CursorMotionType (Instant/Smooth), Version=V5 |
gen_ndoubleclick() |
NClick (ClickType=Double) | Same as gen_nclick with ClickType="Double" |
gen_nrightclick() |
NClick (MouseButton=Right) | Same as gen_nclick with MouseButton="Right" |
gen_nkeyboardshortcuts() |
NKeyboardShortcuts | Shortcuts string (hotkey notation), optional selector target, InteractionMode=HardwareEvents |
gen_nmousescroll() |
NMouseScroll | Direction (Down/Up/Left/Right), MovementUnits, InteractionMode |
gen_parallel() |
Parallel | Multiple branches executing concurrently, CompletionCondition |
gen_parallel_foreach() |
ParallelForEach | Concurrent iteration, DelegateInArgument, ActivityAction |
gen_state_machine() |
StateMachine | States with Transitions, InitialState x:Reference, FinalState support |
gen_break() |
Break | Exit innermost ForEach/While/DoWhile loop |
gen_continue() |
Continue | Skip to next iteration of loop |
gen_kill_process() |
KillProcess | ProcessName string — use in KillAllProcesses only |
gen_terminate_workflow() |
TerminateWorkflow | Exception expression, Reason string |
gen_add_log_fields() |
AddLogFields | Dict of field name → expression, custom structured logging |
gen_remove_log_fields() |
RemoveLogFields | List of field names to remove from log context |
gen_should_stop() |
ShouldStop | Result bool variable, checks Orchestrator stop signal |
gen_read_csv() |
ReadCsvFile | FilePath or PathResource, Delimitator enum, HasHeaders, Encoding |
gen_write_csv() |
AppendWriteCsvFile | CsvAction (Write/Append), Delimitator, ShouldQuote, AddHeaders |
gen_read_text_file() |
ReadTextFile | File or FileName (path variable), Content output, Encoding |
gen_write_text_file() |
WriteTextFile | File or FileName (path variable), Text input, Encoding |
Usage Pattern
from scripts.generate_activities import *
scope_guid = "..." # from NApplicationCard ScopeGuid
# Each call returns complete XAML string — just concatenate
body = gen_ntypeinto("Type Into 'Email'", "<webctrl tag='INPUT' id='email' />",
"strEmail", "NTypeInto_1", scope_guid)
body += "\n" + gen_nclick("Click 'Submit'", "<webctrl tag='BUTTON' />",
"NClick_1", scope_guid)
What the model still provides
display_name: Human-readable nameselector: From Playwright MCP inspectionvariable names: Following UiPath naming conventionsid_ref: Unique IdRef per file (NTypeInto_1, NClick_1, etc.)scope_id: UUID matching parent NApplicationCard's ScopeGuid- Composition: wrapping in RetryScope, ordering activities, building workflow structure
What the generators lock down (model CANNOT override)
- Enum values (EmptyFieldMode, ClickBeforeMode, OpenMode, CloseMode, etc.)
- Version numbers (V5 for activities, V6 for TargetAnchorable, V2 for NApplicationCard)
- Child element structures (VerifyOptions, OCREngine, TargetApp, IfExists/IfNotExists)
- HintSize attributes (from golden samples)
- Property names (EmptyFieldMode not EmptyField, ClickBeforeMode not ClickBeforeTyping)
Open this reference as its own page
Golden Templates — Real Studio-Exported XAML
All templates are real UiPath Studio exports (Windows target, VB.NET). One clean REFramework template serves as the base for both Dispatcher and Performer variants — the scaffold_project.py script applies variant-specific transformations at scaffolding time.
Contents
- Template Inventory (Simple Sequence, Sequence Template, REFramework, Sample Workflows, Selection Decision Tree)
- Key Differences: Dispatcher vs Performer (Transaction Item Types)
- Activities Not in Templates
- Modification Rules
Template Inventory
Simple Sequence (assets/simple-sequence/)
Non-REFramework starter project. Use as golden reference samples — these contain real Studio-exported XAML with correct namespaces, ViewState, and activity patterns. Do NOT scaffold from this folder directly; use assets/simple-sequence-template/ for scaffolding.
Simple Sequence Template (assets/simple-sequence-template/)
Clean scaffolding template for non-REFramework projects. Contains minimal Main.xaml with placeholder activities and project.json with only UiPath.System.Activities. Used by scaffold_project.py --variant sequence.
| File | Lines | Purpose | Best Template For |
|---|---|---|---|
Main.xaml |
— | Sequence with DataTable ops, Assign, Flowchart, Switch | Non-REFramework projects, activity pattern reference |
FormFilling_Main.xaml |
— | NApplicationCard (IfNotOpen, Maximize), ReadRange, ForEachRow, NTypeInto, NSelectItem, NClick, NCheckState (IfExists/IfNotExists), NGetText, MultipleAssign, WriteCell, Assign | Web form filling from Excel data, browser automation with conditional branching |
PDFExtraction_Main.xaml |
— | ForEachFileX, ReadPDFText, ReadPDFWithOCR (GoogleOCR/Tesseract), If (native vs scanned fallback), Regex extraction, BuildDataTable, MultipleAssign, AddDataRow (ArrayRow with variables), WriteRange, LogMessage | PDF data extraction with OCR fallback, bulk file processing to Excel |
WebScraping_Sequence1.xaml |
— | NApplicationCard (ByInstance, OCREngine delegate), NExtractDataGeneric (ExtractDataSettings, ExtractMetadata, NextLink pagination), TargetAnchorable (ImageBase64, BrowserURL) | Web scraping structured table data with pagination |
⚠️ NExtractDataGeneric note: The golden sample was exported without
ExtractedData=(no variable assignment). When generating XAML, you MUST addExtractedData="[dt_variable]"to capture output. Do NOT useDataTable=orResult=— neither exists as a property.DataTableinx:TypeArguments="sd2:DataTable"is the generic type parameter, not a property name.
⚠️ Use stripped excerpts for reading. The full Studio files contain verbose visual metadata (TargetAnchorable images, ViewState layout). Read from
assets/stripped/instead:
stripped/FormFilling_Main.xaml(299 lines, 26KB) — vs original 94KBstripped/REFramework_Main.xaml(595 lines, 47KB) — vs original 92KBstripped/SetTransactionStatus.xaml(500 lines, 38KB) — vs original 66KBFull originals in
assets/simple-sequence/andassets/reframework/are needed only for Studio validation (--golden).
These templates contain real examples of: BuildDataTable (with XSD schema), AddDataRow, FilterDataTable, Assign, Flowchart with FlowDecision, Switch with cases + default, InvokeWorkflowFile (modular decomposition), NSelectItem with Items list, NCheckState with IfExists/IfNotExists, MultipleAssign with AssignOperations, WriteCell (per-cell Excel write), ForEachRow inside NApplicationCard, loop-scoped variables.
REFramework (assets/reframework/)
Single clean template for both Dispatcher and Performer. The scaffold_project.py script applies dispatcher-specific transformations (TransactionItem type swap to sd:DataRow, Process.xaml dispatcher comments) when --variant dispatcher is used.
Performer (default): Transaction type ui:QueueItem — processes Orchestrator queue items.
Dispatcher: Transaction type swapped to sd:DataRow (or other type depending on data source) — reads data and creates queue items.
| File | Lines | Purpose | Best Template For |
|---|---|---|---|
Main.xaml |
— | StateMachine (4 states: Init, GetTransaction, Process, EndProcess) | REFramework StateMachine |
Framework/Process.xaml |
— | Clean placeholder — LogMessage + Comment | Starting point for business logic |
Framework/SetTransactionStatus.xaml |
— | 3-branch Flowchart status handling | Multi-branch Flowchart |
Framework/InitAllSettings.xaml |
— | Config reader with ForEach + TryCatch | ForEachRow, TryCatch, config patterns |
Framework/RetryCurrentTransaction.xaml |
— | Retry counter logic | Counter manipulation, conditionals |
Framework/GetTransactionData.xaml |
— | Gets next transaction item | If/Else branching, counter logic |
Framework/TakeScreenshot.xaml |
— | Screenshot utility | File/directory operations |
Framework/InitAllApplications.xaml |
— | Sequence with In argument | Placeholder with arguments |
Framework/CloseAllApplications.xaml |
— | Simple sequence + annotation | Simplest sequence |
Framework/KillAllProcesses.xaml |
— | ForEach + KillProcess with TryCatch per process, arg: in_arrProcessesToKill |
Process cleanup template |
Tests/*.xaml |
6 files | Unit test cases for each framework file | Test workflow patterns |
project.json |
— | Core deps: System, UIAutomation, Excel, Testing | REFramework project configuration |
Sample Workflows (assets/samples/common-workflows/)
Clean, generic workflow patterns extracted from real projects. NOT scaffolded — use grep to extract specific activity patterns.
⚠️ This sample project models the mandatory folder structure. Main stays at project root, all sub-workflows are organized inside Workflows/ by application or utility. Replicate this structure in every generated project:
common-workflows/
├── HttpApiDispatcher_Main.xaml # Main — orchestration only
└── Workflows/
├── Api/
│ └── Api_FetchInvoices.xaml # Credential + OAuth + HTTP fetch
├── Dispatcher/
│ └── ExcelDispatcher_Process.xaml # Excel row → AddQueueItem dispatch
├── Performer/
│ └── Performer_Process.xaml # QueueItem extraction + invoke sub-workflows
├── WebAppName/
│ └── WebAppName_Launch.xaml # App launch + login
└── Utils/
├── App_Close.xaml # Generic app/browser close
└── Browser_NavigateToUrl.xaml # Generic browser navigation
| File | Lines | Purpose | Best Template For |
|---|---|---|---|
HttpApiDispatcher_Main.xaml |
— | Orchestration-only Main: InvokeWorkflowFile to Api_FetchInvoices, ForEach JToken, AddQueueItem with ItemInformation | Dispatcher orchestration, InvokeWorkflowFile, queue dispatch, modular decomposition |
Workflows/Api/Api_FetchInvoices.xaml |
— | Dedicated API workflow: GetRobotCredential, NetHttpRequest (OAuth POST + GET), DeserializeJson, RetryScope with HTTP status check | HTTP/REST API calls, OAuth2 client_credentials, GetRobotCredential, RetryScope, JSON parsing |
Workflows/WebAppName/WebAppName_Launch.xaml |
— | App launch + login: NApplicationCard, GetRobotCredential (RetryScope), NTypeInto (username + SecureText password), NClick login, Pick with dual PickBranch for success/failure validation, NGetText + Throw on error | App login (web or desktop), GetRobotCredential, Pick/PickBranch, SecureString password, login validation |
Workflows/Utils/App_Close.xaml |
— | NApplicationCard with CloseMode=Always, arg: in_uiApp (UiElement). Works for both web and desktop apps. No logout needed (incognito kills browser session) | App/browser close |
Workflows/Utils/Browser_NavigateToUrl.xaml |
— | NApplicationCard + GoToUrl | Browser navigation |
Workflows/Performer/Performer_Process.xaml |
— | QueueItem SpecificContent extraction, MultipleAssign, If + Throw BRE validation, InvokeWorkflowFile with Config args | Performer Process.xaml body, QueueItem field extraction, input validation, sub-workflow invocation |
Workflows/Dispatcher/ExcelDispatcher_Process.xaml |
— | DataRow column extraction, MultipleAssign, If + Throw BRE validation, AddQueueItem with ItemInformation fields | Excel Dispatcher Process.xaml body, DataRow to QueueItem dispatch, field mapping |
Incognito mode:
WebAppName_Launch.xamlusesIsIncognito="True". No explicit logout needed — closing the browser destroys the session. Seeskill-guide.mdRule 10.
Template Selection Decision Tree
What type of project?
├─ Simple automation (no queues/retries) → simple-sequence/
├─ Dispatcher (reads data, creates queue items) → reframework/ (--variant dispatcher)
└─ Performer (processes queue items) → reframework/ (--variant performer)
What type of workflow?
├─ Process cleanup (ForEach + TryCatch) → KillAllProcesses.xaml
├─ Simple sequence + annotation → CloseAllApplications.xaml
├─ Clean process placeholder → reframework/Framework/Process.xaml
├─ Sequence with In arguments → InitAllApplications.xaml
├─ App login (credentials + validation) → samples/common-workflows/Workflows/WebAppName/WebAppName_Launch.xaml
├─ Dispatcher orchestration → samples/common-workflows/HttpApiDispatcher_Main.xaml
├─ API credential + OAuth + fetch → samples/common-workflows/Workflows/Api/Api_FetchInvoices.xaml
├─ App/browser close (CloseMode=Always) → samples/common-workflows/Workflows/Utils/App_Close.xaml
├─ Browser navigate to URL → samples/common-workflows/Workflows/Utils/Browser_NavigateToUrl.xaml
├─ Performer Process.xaml (QueueItem → invoke sub-workflows) → samples/common-workflows/Workflows/Performer/Performer_Process.xaml
├─ Excel Dispatcher Process.xaml (DataRow → AddQueueItem) → samples/common-workflows/Workflows/Dispatcher/ExcelDispatcher_Process.xaml
├─ If/Else branching → GetTransactionData.xaml
├─ ForEachRow + TryCatch → InitAllSettings.xaml
├─ Retry/counter logic → RetryCurrentTransaction.xaml
├─ Multi-branch Flowchart → stripped/SetTransactionStatus.xaml
├─ UI automation (click, type, form fill) → stripped/FormFilling_Main.xaml + samples/common-workflows/Workflows/WebAppName/WebAppName_Launch.xaml
└─ StateMachine (REFramework) → stripped/REFramework_Main.xaml
Key Differences: Dispatcher vs Performer
Both use the same assets/reframework/ base template. scaffold_project.py --variant dispatcher applies type transformations automatically.
| Aspect | Dispatcher | Performer |
|---|---|---|
| scaffold variant | --variant dispatcher |
--variant performer |
| TransactionItem type | sd:DataRow (default, configurable) |
ui:QueueItem (standard) |
| Typical data source | DataTable (Excel, DB, API), email inbox, file list | Orchestrator Queue |
| Process.xaml purpose | Extract data → AddQueueItem | Process queue item → business logic |
| GetTransactionData.xaml | Returns next row/item from local data source | Returns next QueueItem from Orchestrator |
Transaction Item Types
The TransactionItem variable type is configurable for dispatchers — it depends on the data source. For performers, the standard type is ui:QueueItem:
| Type | XAML TypeArguments | xmlns required | When to use |
|---|---|---|---|
sd:DataRow |
x:TypeArguments="sd:DataRow" |
xmlns:sd="clr-namespace:System.Data;assembly=System.Data.Common" |
Processing rows from DataTable (Excel, DB, CSV) |
ui:QueueItem |
x:TypeArguments="ui:QueueItem" |
xmlns:ui="http://schemas.uipath.com/workflow/activities" (already included) |
Processing Orchestrator queue items |
x:String |
x:TypeArguments="x:String" |
(built-in, no extra xmlns) | Simple string values (file paths, URLs, IDs) |
scg3:MailMessage |
x:TypeArguments="scg3:MailMessage" |
xmlns:scg3="clr-namespace:System.Net.Mail;assembly=System.Net.Mail" |
Processing email messages |
When changing the type, update ALL occurrences: TransactionItem variable in Main.xaml, all OutArgument/InArgument referencing it, and the corresponding arguments in GetTransactionData.xaml, Process.xaml, and SetTransactionStatus.xaml.
Activities Not in Templates
The templates above cover structural patterns (sequences, branching, loops, TryCatch, StateMachine, UI automation). For activities that don't appear in any template, get the XAML from the relevant reference file:
| Activity | Reference file |
|---|---|
| InputDialog (text input + dropdown) | xaml-foundations.md |
| If, ForEach, Flowchart, State Machine | xaml-control-flow.md |
| BuildDataTable, FilterDataTable, DeserializeJSON | xaml-data.md |
| CopyFile, MoveFile, CreateDirectory, DeleteFile, PathExists | xaml-data.md |
| TryCatch, RetryScope, Throw/Rethrow | xaml-error-handling.md |
| Invoke Code (inline C#/VB.NET), Invoke Method | xaml-invoke.md |
| HTTP Request (OAuth, retry, query params) | xaml-orchestrator.md |
| GetRobotAsset, GetRobotCredential, AddQueueItem | xaml-orchestrator.md |
| CreateFormTask, WaitForFormTaskAndResume | uipath-tasks skill → references/tasks.md |
| Data Service (Entity, Query, Create, Update) | xaml-orchestrator.md |
| Excel ReadRange, WriteRange, WriteCell | xaml-integrations.md |
| Email (Integration Service), PDF ReadPDFText/ReadPDFWithOCR | xaml-integrations.md |
| NApplicationCard, NClick, NTypeInto, selectors | xaml-ui-automation.md |
Pattern: Use the closest template for the overall file structure (namespaces, ViewState, root element), then insert activity-specific XAML from the relevant reference file.
Modification Rules
- Change
x:Classand rootDisplayName - Update
sap2010:WorkflowViewState.IdRefon root element - Modify
x:Membersfor arguments - Modify
Sequence.Variablesfor variables - Replace business logic activities
- Every new activity gets
sap:VirtualizedContainerService.HintSize+ uniqueIdRef - Keep namespace/assembly sections from template UNCHANGED — especially
UiPath.UIAutomationNext.Enums(correct CLR namespace despite package rename). Seecheat-sheet.md→ Quick Rules. - Add xmlns declarations only if using activities from new packages
- Validate well-formed XML
Config.xlsx Structure
See config-sample.md for the full Config.xlsx reference (Settings/Constants/Assets sheets, key naming conventions, output format).
Config.xlsx has 3 sheets (Settings, Constants, Assets), all with Name | Value | Description columns. The scaffold script creates framework defaults. After generating workflows, always output required Config.xlsx keys — lint 39 extracts them automatically via validate_xaml --lint.
Open this reference as its own page
Lint Reference
Validation rules for scripts/validate_xaml --lint. Search by lint number to find the fix.
Lint checks (--lint) — 80 numbered lint rules (+ plugin lint rules), grouped by severity. When fixing a lint warning, find its number below for the fix reference.
🔴 Studio crash (file won't open or activity crashes Studio on load):
| Lint | What it catches | Fix reference |
|---|---|---|
| 17 | NExtractDataGeneric uses DataTable= attribute (doesn't exist) |
Use ExtractedData="[dt_variable]". The x:TypeArguments="sd2:DataTable" is the generic type param, NOT a property |
| 23 | Studio-emitted <ui:UnresolvedActivity> — hallucinated activity name |
Studio could not resolve the activity type. Check xaml-data.md / xaml-*.md for the correct activity element name |
| 28 | Invalid ElementType enum (DataGrid, ComboBox, InputBoxText) | Use Table, DropDown, InputBox. See xaml-ui-automation.md |
| 116 | Hallucinated property names on UI activities (.TargetAnchorable>, Url= on NApplicationCard, bare Selector= on TargetAnchorable, etc.) |
Use the correct property — see gen_* helpers and xaml-ui-automation.md. Rule 116 covers the previous "lint 23 hallucinated properties" cases |
| 57 | ReferencesForImplementation with x:String TypeArguments |
Use AssemblyReference type+elements |
| 73 | Hallucinated NExtractData types/properties | Use ExtractedData= (not DataTable= or Result=). See gen_nextractdata() |
| 76 | InvokeWorkflowFile argument type mismatch (BC30512 crash) | Match caller x:TypeArguments to target x:Property Type=. See skill-guide.md → UiElement arg rules |
| 87 | Wrong or missing xmlns prefix on DataTable/DataRow type reference | Use sd:DataTable, sd:DataRow — never bare DataTable/DataRow. Check which prefix maps to System.Data in the file's xmlns declarations. Auto-fixable via --fix. |
| 88 | Variable declaration errors in Sequence: (a) <Sequence.Variables> after children, (b) bare <Variable> without wrapper |
Variables MUST be inside <Sequence.Variables>, placed before any child activities |
🟡 Compile error / runtime failure / silent data loss:
| Lint | What it catches | Fix reference |
|---|---|---|
| 7 | Throw uses fully-qualified BRE/SysEx instead of short form | Use New BusinessRuleException("msg") not New UiPath.Core.Activities.BusinessRuleException(...) |
| 20 | AddQueueItem.ItemInformation uses <x:String> child elements |
Use <InArgument> child elements with proper key-value pairs |
| 30 | NSelectItem has InteractionMode (doesn't exist on NSelectItem) |
Only NClick and NTypeInto support InteractionMode. Remove it |
| 31 | ContinueOnError on X-suffix activities (doesn't exist) | X-activities don't have ContinueOnError. Wrap in TryCatch instead |
| 32 | Environment.SpecialFolder.Temp (not a valid enum) |
Use Path.GetTempPath() instead |
| 33 | NApplicationCard invalid enum value (AttachMode/OpenMode/CloseMode/InteractionMode/WindowResize/Version) | Use a valid enum from lint_napplicationcard_enums |
| 34 | Credentials passed as InvokeWorkflowFile arguments | Retrieve via GetRobotCredential inside the workflow that needs them |
| 35 | NTypeInto for password uses Text= instead of SecureText= |
Use SecureText="[secstrPassword]" and store password as SecureString |
| 117 | InvokeCode contains SqlConnection/SqlCommand | Use DatabaseConnect + ExecuteQuery activities instead |
| 118 | InvokeCode captures screenshot via System.Drawing | Use TakeScreenshot + SaveImage activities instead |
| 119 | InvokeCode uses File.Delete | Use <ui:DeleteFileX Path="[strPath]" /> instead |
| 40 | Wrong enum namespace (UIAutomation.Enums instead of UIAutomationNext.Enums) |
UIAutomationNext.Enums is the correct CLR namespace |
| 50 | InvokeWorkflowFile passes argument key not declared in target's x:Members | Check for typos — Studio error: 'Property matching [key] not found' |
| 51 | GetQueueItem in dispatcher's GetTransactionData (type mismatch) |
Replace with DataTable row indexing. Scaffold --variant dispatcher handles this |
| 53 | InteractionMode on activities that don't support it (NGetText, NCheckState, etc.) |
Only NClick and NTypeInto have InteractionMode |
| 54 | QueueName= instead of QueueType= on AddQueueItem/GetQueueItem |
Property is QueueType |
| 55 | Out/InOut arguments with empty bindings ([] or self-closing) → silent data loss |
Must have [variable] binding |
| 56 | Argument direction tag doesn't match key prefix (io_ ≠ OutArgument) → silent data loss |
io_ → InOutArgument, out_ → OutArgument, in_ → InArgument |
| 60 | InvokeWorkflowFile missing required io_/out_ arguments from target | Target declares these but caller doesn't pass them — output silently lost |
| 67 | Variables used in expressions but never declared | Add <Variable> or <x:Property> declaration |
| 70 | Invalid EmptyFieldMode enum on NTypeInto (Clear, Empty, Reset, …) |
Only None, SingleLine, MultiLine are valid. Auto-fixable via --fix (maps common hallucinations to SingleLine). |
| 71 | Double-escaped quotes &quot; in VB.NET expressions |
Use "" not &quot; inside [brackets]. Auto-fixable via --fix. |
| 81 | Undeclared variable bound in InvokeWorkflowFile Out/InOut argument in Main.xaml | Declare the variable in Main.xaml's Variables panel |
| 83 | Double-bracketed expression [[...]] |
UiPath uses single brackets [expr]. Auto-fixable via --fix. |
| 89 | Selector inner attributes use double quotes (tag="H1") |
UiPath selectors require single-quoted values (tag='H1'). Auto-fixable via --fix. |
| 90 | Selector contents double-XML-escaped (&lt; instead of <) |
Selector engine sees literal < and never matches a real element. Auto-fixable via --fix. |
| 93 | Invalid x:Type[] array reference (e.g. x:String[]) |
The x xmlns is the XAML namespace, not System. Use the s: prefix (s:String[], s:Int32[], …). Auto-fixable via --fix. |
| 99 | Fully-qualified CLR type name inside x:TypeArguments (e.g. System.Exception) |
XAML cannot resolve dotted FQ names in type-arg contexts. Use the xmlns-prefixed shortname (s:Exception, x:String, sd:DataTable, …). Auto-fixable via --fix. |
🟢 Best practice / architecture / security:
| Lint | What it catches | Fix reference |
|---|---|---|
| 26 | Persistence activities in sub-workflows (uipath-tasks plugin) | Move to Main.xaml — persistence bookmarks only work in entry-point |
| 27 | InvokeCode creates DataTable AND adds columns | Use Variable Default + AddDataColumn activities instead. Reserve InvokeCode for LINQ/GroupBy |
| 36 | API/network activities without RetryScope | Wrap in RetryScope (Rule 13). Exception: NetHttpRequest has built-in retry |
| 37 | Hardcoded URLs in NGoToUrl/NApplicationCard/NetHttpRequest | URLs from Config.xlsx (Rule 3) |
| 38 | Browser NApplicationCard missing IsIncognito="True" |
Always set IsIncognito="True" (Rule 10) |
| 39 | Config.xlsx key extraction summary | Informational — lists all Config keys referenced |
| 41 | FuzzySelector as default search step | Default to SearchSteps="Selector" (strict) |
| 45 | App-specific navigation workflow exists | Delete it. Use generic Browser_NavigateToUrl.xaml from Utils/ (Rule 3) |
| 46 | Generic uiBrowser/io_uiBrowser in orchestrator file |
Use app-specific names: uiWebApp, io_uiWebApp (Rule 11) |
| 47 | NApplicationCard with OpenMode ≠ Never in action workflow |
Apps open in Launch only. Actions use OpenMode="Never" + attach (Rule 4) |
| 49 | Browser NApplicationCard with CloseMode set |
Use CloseMode="Never" except in App_Close workflows |
| 58 | Modern UI activities outside NApplicationCard scope | Wrap in NApplicationCard |
| 59 | NApplicationCard attach-mode without InUiElement reference |
Provide InUiElement="[uiApp]" for attach |
| 61 | Config.xlsx cross-reference (XAML keys vs actual sheets) | Add missing keys to Config.xlsx |
| 62 | Missing log bookends (START/END LogMessage) | Add LogMessage "[START/END] WorkflowName" (Rule 7) |
| 63 | InitAllApplications / CloseAllApplications asymmetry | Every app opened in Init must be closed in CloseAll |
| 64 | Login workflow missing Pick/PickBranch validation | Add Pick with success + failure branches. See gen_pick_login_validation() |
| 65 | CloseAllApplications contains KillProcess | Remove — KillProcess belongs in KillAllProcesses only |
| 66 | Launch workflow missing OutUiElement on NApplicationCard |
Add OutUiElement="[out_uiAppName]" to capture opened instance |
| 68 | App_Close invoked from Process.xaml or action workflows | Move to CloseAllApplications only. Apps stay open across transactions |
| 69 | Launch workflow has login but no Pick validation | Add Pick with NCheckAppState success/failure branches after login click |
| 72 | Separate AppName_Login.xaml file |
Merge login into AppName_Launch.xaml |
| 74 | InitAllApplications contains non-launch activities (navigation/extraction) | Move to GetTransactionData. Init = Launch + Login only |
| 75 | Redundant Process wrapper (Performer_Process.xaml delegating from Process.xaml) | Put business logic directly in Process.xaml |
| 77 | InitAllApplications missing UiElement OutArgument for launched apps | Add out_uiXxx OutArgument for each app. Wire through Main → Process → actions |
| 78 | UiElement stored in Config dictionary instead of typed argument chain | Use typed OutArgument/InOutArgument flow: Launch → InitAllApps → Main → Process → actions |
| 79 | Duplicate Arguments on InvokeWorkflowFile (XamlDuplicateMemberException) | Remove inline Arguments="..." attribute — use ONLY <ui:InvokeWorkflowFile.Arguments> child element |
| 80 | NSelectItem with Item={x:Null} — required field |
Use variable Item="[strStatus]" or literal Item="["Completed"]" |
| 82 | Bare Config(...) reference outside Main.xaml |
Outside Main.xaml, use in_Config("Key").ToString |
| 94 | UI automation project missing/empty Object Repository | Write selectors.json during Playwright inspection, then run python3 generate_object_repository.py --from-selectors selectors.json --project-dir <project> |
| 95 | Wrong xmlns URL (e.g. activities/next instead of activities/uix) |
Use generate_workflow.py — correct URLs built-in. Never hand-write namespace declarations |
| 97 | css-selector= attribute in selector (fragile) |
css-selector is valid but CSS selectors break when page structure changes. Prefer id=, aaname=, or parentid= for reliable matching |
| 100 | in_TransactionNumber referenced in Process.xaml or action workflows |
This argument lives in Main.xaml scope only, forwarded to GetTransactionData/SetTransactionStatus. Use in_TransactionItem fields instead (e.g., in_TransactionItem("WIID").ToString for DataRow, in_TransactionItem.SpecificContent("Key").ToString for QueueItem) |
| 101 | Circular dependency between workflows | Remove cycle — A invokes B invokes A is never valid |
| 102 | Orphaned workflow not reachable from entry point | Remove unused file or add InvokeWorkflowFile call from a reachable workflow |
| 103 | UI-heavy workflow (>5 interactions) without TryCatch | Wrap UI block in TryCatch for graceful error handling. See desktop-form-filling.md |
| 104 | Hardcoded user-specific path (C:\Users\...) in FilePath |
Use variable from Config or InArgument: FilePath="[in_Config(\"AppPath\").ToString]" |
| 105 | Tab NClick immediately followed by NTypeInto without sync | Add 500ms Delay or NCheckAppState after tab click. See desktop-form-filling.md |
| 106 | Desktop NApplicationCard uses InteractionMode="DebuggerApi" (browser-only) |
Use Simulate or HardwareEvents for desktop apps |
| 107 | Desktop NApplicationCard uses IsIncognito="True" (browser concept) |
Remove IsIncognito from desktop NApplicationCards |
| 108 | TryCatch has empty Catch block — exceptions silently swallowed | Add error logging, cleanup, or Rethrow |
| 115 | Desktop NApplicationCard missing FilePath on TargetApp |
Set FilePath (attribute or <uix:TargetApp.FilePath> child) when OpenMode is IfNotOpen or Always |
| 120 | UiX activity uses Version="V5" (or higher) when target band is below 25 |
Drop the Version attribute to let Studio default it for the target band, or scaffold the project against a band ≥ 25. Fires only when project.json carries an explicit versionBand. |
| 121 | UiX activity uses HealingAgentBehavior or ClipboardMode when target band is below 25 |
Both attributes were introduced in 25.10+. Remove them or upgrade the target band. Fires only when project.json carries an explicit versionBand. |
| 122 | Cross-band Version attribute mismatch — activity Version does not match the target band's profile |
Use the version recorded for the (package, band) pair in references/version-profiles/<package>/<band>.json (e.g. V2 for NApplicationCard on band 25). Plugins can register additional band profiles via register_band_profile_mapping. |
Open this reference as its own page
Playwright MCP → UiPath Selector Generation
⛔⛔⛔ PLAYWRIGHT IS READ-ONLY — YOU ARE AN OBSERVER, NOT A USER ⛔⛔⛔
When you hit a login page:
- Snapshot it for selectors (username field, password field, login button)
- Output the PHASE 2 LOGIN GATE message from SKILL.md — ask user to simulate failed login, then log in correctly
- STOP. WAIT for user response. Do NOT proceed.
You must NEVER:
- Type into ANY form field (not credentials, not test data, not placeholders, nothing)
- Click Login, Submit, Sign In, or any state-changing button
- Fill in forms of any kind
- Guess what's behind a login page
Your only permitted actions: navigate to URLs, take snapshots, read the DOM/accessibility tree, click navigation links/menus to discover pages.
This is the #1 recurring bug across all testing. If you are about to type something into a field — STOP AND RE-READ THIS WARNING.
When building UI automation workflows, use Playwright MCP to inspect live web pages and generate accurate UiPath selectors. This eliminates guesswork and produces selectors that actually work.
Contents
- Workflow
- UiPath Selector Structure (Selector Node Format)
- HTML Node Attributes (App/Browser Scope)
- WEBCTRL Attributes (Element Target) — Complete Reference (Attribute Priority)
- ElementType Mapping
- Building UiPath Selectors from Playwright Data (Steps 1–5)
- Full vs Partial Selectors
- Wildcards in Selectors
- Dynamic Selectors (Studio, XAML string.Format, XAML concatenation)
- Complete Example: Playwright Inspection → XAML
- Tips and Best Practices
Workflow
- Check available tools — look for Playwright MCP tools in your tool list (e.g.
playwright_navigate,browser_navigate,playwright_snapshot,browser_snapshot,playwright_evaluate). If none found, fall back to PDD screenshots but note selectors are estimated. - Navigate to the target page using Playwright MCP
- Inspect elements — use Playwright's accessibility tree, snapshot, or evaluate to extract element attributes (tag, id, name, aria-label, type, class, role, placeholder, page title)
- Map to UiPath selectors — convert HTML attributes to UiPath
<webctrl>format using the rules below - Build XAML — insert selectors into NClick, NTypeInto, NSelectItem, etc. from templates in
xaml-ui-automation.md
UiPath Selector Structure
UiPath selectors are hierarchical XML fragments. For web automation, they use two node types:
<html app='browser.exe' title='Page Title' /> ← HTML node (app-level scope)
<webctrl tag='BUTTON' aaname='Submit' /> ← WEBCTRL node (element target)
The HTML node identifies the browser window. The WEBCTRL node identifies the specific element within the page. In modern activities (NClick, NTypeInto, etc.), these map to:
ScopeSelectorArgument→ the HTML nodeFullSelectorArgument→ the WEBCTRL nodeFuzzySelectorArgument→ the WEBCTRL node with extra attributes for resilience
Selector Node Format
Each node follows: <tag_type attr1='value1' attr2='value2' />
Attributes support three search capabilities:
- Fuzzy — approximate matching (tolerates minor differences)
- RegEx — regular expression patterns in attribute values
- Case-Sensitive — exact case matching
HTML Node Attributes (App/Browser Scope)
| Attribute | Description | Fuzzy | RegEx |
|---|---|---|---|
app |
Browser executable: msedge.exe, chrome.exe, firefox.exe |
❌ | ❌ |
title |
Page/window title. Supports wildcards: title='*Dashboard*' |
✅ | ✅ |
url |
Page URL. Useful when title is dynamic | ✅ | ✅ |
class |
Window class | ✅ | ✅ |
idx |
Window index (when multiple windows of same app) | ❌ | ❌ |
WEBCTRL Attributes (Element Target) — Complete Reference
These are all officially supported WEBCTRL attributes from UiPath documentation. All support Fuzzy, RegEx, and Case-Sensitive search.
| Attribute | Playwright Source | Priority | Notes |
|---|---|---|---|
tag |
element.tagName |
⬆ Always include | UPPERCASE: BUTTON, INPUT, SELECT, SPAN, DIV, A, TABLE, TR, TD, H1–H6 |
aaname |
aria-label, innerText, alt, title |
⬆ Primary identifier | Accessible name. Most reliable for web. Maps to visible text or aria-label |
id |
element.id |
⬆ When stable | Skip if auto-generated (React/Angular IDs like react-select-3) |
name |
element.name |
⬆ For forms | HTML name attribute on form elements |
class |
element.className |
⬇ Fuzzy only | Full class string. Brittle — changes with CSS frameworks |
innertext |
element.innerText |
⬇ Backup | Full inner text content. Use for text-heavy elements |
visibleinnertext |
visible text only | ⬇ Backup | Only the visible portion of inner text |
css-selector |
CSS selector | ⬇ Special | Direct CSS selector. Does NOT support Fuzzy/RegEx/Case-Sensitive. Note: UiPath internally stores this as cssSelector (camelCase). Lint 97 flags css-selector=. Prefer id, aaname, or parentid instead. |
parentid |
parent element.id |
Medium | Parent element's ID — helps disambiguate |
parentclass |
parent element.className |
⬇ Fuzzy only | Parent element's class |
parentname |
parent element.name |
Medium | Parent element's name |
src |
element.src |
Medium | For images, iframes |
href |
element.href |
Medium | For anchor links |
idx |
sibling position | Medium | 1-based index among matching siblings. Supports Fuzzy/RegEx |
isleaf |
DOM structure | ⬇ Rare | Whether element is a leaf node |
tableRow |
row position | ⬆ For tables | Row index in table |
tableCol |
column position | ⬆ For tables | Column index in table |
rowName |
row header text | ⬆ For tables | Row identifier text |
colName |
column header text | ⬆ For tables | Column header text |
aria-label |
aria-label attr |
⬆ Accessible | Direct aria-label value |
aria-labelledby |
aria-labelledby attr |
Medium | References another element's ID for labeling |
placeholder |
placeholder attr |
⬇ Fuzzy only | Input placeholder text |
type |
input.type |
Medium | Input type: text, password, submit, checkbox, email |
Attribute Priority for Selector Building
aaname+tag— best combo (readable, stable)id+tag— when id is stable and meaningfulname+tag— for form elementscss-selector— when nothing else works (no Fuzzy/RegEx support)tag+class+idx— last resort (brittle)
ElementType Mapping
Valid UIElementType enum values (Studio crashes on anything else):
Button, CheckBox, ComboBox, Document, DropDown, Group, Image, InputBox, InputBoxPassword, Link, List, ListItem, Menu, MenuItem, None, ProgressBar, RadioButton, Slider, Tab, Table, Text, ToolBar, ToolTip, Tree, TreeItem, Window
⚠️ Common hallucination: DataGrid is NOT valid — use Table for grids/tables.
| HTML / Desktop Element | UiPath ElementType |
|---|---|
<button>, <input type="submit">, <a> (styled as button) |
Button |
<input type="text">, <input type="email">, <textarea> |
InputBox |
<input type="password"> |
InputBoxPassword |
<select> |
DropDown |
<span>, <div>, <p>, <h1>–<h6>, <label> |
Text |
<a> (navigation link) |
Link |
<input type="checkbox">, <input type="radio"> |
CheckBox |
<table>, DataGrid controls, role='table'/role='grid' |
Table |
| Dialog, modal, window frame | Window |
Building UiPath Selectors from Playwright Data
Step 1: Get Element Info via Playwright
Use Playwright MCP to inspect the target element. Gather: tag name, text content, id, aria-label, name, type, class, and the page title.
Step 2: Build the Scope Selector (HTML node)
<html app='msedge.exe' title='Page Title' />
app='msedge.exe'for Edge,app='chrome.exe'for Chrometitle='*keyword*'with wildcards if title changes dynamically- Can also use
url='https://example.com/*'for URL-based matching
Step 3: Build the Full Selector (strict WEBCTRL)
Minimum attributes to uniquely identify the element:
<webctrl aaname='Submit' tag='BUTTON' />
<webctrl tag='INPUT' aaname='Email address' />
<webctrl tag='SELECT' aaname='Country' />
<webctrl tag='INPUT' id='username' />
<webctrl tag='A' href='/dashboard' />
For table cells:
<webctrl tag='TD' tableRow='3' tableCol='2' />
<webctrl tag='TD' rowName='Invoice #1234' colName='Amount' />
Step 4: Build the Fuzzy Selector (relaxed WEBCTRL, optional)
Add extra attributes for resilience. UiPath tries FullSelector first, falls back to Fuzzy:
<webctrl aaname='Submit' tag='BUTTON' type='submit' class='btn btn-primary' check:innerText='Submit' />
<webctrl tag='INPUT' aaname='Email' type='email' class='form-control' placeholder='Enter email' />
The check:innerText attribute is UiPath-specific validation — verifies element text matches after finding it.
Step 5: XML-Escape for XAML
Selectors go inside XML attributes, so escape them:
<→<>→>'inside selector values → stays as'(UiPath uses single quotes inside selectors)"→"(only if selector is inside a"..."XML attribute)
Result in XAML:
FullSelectorArgument="<webctrl aaname='Submit' tag='BUTTON' />"
ScopeSelectorArgument="<html app='msedge.exe' title='Example Corp' />"
Full vs Partial Selectors
UiPath Modern activities (NClick, NTypeInto, etc.) separate the target definition into three parts:
| Selector | Type | XAML Property | Purpose |
|---|---|---|---|
| Window selector | Full | ScopeSelectorArgument |
Identifies the application window (top-level). Contains <html> or <wnd> node |
| Strict selector | Partial | FullSelectorArgument |
Identifies the specific element within the window. Precise match |
| Fuzzy selector | Partial | FuzzySelectorArgument |
Fallback element selector using fuzzy matching algorithm |
The complete target is determined by merging the Window selector with the Strict or Fuzzy selector. Partial selectors do NOT contain any information about the top-level window — that's handled by the container (Use Application/Browser / NApplicationCard).
Full selector (everything in one string — used in Classic activities or standalone):
<html app='msedge.exe' title='Example Corp' /><webctrl aaname='Submit' tag='BUTTON' />
Partial selectors (split across container + activity — used in Modern activities):
Container (NApplicationCard): <html app='msedge.exe' title='Example Corp' />
Activity (NClick) strict: <webctrl aaname='Submit' tag='BUTTON' />
Activity (NClick) fuzzy: <webctrl aaname='Submit' tag='BUTTON' type='submit' class='btn' />
When generating XAML, always use partial selectors with the NApplicationCard container pattern. This is faster (doesn't re-find the window for every activity) and makes selector maintenance easier.
Wildcards in Selectors
Wildcards handle dynamically-changing attribute values without needing variables or expressions. Three patterns are supported:
| Wildcard | Meaning | Example |
|---|---|---|
* |
Zero or more characters | title='* - Notepad' matches "Untitled - Notepad", "file.txt - Notepad" |
? |
Exactly one character | aaname='Item ?' matches "Item A", "Item 1", NOT "Item 10" |
*? |
One or more characters (at least one) | id='btn-*?' matches "btn-submit", "btn-1", NOT "btn-" |
Common wildcard patterns:
title='*Dashboard*' ← page title contains "Dashboard" anywhere
aaname='Invoice #*' ← text starts with "Invoice #"
url='https://example-app.com/*/edit' ← any resource's edit page
id='field-*' ← any id starting with "field-"
In XAML:
ScopeSelectorArgument="<html app='msedge.exe' title='*Dashboard*' />"
FullSelectorArgument="<webctrl aaname='Invoice #*' tag='SPAN' />"
Rule of thumb: If an attribute's value is ALL wildcard (e.g. name='*'), remove that attribute entirely — it adds no filtering value.
Dynamic Selectors
Dynamic selectors use variables or arguments to parameterize attribute values. This allows the same selector to target different elements at runtime.
In UiPath Studio (Selector Editor)
Studio uses the {{VariableName}} syntax inside the Selector Editor. The format is:
<tag attribute='{{VariableName}}' />
Example — clicking different menu items with one Click activity:
Static: <ctrl name='File' role='menu item' />
Dynamic: <ctrl name='{{MenuOption}}' role='menu item' />
The variable MenuOption holds the target value ("File", "Format", "Edit", etc.). Both variables and arguments are supported.
In XAML (string.Format expressions)
When building selectors in XAML code, use VB.NET string.Format:
FullSelectorArgument="[string.Format("<webctrl aaname='{0}' tag='BUTTON' />", strButtonName)]"
Index-based iteration (looping through table rows):
FullSelectorArgument="[string.Format("<webctrl tag='TR' tableRow='{0}' />", intRowIndex.ToString)]"
Multiple dynamic values:
FullSelectorArgument="[string.Format("<webctrl tag='TD' tableRow='{0}' colName='{1}' />", intRow.ToString, strColumnName)]"
In XAML (string concatenation — Classic style)
For Classic activities that use the Selector property (a single string with the full selector), use VB.NET string concatenation with escaped double quotes:
"<html app='msedge.exe' title='*' /><webctrl aaname='" + strFieldLabel + "' tag='LABEL' />"
Note the double-quote escaping: in VB.NET, "" inside a string produces a literal ".
When to use each approach
| Approach | When | Example |
|---|---|---|
Wildcards (*, ?) |
Pattern is predictable, no runtime variable needed | aaname='Invoice #*' |
{{Variable}} |
Studio Selector Editor, runtime variable drives the target | name='{{MenuOption}}' |
string.Format |
XAML expressions in Modern activities | [string.Format("...", var)] |
| String concatenation | Classic activities Selector property | "<webctrl aaname='" + var + "' />" |
Complete Example: Playwright Inspection → XAML
Playwright finds a login form with:
- Page title: "Example Corp - Login"
- Page URL: "https://example-app.com/login"
- Username input:
<input type="text" id="user" aria-label="Username" placeholder="Enter username" class="form-input"> - Password input:
<input type="password" id="pass" aria-label="Password" class="form-input"> - Submit button:
<button type="submit" class="btn-login">Sign In</button>
Generated scope (ScopeSelectorArgument):
ScopeSelectorArgument="<html app='msedge.exe' title='Example Corp - Login' />"
Username — NTypeInto:
FullSelectorArgument="<webctrl tag='INPUT' aaname='Username' />"
FuzzySelectorArgument="<webctrl tag='INPUT' aaname='Username' type='text' id='user' class='form-input' placeholder='Enter username' />"
ElementType="InputBox"
Password — NTypeInto:
FullSelectorArgument="<webctrl tag='INPUT' aaname='Password' />"
FuzzySelectorArgument="<webctrl tag='INPUT' aaname='Password' type='password' id='pass' class='form-input' />"
ElementType="InputBox"
Submit — NClick:
FullSelectorArgument="<webctrl aaname='Sign In' tag='BUTTON' />"
FuzzySelectorArgument="<webctrl aaname='Sign In' tag='BUTTON' type='submit' class='btn-login' check:innerText='Sign In' />"
ElementType="Button"
Tips and Best Practices
- Prefer
aanameoverid— aaname maps to visible text/aria-label and is more readable in Studio - Skip auto-generated attributes — React/Angular IDs like
input-3a7f, dynamic classes likecss-1dbjc4nare unstable - Use wildcards for dynamic content —
aaname='Item *'matches "Item 1", "Item 2", etc. Works intitletoo:title='*Dashboard*' - Remove all-wildcard attributes — if
name='*', just remove thenameattribute entirely - Avoid
idxwhen possible —idxdepends on load order and sibling count, making selectors brittle. Only use when value is very small (1 or 2) and stable - Avoid
classin strict selectors — CSS classes change frequently with framework updates. Use only in FuzzySelector as extra resilience - Test multiple pages — if the site is a SPA, check selectors after navigation, not just initial load
- Table data — use
tableRow/tableColfor position-based targeting,rowName/colNamefor header-based (more stable) - Fuzzy search — when enabled, UiPath tolerates minor differences in attribute values (typos, whitespace)
- RegEx in selectors — add
matching:attr='regex'to the tag to enable RegEx for specific attributes. Example:<uia matching:name='regex' name='Display is \d' /> css-selector— use as escape hatch when standard attributes can't target the element, but note it doesn't support Fuzzy/RegEx/Case-Sensitive- Use containers (NApplicationCard) — always use partial selectors inside a container instead of full selectors. This is faster (avoids re-finding the window per activity) and easier to maintain
- Pick constant attributes — always choose attributes with values that stay the same across runs. If a value changes each time the app starts, that selector will fail
Open this reference as its own page
Activity routing index
Auto-generated from references/annotations/*.json by
uipath-core/scripts/generate_routing_index.py. Do not hand-edit — edit
the annotation entries instead, then regenerate.
464 activities indexed (supported: 446, wizard-only / unsupported: 18, routing wording review pending: 0).
UI automation (69)
| Activity | Generator | Description | Use when |
|---|---|---|---|
Activate |
gen_activate |
Bring an existing UI element's window to the foreground. | User wants to focus a window before interacting with it (classic activity). In modern projects prefer NApplicationCardAttach. |
CvExtractDataTableWithDescriptor |
gen_cv_extract_data_table_with_descriptor |
Extract a tabular region from a Computer Vision capture using a saved descriptor. | User has a CV-anchored table descriptor and wants to scrape its rows. Must be inside CVScope. |
CvGetTextWithDescriptor |
gen_cv_get_text_with_descriptor |
Read text from a Computer Vision target using a saved descriptor. | User wants to capture text from a CV-anchored region. Must be inside CVScope; for selector-based reads use NGetText. |
CvHighlightWithDescriptor |
gen_cv_highlight_with_descriptor |
Briefly highlight a Computer Vision target using a saved descriptor (debug aid). | User wants to visually verify a CV anchor during development. Must be inside CVScope. |
CvHoverWithDescriptor |
gen_cv_hover_with_descriptor |
Hover over a Computer Vision target using a saved descriptor. | User wants hover-only behaviour on a CV-anchored element. Must be inside CVScope. |
CVScope |
gen_cv_scope |
Computer Vision scope that captures the screen once and serves child Cv* activities from the cached model. | User wants Computer Vision-based UI automation (OCR + CV anchors). All Cv* activities must run inside this scope. |
CvTypeIntoWithDescriptor |
gen_cv_type_into_with_descriptor |
Type text into a Computer Vision target using a saved descriptor. | User wants to type into a CV-anchored field. Must be inside CVScope; for selector-based input use NTypeInto. |
FindChildren |
gen_find_children |
Return all child UI elements of a parent that match a selector filter. | User wants to enumerate the children of a known container in classic UIA. In modern UIA prefer NFindElements / NForEachUiElement. |
GetActiveWindow |
gen_get_active_window |
Return the UI element representing the currently focused foreground window. | User wants a handle to whatever window the user is currently looking at (classic activity). |
GetOCRText |
gen_get_ocr_text |
Run OCR against a UI element or image region and return the recognised text. | User wants OCR text from a region without the modern engine wrappers. For modern OCR pick GoogleCloudOCR / GoogleOCR / MicrosoftAzureComputerVisionOCR. |
GoogleCloudOCR |
GoogleCloudOCR (data-driven) |
OCR engine that calls Google Cloud Vision against the captured image region. | User wants OCR via Google Cloud and has an API key. For on-device OCR use GoogleOCR (Tesseract); for Azure use MicrosoftAzureComputerVisionOCR. |
GoogleOCR |
GoogleOCR (data-driven) |
Tesseract-based on-device OCR engine (no cloud call). | User wants free, offline OCR. For higher accuracy on noisy images consider GoogleCloudOCR or MicrosoftAzureComputerVisionOCR. |
HideWindow |
gen_hide_window |
Hide a UI element's window without closing it. | User wants to push a window off-screen but keep it running. To close use NWindowOperation with Close. |
LoadImage |
gen_load_image |
Load an image file from disk into a UiPath.Core.Image variable for later CV/OCR use. | User wants to feed a saved screenshot into Computer Vision or OCR activities. To save instead use SaveImage. |
MicrosoftAzureComputerVisionOCR |
MicrosoftAzureComputerVisionOCR (data-driven) |
OCR engine that calls Microsoft Azure Computer Vision against the captured image region. | User wants OCR via Azure Cognitive Services. For Google use GoogleCloudOCR; for offline use GoogleOCR. |
NApplicationCard |
NApplicationCard (data-driven) |
Modern Use Application/Browser scope - opens or attaches to a target application or browser and runs nested activities against it. | User wants the modern Use Application/Browser container that nests all child UI activities under one target. For just opening without nesting use NApplicationCardOpen; for attaching use NApplicationCardAttach. |
NBlockUserInput |
NBlockUserInput (data-driven) |
Block the user's mouse and keyboard input until a matching NUnblockUserInput runs. | User wants to prevent accidental human input during an automation. Always pair with NUnblockUserInput in a Try/Finally. |
NBrowserDialogScope |
NBrowserDialogScope (data-driven) |
Pre-arm handling of a browser dialog (alert/confirm/prompt/beforeunload) that will appear inside the scope. | User wants to auto-accept/dismiss a JS dialog raised by activities inside the scope. For file pickers use NBrowserFilePickerScope. |
NBrowserFilePickerScope |
NBrowserFilePickerScope (data-driven) |
Pre-arm a browser file-picker dialog so a triggered file chooser is fed a known file path. | User clicks a button inside the scope that opens a file-upload dialog. For JS alert/confirm dialogs use NBrowserDialogScope. |
NCheck |
gen_ncheck |
Set a checkbox or radio button to a Check, Uncheck, or Toggle state. | User wants to set a checkbox/radio to a known state. For arbitrary clicks use NClick; for verifying current state without changing it use NCheckState. |
NCheckElement |
NCheckElement (data-driven) |
Assert a property of a UI element (visible/enabled/text equals/contains) and return a Boolean result. | User wants to verify an element's property as a Boolean (e.g. for conditions or assertions). To set a checkbox use NCheck; to test presence only use NCheckState. |
NCheckState |
gen_ncheckstate |
Inspect whether a UI element appears, disappears, or matches a state, returning the result without modifying the UI. | User wants to test the presence/state of an element as a Boolean. For deciding which branch runs use this together with If; to actively check a checkbox use NCheck. |
NClick |
gen_nclick |
Click a UI element with configurable click type (Single/Double) and mouse button (Left/Right/Middle). | User wants a single left click on a button or element. For double-clicks prefer NDoubleClick; for right-clicks prefer NRightClick; for hold-and-drag use NDragAndDrop. |
NClickTrigger |
NClickTrigger (data-driven) |
Trigger that fires when a configured UI element is clicked. | User wants an event-driven workflow that reacts to a click on a target UI element. For keyboard-event triggers use NKeyboardTrigger. |
NClosePopup |
NClosePopup (data-driven) |
Close a transient popup window or notification by clicking its dismiss control. | User has a recurring popup blocking automation and wants it auto-dismissed. For ordinary windows use NWindowOperation. |
NDoubleClick |
gen_ndoubleclick |
Double-click a UI element with the chosen mouse button. | User explicitly wants a double click. For single click use NClick; for right click use NRightClick. |
NDragAndDrop |
NDragAndDrop (data-driven) |
Drag a UI element from a source location to a target location with the mouse held down. | User wants drag-and-drop semantics (reordering, moving items). For ordinary clicks use NClick. |
NElementScope |
NElementScope (data-driven) |
Scope that pins a UI element as the parent target for nested activities, avoiding repeated selectors. | User runs several activities against the same element and wants to share its selector once. For application-level scoping use NApplicationCard. |
NFillForm |
NFillForm (data-driven) |
Fill multiple form fields in a single call using an AI-powered field mapping. | User wants to populate several inputs at once given a dictionary of field-name to value. For one field at a time use NTypeInto. |
NFindElements |
NFindElements (data-driven) |
Find all UI elements that match a selector and return them as a collection. | User wants to enumerate all matching elements (e.g. all rows or links). For a single element rely on the implicit find of NClick/NGetText; to iterate use NForEachUiElement. |
NForEachUiElement |
NForEachUiElement (data-driven) |
Iterate over each UI element matching a selector and run a body sequence against it. | User wants to act on every element that matches (each row, each link). For non-UI collections use ForEach; to merely collect them use NFindElements. |
NGetBrowserData |
NGetBrowserData (data-driven) |
Read structured data (tables, lists, attributes) from a browser DOM into a typed output. | User wants to scrape structured data out of a web page in modern UI Automation. For visible plain text use NGetText. |
NGetClipboard |
NGetClipboard (data-driven) |
Read the current contents of the system clipboard into a string variable. | User wants to capture what was just copied. To set the clipboard use NSetClipboard. |
NGetText |
gen_ngettext |
Read the visible text of a UI element into an output variable. | User wants to capture the text shown on screen for an element. For OCR-only surfaces use GetOCRText; for clipboard use NGetClipboard; for browser DOM data use NGetBrowserData. |
NHighlight |
NHighlight (data-driven) |
Briefly draw a coloured outline around a UI element for debugging or demos. | User wants to visually highlight an element (debugging, screen recordings). Has no functional effect on the target. |
NHover |
gen_nhover |
Hover the mouse over a UI element to trigger hover-only behaviours (tooltips, menus). | User wants to surface hover-triggered UI (tooltips, fly-out menus) without clicking. For clicking use NClick. |
NInjectJsScript |
NInjectJsScript (data-driven) |
Execute a JavaScript snippet in the context of the active browser tab. | User wants to run custom JS against the page (set values, read DOM, fire events) when a UI activity is insufficient. For ordinary form fills use NTypeInto / NFillForm. |
NKeyboardShortcuts |
gen_nkeyboardshortcuts |
Send a keyboard shortcut chord (modifier keys + key) to a UI element. | User wants to invoke a keyboard shortcut (Ctrl+S, Alt+F4, etc.) on the target element. For typing literal text use NTypeInto. |
NKeyboardTrigger |
NKeyboardTrigger (data-driven) |
Trigger that fires when a configured keyboard shortcut is pressed. | User wants an event-driven workflow that reacts to a hotkey. For mouse-click triggers use NClickTrigger. |
NMouseScroll |
gen_nmousescroll |
Scroll the mouse wheel on a UI element by a number of clicks in a given direction. | User wants to scroll a page or panel via mouse wheel. For keyboard-driven scrolling use NKeyboardShortcuts (PageDown / End). |
NNavigateBrowser |
NNavigateBrowser (data-driven) |
Navigate the active browser to a URL or perform Back/Forward/Refresh/Home/Close commands. | User wants the current browser to change page or perform a navigation command. To open a brand-new browser use NApplicationCardOpen with a URL. |
NRightClick |
gen_nrightclick |
Right-click a UI element to invoke its context menu. | User wants to open a context menu. For ordinary clicks use NClick; for double-clicks use NDoubleClick. |
NSAPCallTransaction |
NSAPCallTransaction (data-driven) |
Invoke an SAP transaction code in the active SAP GUI session. | User wants to jump SAP to a transaction (e.g. /nVA01). Pair with NSAPLogin/NSAPLogon for session setup. |
NSAPClickPictureOnScreen |
NSAPClickPictureOnScreen (data-driven) |
Click a picture/icon element rendered on screen by SAP GUI. | User has an SAP picture target that NClick cannot resolve. For ordinary controls prefer NClick. |
NSAPClickToolbarButton |
NSAPClickToolbarButton (data-driven) |
Click a button on the SAP GUI toolbar by its accessible identifier. | User wants to invoke a toolbar action in SAP GUI by ID rather than by selector. For arbitrary clicks use NClick. |
NSAPExpandALVHierarchicalTable |
NSAPExpandALVHierarchicalTable (data-driven) |
Expand all nodes of an SAP ALV hierarchical table for full-data scraping. | User wants to read every row of a collapsed SAP ALV hierarchical grid. For tree controls use NSAPExpandALVTree or NSAPExpandTree. |
NSAPExpandALVTree |
NSAPExpandALVTree (data-driven) |
Expand all nodes in an SAP ALV tree control. | User wants every branch of an SAP ALV tree opened. For non-ALV trees use NSAPExpandTree. |
NSAPExpandTree |
NSAPExpandTree (data-driven) |
Expand every node in an SAP GUI tree control. | User wants every branch of a generic SAP tree opened. For ALV trees use NSAPExpandALVTree. |
NSAPLogin |
NSAPLogin (data-driven) |
Log in to an SAP system through the SAP GUI login screen. | User wants automated login against the SAP GUI logon screen. For session selection from SAP Logon Pad use NSAPLogon. |
NSAPLogon |
NSAPLogon (data-driven) |
Open a session from the SAP Logon Pad by its connection name. | User wants to start an SAP session from SAP Logon by connection name. To enter credentials on the SAP login screen itself use NSAPLogin. |
NSAPReadStatusbar |
NSAPReadStatusbar (data-driven) |
Read the SAP GUI status bar message (text and severity) into output variables. | User needs to capture the status-bar feedback after an SAP transaction (success/warning/error message). |
NSAPSelectDatesInCalendar |
NSAPSelectDatesInCalendar (data-driven) |
Select a date range in the SAP GUI calendar control. | User wants to choose dates in an SAP calendar widget. For ordinary dropdowns use NSelectItem. |
NSAPSelectMenuItem |
NSAPSelectMenuItem (data-driven) |
Select a menu entry from the SAP GUI menu bar by its menu path. | User wants to invoke a menu-bar action in SAP GUI by path. For toolbar buttons use NSAPClickToolbarButton. |
NSAPTableCellScope |
NSAPTableCellScope (data-driven) |
Scope that pins an SAP table cell as the target for nested activities. | User wants to perform several actions against the same SAP table cell without repeating the row/column index. |
NSelectItem |
gen_nselectitem |
Select an item from a combobox/dropdown by visible text. | User wants to pick a value from a dropdown/combobox. For multi-select lists use SelectMultipleItems; for typing into the field use NTypeInto. |
NSetBrowserData |
NSetBrowserData (data-driven) |
Write a structured value (table/list/attribute) back into a browser DOM target. | User wants to push structured data into the page model. To read use NGetBrowserData. |
NSetClipboard |
NSetClipboard (data-driven) |
Set the system clipboard contents to a given string. | User wants to seed the clipboard before a paste-style action. To read what is on the clipboard use NGetClipboard. |
NSetFocus |
NSetFocus (data-driven) |
Move keyboard focus to a UI element without clicking it. | User wants the next typed input to land on a specific element without firing a click. For classic activities use SetFocus. |
NSetRuntimeBrowser |
NSetRuntimeBrowser (data-driven) |
Switch the runtime browser used by subsequent UI Automation activities (Chrome, Edge, Firefox). | User wants to override the browser used by the current run (e.g. to force Edge for a specific flow). |
NSetText |
NSetText (data-driven) |
Set the value of a text field directly (paste-style), bypassing per-character typing. | User wants to fill a long string into a field without keystroke simulation (faster, no IME issues). For per-character typing use NTypeInto. |
NTakeScreenshot |
NTakeScreenshot (data-driven) |
Capture a screenshot of the target UI element or full screen and store it in a variable. | User wants to save a screen capture to disk or memory mid-run. For composite take-and-save flows consider gen_take_screenshot_and_save. |
NTypeInto |
gen_ntypeinto |
Type a string into a UI element by simulating keystrokes, with optional secure-text masking and empty-field handling. | User wants to fill a single text input by typing characters one at a time. For checkboxes use NCheck; for dropdowns use NSelectItem; for clipboard-paste fills use NSetText. |
NUITask |
NUITask (data-driven) |
Run a high-level UI task described in natural language using AI to choose actions (UITasksWithAI). | User wants AI to plan and execute a multi-step UI flow from a textual instruction. For deterministic single steps use the explicit modern verbs (NClick / NTypeInto). |
NUnblockUserInput |
NUnblockUserInput (data-driven) |
Re-enable user mouse and keyboard input previously blocked by NBlockUserInput. | User wants to release input after an NBlockUserInput. Always run in a Finally to avoid stranding the user. |
NWindowOperation |
NWindowOperation (data-driven) |
Apply a window operation (Maximize, Minimize, Restore, Close, Move, Resize) to a UI element's window. | User wants to manipulate a window's state. For just hiding use HideWindow; for popups use NClosePopup. |
SaveImage |
gen_save_image |
Save a UiPath.Core.Image variable to disk as a PNG/JPG file. | User wants to persist a captured screenshot or CV image to disk. For the inverse use LoadImage; to capture in one step consider gen_take_screenshot_and_save. |
SelectMultipleItems |
gen_select_multiple_items |
Select multiple items from a list-box or multi-select dropdown by visible text. | User wants to pick several values from a multi-select control. For single-value picks use NSelectItem. |
SetFocus |
gen_set_focus |
Move keyboard focus to a UI element (classic activity) without clicking. | User wants to focus an element in classic UIA. In modern projects prefer NSetFocus. |
SetWebAttribute |
gen_set_web_attribute |
Set the value of a named DOM attribute on a web UI element. | User wants to write directly to a DOM attribute (value, style) bypassing user-style interactions. For ordinary form fills use NTypeInto / NSetText. |
Application & browser cards (4)
| Activity | Generator | Description | Use when |
|---|---|---|---|
NApplicationCardAttach |
gen_napplicationcard_attach |
Attach the body to an already-running browser or desktop application via an existing UiElement. | The browser or app is already open (or was opened earlier in the workflow) and you want a scope around it without re-launching. Use NApplicationCardOpen when you must launch a browser URL, NApplicationCardDesktopOpen when launching a deskt… |
NApplicationCardClose |
gen_napplicationcard_close |
Close the browser or app the body was scoped to once execution exits the card. | You explicitly want to shut down the browser or app at the end of an Open / Attach scope rather than leaving it running. Use NApplicationCardOpen / NApplicationCardAttach when you only need to enter a scope, not close one. |
NApplicationCardDesktopOpen |
gen_napplicationcard_desktop_open |
Launch a Windows desktop executable (by file path) inside a UI scope and run the body against it. | The target is a desktop .exe that must be started before any UI step. Use NApplicationCardOpen for a browser URL instead, NApplicationCardAttach when the desktop app is already running. |
NApplicationCardOpen |
gen_napplicationcard_open |
Open a browser to a URL inside a UI scope and run the body against that browser instance. | The workflow needs to launch (or re-launch) a browser at a known URL before any UI step. Use NApplicationCardAttach instead when the browser is already open, NApplicationCardDesktopOpen when launching a Windows .exe rather than a URL. |
Navigation (4)
| Activity | Generator | Description | Use when |
|---|---|---|---|
NExtractDataGeneric |
gen_nextractdata |
Wizard-only Extract Data Generic activity that emits a typed DataTable from a Studio-authored extraction definition. | Do not auto-generate; direct user to Studio's Extract Data Wizard (Modern UI Automation ribbon) to build the table definition interactively. |
NGetUrl |
gen_ngeturl |
Reads the current URL of the active browser tab and assigns it to a variable. | User wants to capture the page URL for logging or routing decisions; to navigate to a URL use NGoToUrl. |
NGoToUrl |
gen_ngotourl |
Navigates the active browser to the given URL within an NApplicationCard browser scope. | User wants to change the active page inside an already-open browser; for opening a new browser use NApplicationCard; to read the current URL use NGetUrl. |
PickLoginValidation |
gen_pick_login_validation |
Pick activity with two branches that races a success selector against an error selector to detect login outcome. | User wants to validate that a form submission succeeded vs surfaced a visible error message; for general n-way racing use Pick directly; for sequential retry use RetryScope. |
Control flow (13)
| Activity | Generator | Description | Use when |
|---|---|---|---|
Delay |
Delay (data-driven) |
Pause workflow execution for a TimeSpan duration before continuing. | User explicitly asks for a fixed pause/sleep. Avoid in production loops (lint 109 flags it) - prefer ShouldStop checks or a retry-with-backoff pattern. |
DoWhile |
gen_do_while |
Run a body sequence at least once, then repeat while a Boolean condition stays true. | User wants a post-test loop that always executes at least one pass. For zero-or-more iterations use While; for cancel-aware loops use InterruptibleDoWhile. |
Flowchart |
gen_flowchart |
Author a flowchart container with FlowSteps, FlowDecisions, branching connectors, and a designated start node. | User wants an explicit graph-style workflow with multiple entry/exit paths and back-edges. For straight-line work use Sequence; for state-driven graphs use StateMachine. |
ForEach |
gen_foreach |
Iterate over an in-memory collection (IEnumerable) running the body once per item with a typed loop variable. | User wants to loop over a list/array/IEnumerable. For DataTable rows use ForEachRow; for files in a folder use ForEachFileX; for parallel iteration use ParallelForEach. |
ForEachFileX |
gen_foreach_file |
Iterate over files in a folder (StudioX FileInfo iterator) with optional recursion and ordering. | User wants to process every file in a directory. For folders use ForEachFolderX (data ops); for arbitrary collections use ForEach. |
ForEachRow |
gen_foreach_row |
Iterate over the rows of a DataTable, exposing each row as a DataRow loop variable. | User wants to walk every row of a DataTable. For arbitrary collections use ForEach; for files use ForEachFileX. |
If |
gen_if |
Branch execution based on a single Boolean condition with a Then branch and an optional Else branch. | User needs a binary decision on a Boolean expression. For three or more mutually-exclusive cases use IfElseIfV2 or Switch; for value-based dispatch use Switch. |
IfElseIfV2 |
gen_if_else_if |
Chain multiple Boolean conditions evaluated in order, with a Then branch per condition and an optional final Else. | User has three or more mutually-exclusive conditional branches keyed on Boolean expressions. For exactly two outcomes use If; for value-equality dispatch use Switch. |
Parallel |
gen_parallel |
Run two or more branches concurrently, with an optional CompletionCondition that ends the activity once truthy. | User wants to fan out N independent pre-built branches and join them. For parallel iteration over a collection use ParallelForEach. |
ParallelForEach |
gen_parallel_foreach |
Iterate over a collection in parallel, running the body concurrently for each item. | User wants concurrent iteration over a collection. For sequential iteration use ForEach; for fan-out of distinct branches use Parallel. |
StateMachine |
gen_state_machine |
Author a state-machine container with named states, transitions, entry actions, and a designated initial state. | User wants explicit named states with guarded transitions (e.g. REFramework). For free-form graphs use Flowchart; for linear control flow use Sequence. |
Switch |
gen_switch |
Dispatch on the value of an expression to one of N labelled case sequences plus an optional default. | User wants to choose a branch by the value of a single expression (string, integer, enum). For Boolean conditions use If or IfElseIfV2. |
While |
gen_while |
Repeat a body sequence while a Boolean condition stays true, evaluating the condition before each iteration. | User wants a pre-test loop that may run zero times. For at-least-once execution use DoWhile; for cancel-aware loops use InterruptibleWhile. |
Data tables & collections (128)
| Activity | Generator | Description | Use when |
|---|---|---|---|
AddDataColumn |
gen_add_data_column |
Adds a new typed column to an existing DataTable. | User wants to extend a DataTable's schema after construction; the cleaner pattern is to declare all columns in BuildDataTable upfront. |
AddDataRow |
gen_add_data_row |
Appends a new row to a DataTable, taking values either as an array (positional) or a DataRow object. | User wants to add one row to a DataTable; for many rows from another DataTable use MergeDataTable. |
AddOrSubtractFromDate |
gen_add_or_subtract_from_date |
Returns a DateTime offset by N seconds/minutes/hours/days/months/years from an input date. | User wants date arithmetic; for formatting a date use FormatDateAsText; for parsing a string into DateTime use ExtractDateTime. |
AddTransactionItem |
gen_add_transaction_item |
Adds a new transaction item to an Orchestrator queue inside a long-running job context. | User wants to enqueue mid-process; for dispatcher-style bulk loading use BulkAddQueueItems. |
AppendLine |
gen_append_line |
Appends a line of text to an existing text file, creating it if missing. | User wants incremental log/audit writes; for one-shot text writes use Write Text File. |
Assign |
gen_assign |
Assigns the result of a single VB expression to a single variable / argument. | User wants to set one value; for multiple assignments in one block use MultipleAssign; for declaring new variables in scope use VariablesBlock. |
Beep |
gen_beep |
Plays a system beep at a given frequency and duration. | User wants an audible cue (developer/test only); avoid in unattended automations. |
BeginProcess |
gen_begin_process |
Marks the start of a logical process for tracking and analytics in Insights / Process Mining. | User wants to time a logical process span; pair with the corresponding end-of-process tracking. |
BuildDataTable |
gen_build_data_table |
Constructs a typed DataTable from a column schema and optional initial rows. | User wants an empty/seeded DataTable to fill via AddDataRow or to pass to ForEachRow; for reading a CSV/Excel into a DataTable use ReadCsvFile / ReadRange. |
ChangeCase |
gen_change_case |
Returns a string converted to upper, lower, or title case. | User wants a case transformation; for find/replace use Replace; for trim/split use ModifyText. |
CheckFalse |
gen_check_false |
Asserts that a condition is False, throwing on True. | User wants an inline negative assertion; for truthy assertion use CheckTrue; in tests prefer the Verify* family. |
CheckTrue |
gen_check_true |
Asserts that a condition is True, throwing on False. | User wants an inline positive assertion; for negative assertion use CheckFalse; in tests prefer the Verify* family. |
ClearDataTable |
gen_clear_data_table |
Removes all rows from a DataTable while preserving its column schema. | User wants to reset a DataTable for reuse; to drop the schema entirely just rebuild with BuildDataTable. |
CombineText |
gen_combine_text |
Concatenates multiple strings with an optional separator. | User wants to join strings (String.Join equivalent in activity form); for in-place expression use VB's String.Join. |
CompressFiles |
gen_compress_files |
Compresses one or more files / folders into a ZIP archive. | User wants to bundle artifacts for upload or email; for extraction use ExtractFiles. |
CopyFolderX |
gen_copy_folder_x |
Copies a folder (recursive) from source to destination, optionally overwriting. | User wants to duplicate a folder tree; for a single file use Copy File; for moving (not copying) use MoveFolderX. |
CreateFile |
gen_create_file |
Creates an empty file at the given path. | User wants a placeholder file; to write content use Write Text File or AppendLine. |
CustomInput |
gen_custom_input |
Displays a custom HTML form dialog and captures the user's response. | User wants a richer prompt than InputDialog; for simple text input use InputDialog. |
Delete |
gen_delete |
Deletes a file or folder at the given path. | User wants to remove a filesystem entry; for ZIP-and-delete patterns use CompressFiles then Delete. |
DeleteFolderX |
gen_delete_folder_x |
Deletes a folder (recursive). | User wants to remove a directory tree; for single files use Delete. |
DeleteQueueItems |
gen_delete_queue_items |
Deletes queue items from an Orchestrator queue by ID list or filter. | User wants to purge stale or successful items; pair with GetQueueItems to enumerate first. |
DeleteStorageFile |
gen_delete_storage_file |
Deletes a file from an Orchestrator Storage Bucket. | User wants to remove a bucket-stored file; pair with ListStorageFiles to enumerate first. |
DisableTrigger |
gen_disable_trigger |
Disables an Orchestrator trigger by name. | User wants to pause scheduled or queue-driven triggers temporarily; re-enable with EnableTrigger. |
DownloadFileFromUrl |
gen_download_file_from_url |
Downloads a file from an HTTP(S) URL to a local path. | User wants a file fetched by URL; for authenticated APIs use NetHttpRequest with response-to-file. |
DownloadStorageFile |
gen_download_storage_file |
Downloads a file from an Orchestrator Storage Bucket to a local path. | User wants a bucket-stored file locally; pair with UploadStorageFile for the inverse. |
EnableTrigger |
gen_enable_trigger |
Enables a previously disabled Orchestrator trigger by name. | User wants to resume a paused trigger; pair with DisableTrigger. |
EvaluateBusinessRule |
gen_evaluate_business_rule |
Evaluates a Business Rule from the Rules Catalog and returns its outcome / actions. | User wants to delegate decisioning to a centrally-managed rule; for inline VB conditions use If. |
ExecutePowerShell |
gen_execute_power_shell |
Runs a PowerShell script and captures its output. | User wants to invoke Windows-side admin tasks; prefer dedicated activities (filesystem/registry) when one exists. |
ExtractDateTime |
gen_extract_date_time |
Parses a string into a DateTime using a culture-aware format pattern. | User wants to convert a string to DateTime; for the inverse use FormatDateAsText. |
ExtractFiles |
gen_extract_files |
Extracts the contents of a ZIP archive to a target folder. | User wants to unpack a ZIP; for compression use CompressFiles. |
ExtractText |
gen_extract_text |
Extracts a substring from a source string by regex or position. | User wants a piece of a larger string; for find/replace use Replace; for splitting use SplitText. |
FileChangeTrigger |
gen_file_change_trigger |
Trigger that fires when a watched file is created/modified/deleted. | User wants to react to filesystem changes; v3 (FileChangeTriggerV3) is the latest stable. |
FileChangeTriggerV2 |
gen_file_change_trigger_v2 |
v2 of FileChangeTrigger — superseded by FileChangeTriggerV3 in modern projects. | User has a legacy spec referencing v2; new specs should use FileChangeTriggerV3. |
FileChangeTriggerV3 |
gen_file_change_trigger_v3 |
v3 of FileChangeTrigger — current stable file-watch trigger with extended event types. | User wants to react to filesystem changes in a modern project; v1/v2 remain for backwards compatibility only. |
FileExistsX |
gen_file_exists_x |
Returns True if a file exists at the given path. | User wants a simple existence check; for folders use FolderExistsX. |
FilterDataTable |
gen_filter_data_table |
Filters a DataTable in place using a list of column / operator / value rules. | User wants to keep or remove rows by column criteria; for joins across tables use JoinDataTables; for a single-row lookup use LookupDataTable. |
FindAndReplace |
gen_find_and_replace |
Finds and replaces text in a file in place, optionally using regex. | User wants to mutate file contents; for in-memory string replacement use Replace. |
FolderExistsX |
gen_folder_exists_x |
Returns True if a folder exists at the given path. | User wants a simple folder existence check; for files use FileExistsX. |
ForEachFolderX |
gen_for_each_folder_x |
Iterates over folders matching a pattern under a root directory. | User wants to walk a directory tree of folders; for files use ForEachFileX; for in-memory collections use ForEach. |
FormatDateAsText |
gen_format_date_as_text |
Formats a DateTime as a string using a culture-aware format pattern. | User wants a stringified date; for parsing the inverse use ExtractDateTime. |
FormatValue |
gen_format_value |
Formats a numeric value using a format pattern (currency, decimal, percent). | User wants a stringified number with explicit formatting; VB's String.Format suffices in expressions. |
GenerateDataTable |
gen_generate_data_table |
Builds a DataTable by parsing a delimited string (e.g. raw text scraped from a UI element). | User has captured tabular text from screen scraping and wants a typed DataTable; for proper CSV files use ReadCsvFile; for Excel use ReadRange. |
GetCurrentJobInfo |
gen_get_current_job_info |
Returns Orchestrator metadata about the currently-running job (id, robot, folder). | User wants to read job-context properties for logging or correlation. |
GetEnvironmentFolder |
gen_get_environment_folder |
Returns the path of a Windows special folder (Desktop, MyDocuments, etc.). | User wants to write to a known user folder; for an environment variable use GetEnvironmentVariable. |
GetEnvironmentVariable |
gen_get_environment_variable |
Returns the value of a process-, user-, or machine-scoped environment variable. | User wants to read a configured env var; for setting use SetEnvironmentVariable. |
GetFileInfoX |
gen_get_file_info_x |
Returns metadata (size, created, modified) for a file as a FileInfo object. | User wants file metadata for routing decisions; for folder metadata use GetFolderInfoX. |
GetFolderInfoX |
gen_get_folder_info_x |
Returns metadata (size, created, modified) for a folder as a DirectoryInfo object. | User wants folder metadata; for file metadata use GetFileInfoX. |
GetJobs |
gen_get_jobs |
Queries Orchestrator for jobs matching given filters. | User wants to enumerate or correlate Orchestrator jobs; for the current job only use GetCurrentJobInfo. |
GetLastDownloadedFile |
gen_get_last_downloaded_file |
Returns the path of the most recently downloaded file from the active browser context. | User wants to capture a download triggered by a browser interaction; pair with NClick on the download link. |
GetProcesses |
gen_get_processes |
Returns a list of currently-running Windows processes. | User wants to enumerate processes for diagnostics or detect a running app; to terminate one use KillProcess. |
GetQueueItems |
gen_get_queue_items |
Queries Orchestrator for queue items matching given filters (status, reference, dates). | User wants to inspect or audit queue contents; for popping the next work item use GetQueueItem. |
GetRowItem |
gen_get_row_item |
Reads a single column value from a DataRow by column name or index. | User wants a typed cell value from a DataRow; usually the inline expression row("Col") is more idiomatic. |
GetSecret |
gen_get_secret |
Reads a secret value from a configured secret store (Orchestrator credentials, vault, etc.). | User wants a secret without storing it in code or config; for credential pairs use GetRobotCredential. |
GetTransactionItem |
gen_get_transaction_item |
Pops the next transaction from a queue, mirroring REFramework's Get Transaction Data step. | User is hand-authoring a Performer; in REFramework this is wired automatically. |
GetUsernamePasswordX |
gen_get_username_password_x |
Reads a username/password pair from a Windows Credential Manager entry by name. | User wants OS-level credentials; for Orchestrator-managed credentials use GetRobotCredential. |
GlobalVariableChangedTrigger |
gen_global_variable_changed_trigger |
Trigger that fires when a workflow Global Variable's value changes. | User wants reactive flow on global state mutations; pair with NotifyGlobalVariableChanged from the producer side. |
InterruptibleDoWhile |
gen_interruptible_do_while |
DoWhile loop that yields to interrupts (Stop, signals) at safe checkpoints between iterations. | User wants long-running iteration that honors cooperative cancellation; for non-interruptible loops use DoWhile. |
InterruptibleWhile |
gen_interruptible_while |
While loop that yields to interrupts at safe checkpoints between iterations. | User wants long-running iteration with cooperative cancellation; for non-interruptible loops use While. |
InvokeComMethod |
gen_invoke_com_method |
Invokes a COM method on a registered COM object (e.g. Office automation). | User wants to call COM-based APIs; for VB.NET methods use InvokeMethod; for inline code use InvokeCode. |
InvokeProcess |
gen_invoke_process |
Launches an external Windows process and optionally waits for its exit / captures stdout. | User wants to run a CLI tool or executable; for PowerShell scripts use ExecutePowerShell. |
InvokeVBScript |
gen_invoke_vb_script |
Runs a VBScript file with optional arguments and captures its output. | User has a legacy .vbs script to call; for new scripting prefer ExecutePowerShell or InvokeCode. |
InvokeWorkflowInteractive |
gen_invoke_workflow_interactive |
Invokes a subworkflow in an interactive session (Picture-in-Picture / unattended elevation). | User wants to run a child workflow with elevated UI access; for standard subworkflow calls use InvokeWorkflowFile. |
IsMatch |
gen_is_match |
Returns True if a string matches a regex pattern. | User wants a boolean regex check; for capturing matches use Matches; VB's Regex.IsMatch suffices in expressions. |
JoinDataTables |
gen_join_data_tables |
Joins two DataTables on equality of specified columns (Inner / Left / Full join). | User wants relational-style joins between two tables; for filtering one table by criteria from another, FilterDataTable in a loop is simpler when one side is small. |
ListStorageFiles |
gen_list_storage_files |
Lists files in an Orchestrator Storage Bucket, optionally filtered by prefix. | User wants to enumerate bucket contents; pair with DownloadStorageFile / DeleteStorageFile. |
LookupDataTable |
gen_lookup_data_table |
Looks up a single matching row in a DataTable by a key column value. | User wants one row by key (Excel VLOOKUP-equivalent); for many matching rows use FilterDataTable. |
ManualTrigger |
gen_manual_trigger |
Trigger that fires when invoked manually (debug / dev-time only). | User wants a hand-fired trigger for testing; production should use FileChange/Time/Queue triggers. |
Matches |
gen_matches |
Returns the list of regex matches against a string. | User wants captured matches; for a boolean check use IsMatch; VB's Regex.Matches suffices in expressions. |
MergeDataTable |
gen_merge_data_table |
Merges rows from a source DataTable into a destination DataTable, preserving the destination schema. | User wants to append rows from another table with matching schema; for a single row use AddDataRow. |
ModifyDate |
gen_modify_date |
Returns a DateTime with selected components replaced (year, month, day, hour, etc.). | User wants component-level date editing; for offset-based shifts use AddOrSubtractFromDate. |
ModifyText |
gen_modify_text |
Applies a sequence of text transformations (trim, replace, case, encode) in one activity. | User wants several string transforms in one step; for a single transform pick the specific activity (Replace, ChangeCase, etc.). |
MoveFolderX |
gen_move_folder_x |
Moves a folder (recursive) from source to destination. | User wants to relocate a folder; for non-destructive copy use CopyFolderX. |
MultipleAssign |
gen_multiple_assign |
Assigns a list of (target, expression) pairs in one activity, evaluated top-to-bottom. | User wants to set several variables together (e.g. zeroing counters at start of a loop); for a single assignment use Assign. |
NotifyGlobalVariableChanged |
gen_notify_global_variable_changed |
Signals to subscribers that a Global Variable's value changed. | User wants to manually fire a change notification; pair with GlobalVariableChangedTrigger on the consumer side. |
OrchestratorHttpRequest |
gen_orchestrator_http_request |
Performs an authenticated HTTP request against the Orchestrator API. | User wants Orchestrator API calls without managing auth headers; for arbitrary REST APIs use NetHttpRequest. |
OutputDataTable |
gen_output_data_table |
Renders a DataTable as a formatted string (CSV-like) for logging or display. | User wants a human-readable preview of a DataTable; for persisting to disk use WriteCsvFile. |
Placeholder |
gen_placeholder |
Empty placeholder activity used as a generator stub during scaffolding. | User wants to mark a TODO spot in a workflow; should be replaced with the real activity before publish. |
PostponeTransactionItem |
gen_postpone_transaction_item |
Reschedules a queue transaction item to a later deadline. | User wants to defer a transaction (rate-limit, retry-window); for outright failure use SetTransactionStatus(Failed). |
ProcessEndTrigger |
gen_process_end_trigger |
Trigger that fires when a Windows process exits. | User wants reactive flow on process termination; v2 (ProcessEndTriggerV2) is the latest stable. |
ProcessEndTriggerV2 |
gen_process_end_trigger_v2 |
v2 of ProcessEndTrigger — current stable process-exit trigger. | User wants modern process-end watching; v1 remains for backwards compatibility. |
ProcessStartTrigger |
gen_process_start_trigger |
Trigger that fires when a Windows process starts. | User wants reactive flow on process launch; v2 (ProcessStartTriggerV2) is the latest stable. |
ProcessStartTriggerV2 |
gen_process_start_trigger_v2 |
v2 of ProcessStartTrigger — current stable process-start trigger. | User wants modern process-start watching; v1 remains for backwards compatibility. |
ProcessTrackingScope |
gen_process_tracking_scope |
Scope wrapper that emits Process Mining tracking events for activities executed within. | User wants Process Mining instrumentation; for ad-hoc analytics emission use TrackObject. |
QueueTrigger |
gen_queue_trigger |
Trigger that fires when a queue item is added to a watched Orchestrator queue. | User wants reactive Performers; for time-based use TimeTrigger. |
RaiseAlert |
gen_raise_alert |
Raises a Process Insights alert with a severity / message. | User wants to surface a problem to ops dashboards; for plain log writes use LogMessage. |
ReadStorageText |
gen_read_storage_text |
Reads the text content of a file in an Orchestrator Storage Bucket. | User wants bucket-stored text without downloading first; for binary or large files use DownloadStorageFile. |
RemoveDataColumn |
gen_remove_data_column |
Removes a column from a DataTable by name or DataColumn object. | User wants to drop a column before exporting; for projecting to a new schema entirely consider Filter Data Table or LINQ. |
RemoveDataRow |
gen_remove_data_row |
Removes a row from a DataTable by index or DataRow object. | User wants to drop one row; for many-row removal by criteria use FilterDataTable. |
RemoveDuplicateRows |
gen_remove_duplicate_rows |
Removes duplicate rows from a DataTable (full-row equality across all columns). | User wants a deduped table; for column-subset deduplication use a Filter Data Table chain or LINQ. |
RenameFileX |
gen_rename_file_x |
Renames a file (or moves it) preserving content. | User wants to change a file's name; for moving across drives use Move File. |
RenameFolderX |
gen_rename_folder_x |
Renames a folder (or moves it) preserving content. | User wants to change a folder's name; for moving across drives use MoveFolderX. |
RepeatNumberOfTimesX |
gen_repeat_number_of_times_x |
Loops a fixed number of times. | User wants N-iteration repetition; for collection iteration use ForEach; for condition-driven use While. |
RepeatTrigger |
gen_repeat_trigger |
Trigger that fires on a fixed cadence relative to a base time. | User wants periodic execution (e.g. every 5 minutes); for cron-style absolute times use TimeTrigger. |
Replace |
gen_replace |
Replaces occurrences of a substring or regex with a replacement value. | User wants string find/replace; for file in-place edits use FindAndReplace; VB's Replace / Regex.Replace suffices in expressions. |
ReportStatus |
gen_report_status |
Reports an interim status for the running job to Orchestrator dashboards. | User wants progress visibility on long jobs; for terminal status use SetTransactionStatus. |
ResetTimer |
gen_reset_timer |
Resets a named Timer activity's elapsed counter to zero. | User wants to restart a timing measurement; pair with StartTimer / StopTimer. |
ResumeTimer |
gen_resume_timer |
Resumes a paused Timer activity. | User wants to continue a paused measurement; pair with StartTimer / StopTimer / ResetTimer. |
Return |
gen_return |
Returns from the current workflow / scope, propagating an optional value. | User wants an early exit from a subworkflow; for terminating the entire job use TerminateWorkflow. |
RunJob |
gen_run_job |
Triggers a job run against an Orchestrator process and optionally waits for completion. | User wants to invoke another process from the current workflow; for fire-and-forget use StartJob. |
SelectFile |
gen_select_file |
Opens an OS file-picker dialog and returns the chosen path. | User wants user-driven file selection (attended only); unattended runs should source paths from config. |
SelectFolder |
gen_select_folder |
Opens an OS folder-picker dialog and returns the chosen path. | User wants user-driven folder selection (attended only); unattended runs should source paths from config. |
SendEmailNotification |
gen_send_email_notification |
Sends a templated email notification (Orchestrator-configured SMTP) to one or more recipients. | User wants ops-style notification email; for full mail control use SendOutlookMail / SendSMTPMail. |
SetAsset |
gen_set_asset |
Writes a value to a named Orchestrator asset. | User wants to update a centrally-managed value; for credentials use SetCredential. |
SetCredential |
gen_set_credential |
Writes a username/password pair to a named Orchestrator credential asset. | User wants to rotate or seed a credential asset; for non-credential values use SetAsset. |
SetEnvironmentVariable |
gen_set_environment_variable |
Sets a process- or user-scoped environment variable. | User wants to inject env state for downstream tools; reads use GetEnvironmentVariable. |
SetSecret |
gen_set_secret |
Writes a secret value to a configured secret store. | User wants to seed or rotate a secret; reads use GetSecret. |
SetTaskStatus |
gen_set_task_status |
Updates the status of a tracked task (Tasks app integration). | User wants to mark a task complete / cancelled; for queue items use SetTransactionStatus. |
SetTraceStatus |
gen_set_trace_status |
Sets a trace breadcrumb for distributed tracing of the current job. | User wants OpenTelemetry-style traces in Insights; for ad-hoc logs use LogMessage. |
SetTransactionProgress |
gen_set_transaction_progress |
Updates the progress percentage of a long-running queue transaction. | User wants progress visibility on a transaction; for terminal status use SetTransactionStatus. |
SetTransactionStatus |
gen_set_transaction_status |
Marks a queue transaction Successful / Failed (with reason) at the end of processing. | User wants to close out a Performer transaction; in REFramework the End Transaction state wires this automatically. |
SortDataTable |
gen_sort_data_table |
Sorts a DataTable by one or more columns in ascending/descending order. | User wants ordered rows for output or deduplication; pair with RemoveDuplicateRows to canonicalize before persisting. |
SplitText |
gen_split_text |
Splits a string into a list of substrings on a delimiter or regex. | User wants tokenized string output; for joining the inverse use CombineText. |
StartJob |
gen_start_job |
Triggers a job run against an Orchestrator process and returns immediately (fire-and-forget). | User wants asynchronous process invocation; for synchronous use RunJob. |
StartTimer |
gen_start_timer |
Starts a named Timer activity for measuring elapsed time. | User wants to measure how long a region takes; pair with StopTimer / ResetTimer. |
StartTriggers |
gen_start_triggers |
Starts all (or named) Orchestrator triggers attached to the current process. | User wants to enable a trigger set; pair with StopTriggers. |
StopJob |
gen_stop_job |
Stops a running Orchestrator job by ID (cooperative). | User wants to abort a running job from another job; the target job should call ShouldStop at safe points. |
StopTimer |
gen_stop_timer |
Stops a named Timer activity and returns the elapsed time. | User wants to capture a region's duration; pair with StartTimer. |
StopTriggers |
gen_stop_triggers |
Stops all (or named) Orchestrator triggers attached to the current process. | User wants to pause a trigger set; pair with StartTriggers. |
TextToLeftRight |
gen_text_to_left_right |
Splits a string at the first occurrence of a delimiter into (left, right) parts. | User wants a one-shot split into two pieces; for n-way splits use SplitText. |
TimeoutScope |
gen_timeout_scope |
Aborts the activities inside the scope after a configurable timeout. | User wants a hard upper bound on a region's duration; for retry-with-timeout use RetryScope. |
TimeTrigger |
gen_time_trigger |
Trigger that fires at scheduled times (cron-style). | User wants scheduled execution; for relative cadence use RepeatTrigger. |
TrackObject |
gen_track_object |
Emits an analytics event with a named object payload to Insights / Process Mining. | User wants to record a typed event for analytics; for whole-process spans use ProcessTrackingScope. |
TriggerScope |
gen_trigger_scope |
Scope wrapper hosting one or more triggers and their reactive bodies. | User wants to author trigger-driven workflows; the scope manages start/stop lifecycle. |
UpdateRowItem |
gen_update_row_item |
Sets a single column value on a DataRow. | User wants to mutate one cell in a DataTable; the inline expression row("Col") = value is also idiomatic. |
UploadStorageFile |
gen_upload_storage_file |
Uploads a local file to an Orchestrator Storage Bucket. | User wants to publish artifacts to a bucket; pair with DownloadStorageFile / ListStorageFiles. |
VariablesBlock |
gen_variables_block |
Helper composite that emits a Sequence/Flowchart Variables declaration block. | User is hand-authoring a generator and needs to declare local variables; the standard scaffolder does this automatically. |
WaitQueueItem |
gen_wait_queue_item |
Waits until a matching item appears on a watched Orchestrator queue. | User wants to block until queue input is available; for non-blocking polling use GetQueueItems. |
WriteStorageText |
gen_write_storage_text |
Writes a text payload to a file in an Orchestrator Storage Bucket. | User wants to persist generated text directly to a bucket; for binary or large files use UploadStorageFile. |
Excel (103)
| Activity | Generator | Description | Use when |
|---|---|---|---|
AddSensitivityLabelX |
gen_add_sensitivity_label_x |
StudioX activity that applies a Microsoft 365 sensitivity label to the active workbook. | User wants to set/replace a sensitivity label on a workbook. To read the current label use GetSensitivityLabelX. |
AppendCsvFile |
gen_append_csv_file |
Append rows from a DataTable to an existing CSV file (or create the file with headers). | User wants to grow a CSV without rewriting it. To overwrite use WriteCsvFile. |
AppendRangeX |
gen_append_range_x |
StudioX 'Append Range' - append a DataTable to the end of an existing sheet/table in the active Excel scope. | User wants to add rows below existing data without overwriting. To overwrite from row 1 use WriteRangeX. |
AutoFillX |
AutoFillX (data-driven) |
StudioX 'Auto Fill Range' - extend a formula or value across a destination range using Excel's auto-fill. | User wants to drag-fill a formula/value across cells. For row-based fill use FillRangeX; for one-off writes use WriteRangeX. |
AutoFitX |
gen_auto_fit_x |
StudioX 'Auto Fit' - auto-size columns or rows in a sheet or range. | User wants Excel to auto-size widths after writing data. |
ChangePivotTableDataSourceX |
gen_change_pivot_table_data_source_x |
StudioX activity that re-points a PivotTable to a different source range. | User wants to redirect a PivotTable's data source. To refresh after underlying data changed use RefreshPivotTableX. |
ClearRangeX |
gen_clear_range_x |
StudioX 'Clear Range' - clear contents and/or formatting from a worksheet range. | User wants to wipe values from cells without deleting the rows/columns. To remove rows use DeleteRowsX. |
CloseWorkbook |
gen_close_workbook |
Close an open workbook in the current Excel scope, optionally saving first. | User wants to close a workbook explicitly. For modern projects this is rarely needed - the Excel scope auto-closes. |
CopyChartToClipboardX |
gen_copy_chart_to_clipboard_x |
StudioX activity that copies an Excel chart image to the system clipboard. | User wants the chart in clipboard form (e.g. to paste into a slide deck or email). |
CopyPasteRangeX |
gen_copy_paste_range_x |
StudioX 'Copy/Paste Range' - copy a source range and paste it to a destination, with paste-special options. | User wants to duplicate a range with native Excel paste semantics. For classic projects use ExcelCopyPasteRange. |
CreateNewWorkbook |
gen_create_new_workbook |
Create a new empty workbook on disk at the given path. | User wants to scaffold a new .xlsx file before writing data. To open an existing workbook use OpenWorkbook. |
CreatePivotTable |
gen_create_pivot_table |
Create a PivotTable in the workbook (classic Excel API) bound to a source range. | User wants a PivotTable in classic projects. In StudioX use CreatePivotTableX or CreatePivotTableXv2. |
CreatePivotTableX |
gen_create_pivot_table_x |
StudioX 'Create Pivot Table' - create a PivotTable bound to a sheet/table range. | User wants a PivotTable in StudioX. The newer variant CreatePivotTableXv2 supports additional layout options. |
CreatePivotTableXv2 |
gen_create_pivot_table_xv2 |
StudioX 'Create Pivot Table (v2)' - newer variant with additional row/column/value field configuration. | User wants the newer PivotTable creator with explicit field layout. Otherwise CreatePivotTableX works. |
CreateTableX |
gen_create_table_x |
StudioX 'Create Table' - convert a sheet range into a named Excel table (ListObject). | User wants a structured named table over a range so other StudioX activities can reference it by name. |
DeleteColumnX |
gen_delete_column_x |
StudioX 'Delete Column' - remove one or more columns from a sheet or table. | User wants to drop columns. To clear cell values without deleting columns use ClearRangeX. |
DeleteRowsX |
gen_delete_rows_x |
StudioX 'Delete Rows' - remove one or more rows from a sheet or table. | User wants to drop rows. To clear cell values without deleting rows use ClearRangeX. |
DeleteSheetX |
gen_delete_sheet_x |
StudioX 'Delete Sheet' - delete a worksheet from the active workbook. | User wants to remove a worksheet. To rename use RenameSheetX; to add use InsertSheetX. |
DuplicateSheetX |
gen_duplicate_sheet_x |
StudioX 'Duplicate Sheet' - copy an existing worksheet to a new sheet in the same workbook. | User wants a copy of an existing sheet (template duplication). To insert a blank sheet use InsertSheetX. |
ExcelAppendRange |
gen_excel_append_range |
Classic 'Append Range' - append a DataTable to an existing sheet inside an ExcelApplicationScope. | User wants to append rows in classic Excel projects. For StudioX use AppendRangeX. |
ExcelApplicationScope |
gen_excel_application_scope |
Classic Excel Application Scope - open a workbook and run nested classic Excel activities against it. | User wants the classic Excel container with explicit Open/Save semantics. For StudioX use ExcelApplicationCard (wizard-only). |
ExcelAutoFillRange |
gen_excel_auto_fill_range |
Classic 'Auto Fill Range' - extend a formula or value across a destination range. | User wants drag-fill in a classic project. For StudioX use AutoFillX. |
ExcelCloseWorkbook |
gen_excel_close_workbook |
Classic 'Close Workbook' - close the workbook of the surrounding ExcelApplicationScope. | User wants explicit close semantics in classic projects. |
ExcelCopyPasteRange |
gen_excel_copy_paste_range |
Classic 'Copy/Paste Range' - copy a range to a destination with paste-special options. | User wants copy-paste in a classic project. For StudioX use CopyPasteRangeX. |
ExcelCopySheet |
gen_excel_copy_sheet |
Classic 'Copy Sheet' - copy a worksheet to another workbook or position. | User wants to clone a sheet in classic projects. For StudioX use DuplicateSheetX. |
ExcelCreatePivotTable |
gen_excel_create_pivot_table |
Classic 'Create Pivot Table' - create a PivotTable bound to a source range. | User wants a PivotTable in classic projects. For StudioX use CreatePivotTableX or CreatePivotTableXv2. |
ExcelCreateTable |
gen_excel_create_table |
Classic 'Create Table' - convert a range into a named Excel table. | User wants a structured table in classic projects. For StudioX use CreateTableX. |
ExcelDeleteColumn |
gen_excel_delete_column |
Classic 'Delete Column' - remove a column from a sheet. | User wants to drop columns in classic projects. For StudioX use DeleteColumnX. |
ExcelDeleteRange |
gen_excel_delete_range |
Classic 'Delete Range' - delete a range of cells, shifting neighbouring cells. | User wants to remove a sub-range and shift cells. To clear values use ClearRangeX. |
ExcelFilterTable |
gen_excel_filter_table |
Classic 'Filter Table' - apply or clear an AutoFilter on a named table. | User wants table filtering in classic projects. For StudioX use FilterX. |
ExcelForEachRow |
gen_excel_for_each_row |
Classic 'For Each Row in Excel' - iterate the rows of a sheet/range from a classic Excel scope. | User wants row iteration in classic projects. For DataTable iteration use ForEachRow; for StudioX use ExcelForEachRowX (wizard-only). |
ExcelGetCellColor |
gen_excel_get_cell_color |
Classic 'Get Cell Color' - read the background colour of a cell into a Color variable. | User needs the cell's colour value. For StudioX use GetCellColorX. |
ExcelGetSelectedRange |
gen_excel_get_selected_range |
Classic 'Get Selected Range' - read the currently selected range address into a string. | User wants the user's current Excel selection. For StudioX use GetSelectedRangeX. |
ExcelGetTableRange |
gen_excel_get_table_range |
Classic 'Get Table Range' - return the address of a named Excel table. | User needs the address (e.g. A1:D20) of a named table for downstream activities. |
ExcelGetWorkbookSheet |
gen_excel_get_workbook_sheet |
Classic 'Get Workbook Sheet' - return a worksheet by name or index from a workbook. | User wants a sheet handle. For all sheet names use ExcelGetWorkbookSheets / GetSheets. |
ExcelGetWorkbookSheets |
gen_excel_get_workbook_sheets |
Classic 'Get Workbook Sheets' - list the sheet names of the active workbook. | User wants every sheet name for iteration or display. For StudioX use GetSheets. |
ExcelInsertColumn |
gen_excel_insert_column |
Classic 'Insert Column' - insert a column at a given position. | User wants to add a column in classic projects. For StudioX use InsertColumnX. |
ExcelInsertDeleteColumns |
gen_excel_insert_delete_columns |
Classic 'Insert/Delete Columns' - insert or delete N columns in one call. | User wants to add or drop multiple columns at once. |
ExcelInsertDeleteRows |
gen_excel_insert_delete_rows |
Classic 'Insert/Delete Rows' - insert or delete N rows in one call. | User wants to add or drop multiple rows at once. |
ExcelLookUpRange |
gen_excel_look_up_range |
Classic 'Lookup Range' - find the address of a cell containing a given value within a range. | User wants the cell address that holds a value. For VLOOKUP-style data lookup use VLookupX. |
ExcelReadCell |
gen_excel_read_cell |
Classic 'Read Cell' - read a single cell value into a string. | User wants one cell's value in classic projects. For StudioX use ReadCellValueX or ReadCell. |
ExcelReadCellFormula |
gen_excel_read_cell_formula |
Classic 'Read Cell Formula' - read the underlying formula text of a cell. | User wants the formula (=SUM(A1:A10)) rather than its evaluated value. For value use ExcelReadCell. |
ExcelReadColumn |
gen_excel_read_column |
Classic 'Read Column' - read a single column starting at a cell into an IEnumerable<object>. | User wants one column of data without building a DataTable. |
ExcelReadRange |
gen_excel_read_range |
Classic 'Read Range' - read a worksheet range into a DataTable from a classic Excel scope. | User wants to read into a DataTable in classic projects. For StudioX use ReadRangeX. |
ExcelReadRow |
gen_excel_read_row |
Classic 'Read Row' - read a single row starting at a cell into an IEnumerable<object>. | User wants one row of data without building a DataTable. |
ExcelRefreshPivotTable |
gen_excel_refresh_pivot_table |
Classic 'Refresh Pivot Table' - refresh a PivotTable after its source data changes. | User wants to refresh a PivotTable in classic projects. For StudioX use RefreshPivotTableX. |
ExcelRemoveDuplicatesRange |
gen_excel_remove_duplicates_range |
Classic 'Remove Duplicates' - remove duplicate rows from a sheet range. | User wants Excel to dedupe rows. For DataTable dedupe use RemoveDuplicateRows. |
ExcelSaveWorkbook |
gen_excel_save_workbook |
Classic 'Save Workbook' - save the workbook of the surrounding ExcelApplicationScope. | User wants to persist changes in classic projects. |
ExcelSelectRange |
gen_excel_select_range |
Classic 'Select Range' - select a range so subsequent activities act on the user's selection. | User wants to set the active selection in classic projects. For StudioX use SelectRangeX. |
ExcelSetRangeColor |
gen_excel_set_range_color |
Classic 'Set Range Color' - set the background colour of cells in a range. | User wants to colour cells in classic projects. For StudioX use FormatRangeX. |
ExcelSortTable |
gen_excel_sort_table |
Classic 'Sort Table' - sort a named Excel table by one or more columns. | User wants table sorting in classic projects. For StudioX use SortX. |
ExcelWriteCell |
gen_excel_write_cell |
Classic 'Write Cell' - write a value or formula into a single cell. | User wants to set one cell in classic projects. For StudioX use WriteCellX. |
ExcelWriteRange |
gen_excel_write_range |
Classic 'Write Range' - write a DataTable into a worksheet range from a classic Excel scope. | User wants to write a DataTable in classic projects. For StudioX use WriteRangeX; to append use ExcelAppendRange / AppendRangeX. |
ExecuteMacro |
gen_execute_macro |
Classic 'Execute Macro' - run a VBA macro defined in the active workbook with optional parameters. | User wants to invoke an existing VBA macro. For StudioX use ExecuteMacroX. To run inline VBA code use InvokeVBA / InvokeVBAX. |
ExecuteMacroX |
gen_execute_macro_x |
StudioX 'Run Macro' - run a VBA macro defined in the active workbook with optional parameters. | User wants to invoke an existing VBA macro in a StudioX project. For inline VBA code use InvokeVBAX. |
ExportExcelToCsvX |
gen_export_excel_to_csv_x |
StudioX 'Export to CSV' - export a sheet of the active workbook to a CSV file. | User wants a CSV from an Excel sheet directly. For DataTable -> CSV use WriteCsvFile. |
FillRangeX |
gen_fill_range_x |
StudioX 'Fill Range' - fill a range with a value or formula. | User wants every cell in a range set to the same value/formula. For drag-fill behaviour use AutoFillX. |
FilterPivotTableX |
FilterPivotTableX (data-driven) |
StudioX 'Filter Pivot Table' - apply or clear filters on a PivotTable's pivot fields. | User wants to filter a PivotTable. For ordinary range/table filtering use FilterX. |
FilterX |
FilterX (data-driven) |
StudioX 'Filter' - apply or clear an AutoFilter on a sheet range or table. | User wants AutoFilter applied to a range/table. For PivotTable filtering use FilterPivotTableX; for classic projects use ExcelFilterTable. |
FindFirstLastDataRowX |
gen_find_first_last_data_row_x |
StudioX activity that returns the first/last data row index in a sheet or table. | User wants to compute where data starts/ends so they can append correctly. |
FindReplaceValueX |
gen_find_replace_value_x |
StudioX 'Find/Replace Value' - search and replace values across a sheet, table, or range. | User wants Excel-native find/replace. For DataTable-side replace use FindAndReplace. |
FormatRangeX |
gen_format_range_x |
StudioX 'Format Range' - set font, alignment, borders, fill, and number format on a range. | User wants comprehensive cell formatting (not just colour). For colour-only use SetRangeColor / ExcelSetRangeColor. |
GetCellColor |
gen_get_cell_color |
Modern 'Get Cell Color' - read the background colour of a cell. | User wants the cell's colour value in modern projects. For classic use ExcelGetCellColor; for StudioX use GetCellColorX. |
GetCellColorX |
gen_get_cell_color_x |
StudioX 'Get Cell Color' - read the background colour of a cell. | User wants the cell's colour value in StudioX. For classic use ExcelGetCellColor. |
GetSelectedRangeX |
gen_get_selected_range_x |
StudioX 'Get Selected Range' - read the currently selected range address into a string. | User wants the user's current Excel selection in StudioX. For classic use ExcelGetSelectedRange. |
GetSensitivityLabelX |
gen_get_sensitivity_label_x |
StudioX activity that reads the current Microsoft 365 sensitivity label of the active workbook. | User wants to read the workbook's sensitivity label. To set/replace one use AddSensitivityLabelX. |
GetSheets |
gen_get_sheets |
List the sheet names of the active workbook in StudioX/modern Excel. | User wants every sheet name for iteration. For classic use ExcelGetWorkbookSheets. |
GetTableRange |
gen_get_table_range |
Return the address (e.g. A1:D20) of a named Excel table. | User needs a table's range address for downstream activities. |
InsertColumnX |
gen_insert_column_x |
StudioX 'Insert Column' - insert a new column into a sheet or table. | User wants to add a column in StudioX. For classic use ExcelInsertColumn. |
InsertExcelChartX |
InsertExcelChartX (data-driven) |
StudioX 'Insert Chart' - insert a chart of a chosen type bound to a sheet range. | User wants to add a new chart in a StudioX Excel project. To modify an existing chart use UpdateChartX (wizard-only). |
InsertRowsX |
gen_insert_rows_x |
StudioX 'Insert Rows' - insert one or more rows into a sheet or table. | User wants to add rows at a position in StudioX. |
InsertSheetX |
gen_insert_sheet_x |
StudioX 'Insert Sheet' - add a new worksheet to the active workbook. | User wants to add a new sheet. To clone an existing sheet use DuplicateSheetX. |
InvokeVBA |
gen_invoke_vba |
Run inline VBA code against the active workbook (classic Excel projects). | User wants to execute custom VBA without saving a macro first. For StudioX use InvokeVBAX; for an existing macro use ExecuteMacro. |
InvokeVBAX |
gen_invoke_vbax |
Run inline VBA code against the active workbook (StudioX Excel projects). | User wants to execute custom VBA inline in StudioX. For an existing named macro use ExecuteMacroX. |
LookupX |
gen_lookup_x |
StudioX 'Lookup' - find a value in a range and return the corresponding cell address. | User wants the address of a found value. For VLOOKUP-style data return use VLookupX. |
MatchFunctionX |
gen_match_function_x |
StudioX 'Match' - return the position (index) of a value within a range. | User wants the relative index of a matched value (Excel MATCH semantics). |
OpenWorkbook |
gen_open_workbook |
Open an existing .xlsx workbook on disk and return a workbook variable. | User wants to load an existing workbook. To create a new one use CreateNewWorkbook; to use a scope-style container use ExcelApplicationScope or ExcelApplicationCard. |
ProtectSheetX |
gen_protect_sheet_x |
StudioX 'Protect Sheet' - apply password protection to a worksheet. | User wants to lock a sheet against edits. To remove protection use UnprotectSheetX. |
ReadCell |
gen_read_cell |
Modern 'Read Cell' - read a single cell value (string) using the active Excel scope. | User wants a single cell's text in modern Excel. For typed value use ReadCellValueX; for formula use ReadCellFormulaX. |
ReadCellFormula |
gen_read_cell_formula |
Modern 'Read Cell Formula' - read the formula text of a cell. | User wants the formula not the result. For just the value use ReadCell or ReadCellValueX. |
ReadCellFormulaX |
gen_read_cell_formula_x |
StudioX 'Read Cell Formula' - read the formula text of a cell. | User wants the formula (=SUM(A1:A10)) rather than its evaluated value. For just the value use ReadCellValueX or ReadCell. |
ReadCellValueX |
gen_read_cell_value_x |
StudioX 'Read Cell Value' - read a single cell value (typed) using the active Excel scope. | User wants one cell's typed value in StudioX. For string-only use ReadCell; for formula text use ReadCellFormulaX. |
ReadColumn |
gen_read_column |
Modern 'Read Column' - read one column of values into an IEnumerable<object>. | User wants a single column of data. For a row use ReadRow; for full range use ReadRangeX. |
ReadRangeX |
ReadRangeX (data-driven) |
StudioX 'Read Range' - read a worksheet range into a DataTable using the active Excel scope. | User wants to read a sheet/range into a DataTable in a modern (StudioX) Excel project. For classic projects use ExcelReadRange; for a single cell use ReadCellValueX or ExcelReadCell. |
ReadRow |
gen_read_row |
Modern 'Read Row' - read one row of values into an IEnumerable<object>. | User wants a single row. For a column use ReadColumn; for a full range use ReadRangeX. |
RefreshDataConnectionsX |
gen_refresh_data_connections_x |
StudioX activity that refreshes all (or named) data connections in the active workbook. | User wants to pull fresh data from external connections (Power Query, ODBC). For PivotTables alone use RefreshPivotTableX. |
RefreshPivotTableX |
gen_refresh_pivot_table_x |
StudioX 'Refresh Pivot Table' - refresh a PivotTable after its source data changes. | User wants to refresh a single PivotTable. For all data connections use RefreshDataConnectionsX. |
RemoveDuplicatesX |
gen_remove_duplicates_x |
StudioX 'Remove Duplicates' - remove duplicate rows from a sheet range or table. | User wants in-place dedupe in StudioX. For classic use ExcelRemoveDuplicatesRange; for DataTable dedupe use RemoveDuplicateRows. |
RenameSheetX |
gen_rename_sheet_x |
StudioX 'Rename Sheet' - rename an existing worksheet. | User wants to rename a sheet in StudioX. |
SaveAsPdfX |
gen_save_as_pdf_x |
StudioX 'Save as PDF' - export the workbook (or a sheet/range) to a PDF file. | User wants a PDF output of an Excel file. To save as a different Excel file use SaveExcelFileAsX. |
SaveExcelFileAsX |
gen_save_excel_file_as_x |
StudioX 'Save Excel File As' - save the active workbook to a new path. | User wants to save under a different filename or folder. For in-place save use SaveExcelFileX. |
SaveExcelFileX |
gen_save_excel_file_x |
StudioX 'Save Excel File' - save the active workbook to its existing path. | User wants to persist changes in place. To save as a new file use SaveExcelFileAsX. |
SelectRangeX |
gen_select_range_x |
StudioX 'Select Range' - set the active selection in a sheet so subsequent activities act on it. | User wants to mark a range as the active selection. |
SequenceX |
gen_sequence_x |
StudioX Sequence container that groups Excel-related child activities under a logical step. | User wants to group StudioX Excel steps in a labelled container. |
SetRangeColor |
gen_set_range_color |
Modern 'Set Range Color' - set the background colour of cells in a range. | User wants to colour cells in modern projects. For wider formatting use FormatRangeX. |
SortX |
gen_sort_x |
StudioX 'Sort' - sort a sheet range or table by one or more columns. | User wants Excel-side sorting. For classic table sort use ExcelSortTable. |
TextToColumnsX |
gen_text_to_columns_x |
StudioX 'Text to Columns' - split a column by a delimiter into multiple columns. | User wants Excel's Text-to-Columns feature applied to a range. |
UnprotectSheetX |
gen_unprotect_sheet_x |
StudioX 'Unprotect Sheet' - remove password protection from a worksheet. | User wants to unlock a previously protected sheet. To protect use ProtectSheetX. |
VLookupX |
gen_v_lookup_x |
StudioX 'VLookup' - perform an Excel-style VLOOKUP against a range and return the matched value. | User wants VLOOKUP semantics. For arbitrary cell-address lookup use ExcelLookUpRange / LookupX; for general matching use MatchFunctionX. |
WithWorkbook |
gen_with_workbook |
Project Notebook scope that opens a workbook and runs nested activities against it (StudioX project notebook). | User is using the StudioX Project Notebook pattern and wants the implicit workbook scope. |
WriteCellX |
gen_write_cell_x |
StudioX 'Write Cell' - write a value or formula into a single cell. | User wants to set one cell in StudioX. For classic use ExcelWriteCell. |
WriteCsvFile |
gen_write_csv_file |
Write a DataTable to a CSV file (overwriting any existing file). | User wants a CSV from a DataTable. To grow an existing CSV use AppendCsvFile. |
WriteRangeX |
WriteRangeX (data-driven) |
StudioX 'Write Range' - write a DataTable into a worksheet range using the active Excel scope. | User wants to push a DataTable into a sheet in StudioX. For appending instead of overwriting use AppendRangeX; for classic projects use ExcelWriteRange. |
Email (38)
| Activity | Generator | Description | Use when |
|---|---|---|---|
ArchiveMailX |
gen_archive_mail_x |
StudioX activity that moves an email to the configured Archive folder of the active mail account. | User wants the StudioX 'Archive Email' button equivalent. For arbitrary moves use MoveOutlookMessage / MoveMessageToFolder. |
CreateDraft |
gen_create_draft |
Create a draft email in the chosen mail account without sending it. | User wants to stage an email for human review or later send. To send immediately use SendOutlookMail / SendExchangeMail / SendMailX. |
CreateHtmlContent |
gen_create_html_content |
Build an HTML body string from a template and variables for use as an email body. | User wants to compose a templated HTML email body before sending. Pair with SendOutlookMail / SendMailX. |
DeleteImapMailMessage |
gen_delete_imap_mail_message |
Delete a MailMessage from an IMAP server. | User wants to remove a message via IMAP. For Outlook use DeleteOutlookMailMessage; for Exchange use DeleteMail; for Lotus Notes use DeleteLotusNotesMailMessage. |
DeleteLotusNotesMailMessage |
gen_delete_lotus_notes_mail_message |
Delete a MailMessage from an IBM/HCL Lotus Notes mailbox. | User automates Lotus Notes mail and wants to delete a message. For other providers use DeleteImapMailMessage / DeleteOutlookMailMessage / DeleteMail. |
DeleteMail |
gen_delete_mail |
Delete a MailMessage through Exchange (EWS) using the active scope. | User wants to delete an Exchange message inside an ExchangeScope. For Outlook desktop use DeleteOutlookMailMessage; for IMAP use DeleteImapMailMessage. |
DeleteMailX |
gen_delete_mail_x |
StudioX 'Delete Email' activity for the active mail account. | User wants the StudioX delete-email button equivalent. For provider-specific calls use DeleteOutlookMailMessage / DeleteImapMailMessage / DeleteMail. |
DeleteOutlookMailMessage |
gen_delete_outlook_mail_message |
Delete a MailMessage from the local desktop Outlook profile. | User wants to delete a message in desktop Outlook. For IMAP use DeleteImapMailMessage; for Exchange use DeleteMail. |
ExchangeScope |
gen_exchange_scope |
Connect to Exchange Web Services (EWS) and run nested Exchange mail activities under that connection. | User wants EWS-based mail automation in a single scope. For Microsoft 365 Graph use the plugin scope; for desktop Outlook none - use the activities directly. |
ForwardMailX |
gen_forward_mail_x |
StudioX 'Forward Email' activity for the active mail account. | User wants to forward the current StudioX email. For provider-specific forwarding use the underlying Outlook/Exchange activities. |
GetEmailById |
gen_get_email_by_id |
Fetch a single mail message by its provider-specific identifier. | User already knows the message ID (e.g. from a trigger) and wants the full MailMessage. For folder enumeration use the provider's GetMail activity. |
GetExchangeMailMessages |
gen_get_exchange_mail_messages |
Read mail messages from an Exchange folder via Exchange Web Services (EWS). | User automates Exchange via EWS and wants to fetch messages. For desktop Outlook use GetOutlookMailMessages; for IMAP use GetPOP3MailMessages or an IMAP variant. |
GetLotusNotesMailMessages |
gen_get_lotus_notes_mail_messages |
Read mail messages from an IBM/HCL Lotus Notes mailbox. | User automates Lotus Notes mail. For other providers use GetOutlookMailMessages / GetExchangeMailMessages / GetPOP3MailMessages. |
GetMailMessageFromFile |
gen_get_mail_message_from_file |
Load a saved .eml or .msg file from disk into a MailMessage variable. | User has previously saved an email to disk and wants to re-load it for processing. To save use SaveMail / SaveMailX. |
GetOutlookMailMessages |
GetOutlookMailMessages (data-driven) |
Read mail messages from a desktop Outlook folder using the local Outlook profile. | User has Outlook installed and wants to fetch messages from a local mailbox folder. For Exchange Web Services use GetExchangeMailMessages; for Microsoft 365 Graph use plugin activities. |
GetPOP3MailMessages |
gen_get_pop3_mail_messages |
Read mail messages from a POP3 server. | User must use POP3 (legacy). Prefer IMAP or Exchange where available; use GetExchangeMailMessages or GetOutlookMailMessages instead. |
MarkMailAsReadX |
gen_mark_mail_as_read_x |
StudioX 'Mark Email as Read' activity for the active mail account. | User wants the StudioX mark-as-read button equivalent. For provider-specific control use MarkOutlookMailAsRead. |
MarkOutlookMailAsRead |
gen_mark_outlook_mail_as_read |
Mark a desktop Outlook MailMessage as read or unread. | User wants to flip the read flag on an Outlook message. For StudioX use MarkMailAsReadX. |
MoveIMAPMailMessageToFolder |
gen_move_imap_mail_message_to_folder |
Move a MailMessage to another folder on an IMAP server. | User automates IMAP and wants to file a message. For Outlook use MoveOutlookMessage; for Exchange use MoveMessageToFolder; for StudioX use MoveMailX. |
MoveLotusNotesMailMessage |
gen_move_lotus_notes_mail_message |
Move a Lotus Notes MailMessage to another mailbox folder. | User automates Lotus Notes and wants to file a message. |
MoveMailX |
gen_move_mail_x |
StudioX 'Move Email' activity for the active mail account. | User wants the StudioX move-email button equivalent. For provider-specific calls use MoveOutlookMessage / MoveIMAPMailMessageToFolder / MoveMessageToFolder. |
MoveMessageToFolder |
gen_move_message_to_folder |
Move an Exchange MailMessage to another folder via EWS inside an ExchangeScope. | User automates Exchange via EWS. For Outlook use MoveOutlookMessage; for IMAP use MoveIMAPMailMessageToFolder. |
MoveOutlookMessage |
MoveOutlookMessage (data-driven) |
Move a desktop Outlook MailMessage to another folder in the same store. | User wants to file an Outlook message to another folder (Archive, Done). For IMAP use MoveIMAPMailMessageToFolder; for Exchange use MoveMessageToFolder. |
NewIMAPEmailReceivedTrigger |
gen_new_imap_email_received_trigger |
Trigger that fires when a new email arrives on an IMAP server. | User wants an event-driven workflow that reacts to new IMAP mail. For Outlook event triggers use OutlookMailMessagesTrigger. |
OutlookMailMessagesTrigger |
gen_outlook_mail_messages_trigger |
Trigger that fires when a new email arrives in a desktop Outlook folder. | User wants an event-driven workflow that reacts to new Outlook mail. For IMAP use NewIMAPEmailReceivedTrigger. |
ReplyToMailX |
gen_reply_to_mail_x |
StudioX 'Reply to Email' activity for the active mail account. | User wants the StudioX reply button equivalent. For provider-specific replies use ReplyToOutlookMailMessage. |
ReplyToOutlookMailMessage |
gen_reply_to_outlook_mail_message |
Reply (or Reply All) to a desktop Outlook MailMessage with new body and optional attachments. | User wants to compose a reply to an Outlook message. For Exchange/IMAP, reply via the underlying provider's send activity with appropriate headers. |
SaveExchangeAttachements |
gen_save_exchange_attachements |
Save all attachments from an Exchange MailMessage to a folder on disk. | User wants to extract attachments from an Exchange message. For other providers use SaveMailAttachmentsX. |
SaveMail |
gen_save_mail |
Save a MailMessage to disk as an .eml/.msg file. | User wants to persist an email for archival or later re-import. For attachments only use SaveMailAttachmentsX; to re-load use GetMailMessageFromFile. |
SaveMailAttachmentsX |
gen_save_mail_attachments_x |
StudioX activity that saves all attachments of the current email to a folder. | User wants the StudioX 'Save Attachments' button equivalent. For Exchange specifically use SaveExchangeAttachements. |
SaveMailX |
gen_save_mail_x |
StudioX 'Save Email' activity that writes the current email to disk. | User wants the StudioX save-email button equivalent. For provider-agnostic saving use SaveMail. |
SaveOutlookMailMessage |
gen_save_outlook_mail_message |
Save a desktop Outlook MailMessage to disk as a .msg file. | User wants to persist an Outlook message in native .msg format. For provider-agnostic .eml use SaveMail. |
SendCalendarInviteX |
gen_send_calendar_invite_x |
StudioX activity that sends a calendar invitation through the active mail account. | User wants to send a meeting invite, not a plain email. For ordinary mail use SendOutlookMail / SendMailX. |
SendExchangeMail |
gen_send_exchange_mail |
Send an email through Exchange Web Services (EWS) inside an ExchangeScope. | User wants to send via EWS. For desktop Outlook use SendOutlookMail; for SMTP use SendMailX. |
SendLotusNotesMailMessage |
gen_send_lotus_notes_mail_message |
Send an email through an IBM/HCL Lotus Notes session. | User automates Lotus Notes outbound mail. |
SendMailX |
gen_send_mail_x |
Send an email via SMTP (configurable host/port/credentials). | User wants to send through a generic SMTP server (Gmail SMTP, custom relay). For Outlook use SendOutlookMail; for Exchange use SendExchangeMail. |
SendOutlookMail |
SendOutlookMail (data-driven) |
Send an email through the local desktop Outlook profile. | User has Outlook installed and wants to send through that profile. For Exchange use SendExchangeMail; for SMTP/Gmail use SendMailX. |
SetOutlookMailCategories |
gen_set_outlook_mail_categories |
Apply or replace one or more Outlook category labels on a desktop Outlook MailMessage. | User wants to tag an Outlook message with category colours/labels. |
File system (9)
| Activity | Generator | Description | Use when |
|---|---|---|---|
AppendWriteCsvFile |
gen_write_csv |
Write or append a DataTable to a delimited file (CSV / TSV) with configurable delimiter, headers, and quoting. | You have a DataTable to persist as CSV / TSV (one-shot write or row-append). Use WriteTextFile when the payload is unstructured text; use ReadCsvFile to load a CSV back into a DataTable. |
CopyFile |
gen_copy_file |
Copy a file from a source path to a destination path, optionally overwriting an existing target. | You want a duplicate of a file at a new location and need the original to remain in place. Use MoveFile when the source should be removed after the transfer. |
CreateDirectory |
gen_create_directory |
Create a directory at the given path, including any missing parent directories; succeeds silently if the folder already exists. | You need an output / archive folder to exist before writing files into it. Use PathExists when you only want to test for a folder, not ensure one. |
DeleteFileX |
gen_delete_file |
Permanently delete the file at the given path; raises if the path does not exist. | You want to remove a file from disk after processing. Use PathExists first when the path may not exist and you do not want an exception; use MoveFile when the file should be archived rather than discarded. |
MoveFile |
gen_move_file |
Move a file from a source path to a destination path, optionally overwriting an existing target; the source no longer exists after the call. | You want to relocate a file (e.g. archive a processed item) and the source path should be empty afterwards. Use CopyFile when the source must remain in place. |
PathExists |
gen_path_exists |
Check whether a file or folder exists at the given path and write the boolean result to a variable. | You want to branch on a path's presence before deleting, copying, or reading it. Use CreateDirectory when the goal is to ensure a folder exists rather than just test for it. |
ReadCsvFile |
gen_read_csv |
Parse a delimited CSV / TSV file from disk into a DataTable, optionally treating the first row as headers. | The file is column-oriented data (CSV, TSV, pipe-delimited) you want as a DataTable for ForEachRow / DataTable activities. Use ReadTextFile for unstructured text; use AppendWriteCsvFile to write a DataTable back out. |
ReadTextFile |
gen_read_text_file |
Read the entire contents of a text file into a string variable. | You want raw text (config, template, log) handed back as one string. Use ReadCsvFile when the file is delimited and should be parsed into a DataTable; use WriteTextFile to push text the other direction. |
WriteTextFile |
gen_write_text_file |
Write a string variable to a text file at the given path, overwriting any existing file. | You have generated text (a report, config, JSON payload as text) and want it persisted as a single file. Use AppendWriteCsvFile when the data is tabular and should be written column-aware; use ReadTextFile to load text the other direction. |
HTTP & JSON (11)
| Activity | Generator | Description | Use when |
|---|---|---|---|
DeserializeJson |
gen_deserialize_json |
Parses a JSON object string into a JObject for property access via VB expressions. | User has a JSON object and wants typed access to its fields; for JSON arrays use DeserializeJsonArray; for outbound serialization use SerializeJson. |
DeserializeJson1` |
gen_deserialize_json |
Parses a JSON object string into a JObject for property access via VB expressions. | User has a JSON object and wants typed access to its fields; for JSON arrays use DeserializeJsonArray; for outbound serialization use SerializeJson. |
DeserializeJsonArray |
DeserializeJsonArray (data-driven) |
Parses a JSON array string into a JArray for iteration with ForEach<JToken>. | User has a JSON array and wants to iterate elements; for JSON objects use DeserializeJson. |
DeserializeXml |
DeserializeXml (data-driven) |
Parses an XML document string into an XDocument for LINQ to XML access. | User has XML text and wants to query nodes via XPath/LINQ; for XPath-only queries use ExecuteXPath; for HTML scraping prefer browser activities. |
ExecuteXPath |
ExecuteXPath (data-driven) |
Runs an XPath query against an XDocument and returns the matching node value. | User has XML and wants a single node value via XPath; for multi-node sets use GetNodes. |
GetNodes |
GetNodes (data-driven) |
Returns the list of XElement nodes matching an XPath expression against an XDocument. | User wants every matching XML node; for a single value use ExecuteXPath; for attribute values use GetXMLNodeAttributes. |
GetXMLNodeAttributes |
GetXMLNodeAttributes (data-driven) |
Returns the attribute values of the XML nodes matching an XPath expression. | User wants attribute values from XML nodes; for the node text content use GetNodes. |
GetXMLNodes |
GetXMLNodes (data-driven) |
Alias of GetNodes for legacy spec compatibility — returns matching XElement nodes. | User wrote an older spec referencing GetXMLNodes; new specs should use GetNodes. |
HttpClient |
HttpClient (data-driven) |
Legacy WebAPI HTTP client scope from UiPath.WebAPI.Activities; performs request with cookie / connection persistence inside the scope body. | User has an existing WebAPI workflow that uses HttpClient; for new work prefer NetHttpRequest from UiPath.WebAPI.Activities (supports OAuth and modern auth). |
NetHttpRequest |
gen_net_http_request |
Performs an HTTP request to a REST endpoint with configurable method, headers, body, and OAuth/Basic auth. | User wants to call a REST API from a workflow; for SOAP/XPath responses also see ExecuteXPath; for the legacy WebAPI scope use HttpClient. |
SerializeJson |
SerializeJson (data-driven) |
Serializes a JObject / dictionary / typed object into a JSON string. | User wants to produce a JSON payload to send to a REST API; for parsing inbound JSON use DeserializeJson / DeserializeJsonArray. |
Dialogs (2)
| Activity | Generator | Description | Use when |
|---|---|---|---|
InputDialog |
gen_input_dialog |
Show an interactive prompt that asks the user for a string (or one of a fixed set of options) and returns the response. | An attended workflow needs a value supplied by the human at runtime (free text, password, or a dropdown choice). Use MessageBox when you only need to display information without collecting input; use orchestrator forms / Action Center when… |
MessageBox |
gen_message_box |
Display a modal message box to the attended user and block the workflow until they dismiss it. | An attended workflow needs to surface information or pause for confirmation. Prefer LogMessage for unattended logging that should not interrupt execution; use InputDialog when you actually need a typed response back. |
Error handling & retry (4)
| Activity | Generator | Description | Use when |
|---|---|---|---|
Rethrow |
gen_rethrow |
Re-emit the exception that the enclosing TryCatch is currently handling, preserving its original type and stack. | You are inside a Catch and want to do partial work (logging, cleanup) before letting the same exception bubble up unchanged. Use Throw when you want to raise a different / new exception instead. |
RetryScope |
gen_retryscope |
Run the body and re-execute it up to N times when it fails or its condition stays unmet, then surface the final exception. | The activity inside is calling something flaky (network call, slow UI, eventual-consistency lookup) where the right response to a transient failure is just to try again. Use TryCatch when the failure has a meaningful alternative code path;… |
Throw |
gen_throw |
Raise a new exception built from a VB expression, aborting the current branch with a typed reason. | A business-rule violation or unrecoverable condition must stop execution and surface a specific exception type to the caller. Use Rethrow when you want to re-emit the exception that the surrounding TryCatch already caught; use TryCatch whe… |
TryCatch |
gen_try_catch |
Run a Try block and route any exception to one of several typed Catch handlers, with an optional Finally block that always executes. | An expected exception type has a meaningful recovery path (log, fall back, swallow) that should keep the workflow running. Use RetryScope when the failure is a transient external glitch you simply want to retry; use Throw when you want to … |
Invoke (workflow / code) (3)
| Activity | Generator | Description | Use when |
|---|---|---|---|
InvokeCode |
gen_invoke_code |
Executes an inline VB.NET or C# code block with read/write access to declared In/Out arguments. | User wants a short fragment of imperative code without authoring a full subworkflow; for shared subroutines use InvokeWorkflowFile; for calling existing CLR methods use InvokeMethod. |
InvokeMethod |
gen_invoke_method |
Reflectively calls a static or instance method on a CLR object, passing parameters and capturing the return value. | User wants to call a single .NET method (e.g. String.Format, list.Add) without writing a full code block; for multi-statement logic use InvokeCode; for subworkflow reuse use InvokeWorkflowFile. |
InvokeWorkflowFile |
gen_invoke_workflow |
Invokes a separate .xaml workflow file as a subroutine, marshalling InArgument/OutArgument values across the boundary. | User wants to call a reusable subworkflow stored on disk; for inline business logic in a single language use InvokeCode; for reflective static/instance method calls use InvokeMethod. |
Orchestrator (5)
| Activity | Generator | Description | Use when |
|---|---|---|---|
AddQueueItem |
gen_add_queue_item |
Enqueues a single transaction item into an Orchestrator queue, optionally with reference, deadline, priority, and SpecificContent. | User wants to push one item to a queue from a dispatcher; for many items in a batch use BulkAddQueueItems to avoid per-item HTTP overhead. |
BulkAddQueueItems |
gen_bulk_add_queue_items |
Enqueues multiple transaction items in a single Orchestrator request from a list of SpecificContent dictionaries. | User wants to push many items at once (faster than looping AddQueueItem); for a single item use AddQueueItem. |
GetQueueItem |
gen_get_queue_item |
Pops the next available queue item from an Orchestrator queue and assigns it to a QueueItem variable. | User wants the next transaction in a Performer; for adding items use AddQueueItem; in REFramework use the built-in Get Transaction Data state instead of calling this directly. |
GetRobotAsset |
gen_get_robot_asset |
Reads a typed asset (text, integer, boolean, json) from Orchestrator and assigns its value to a local variable. | User wants a configuration value held centrally in Orchestrator; for username+password pairs use GetRobotCredential. |
GetRobotCredential |
gen_getrobotcredential |
Reads a credential asset from Orchestrator and outputs username + secure password into local variables. | User wants to retrieve a credential by asset name; for non-credential assets (text/int/bool/json) use GetRobotAsset. |
Logging & helpers (11)
| Activity | Generator | Description | Use when |
|---|---|---|---|
AddLogFields |
gen_add_log_fields |
Attaches structured key/value fields to every subsequent LogMessage call within the workflow scope. | User wants to enrich logs with correlation IDs / business keys for downstream filtering; remove with RemoveLogFields when scope ends. |
Break |
gen_break |
Exits the enclosing loop (ForEach / While / DoWhile) immediately. | User wants to terminate iteration once a condition is met; for skipping the rest of the current iteration only use Continue. |
Comment |
gen_comment |
Inserts an inline comment annotation in the workflow surface — no runtime effect. | User wants to document intent inline next to activities; for disabling a block of activities use CommentOut. |
CommentOut |
gen_comment_out |
Disables a block of activities at design-time without deleting them — they remain visible but are skipped at runtime. | User wants to temporarily disable activities while keeping them visible for context; for inline notes use Comment. |
Continue |
gen_continue |
Skips to the next iteration of the enclosing loop, bypassing remaining activities in the current iteration. | User wants to skip the rest of the current iteration; for terminating the loop entirely use Break. |
KillProcess |
gen_kill_process |
Forcibly terminates a Windows process by name or process object. | User wants to close a hung application that won't respond to graceful shutdown; for graceful close use NApplicationCard's CloseDialog action when available. |
LogMessage |
gen_logmessage |
Writes a message to the robot log at the chosen level (Trace/Info/Warn/Error/Fatal). | User wants to record progress or a diagnostic message; for permanent log enrichment use AddLogFields; for raising alerts use RaiseAlert. |
RemoveLogFields |
gen_remove_log_fields |
Removes previously-added structured log fields by key list. | User wants to clear log context attached by AddLogFields when leaving a scope. |
ShouldStop |
gen_should_stop |
Returns True if the user has requested the job to stop via Orchestrator's Stop button. | User wants to honor cooperative stop signals at safe checkpoints; long loops should check ShouldStop and exit cleanly. |
TakeScreenshotAndSave |
gen_take_screenshot_and_save |
Composite that captures a screenshot and persists it to the supplied path in one step. | User wants a quick capture-and-save in error handlers or evidence trails; for take-only into a variable use NTakeScreenshot then SaveImage. |
TerminateWorkflow |
gen_terminate_workflow |
Terminates the running workflow with a status (Successful / Faulted / Cancelled) and optional exception. | User wants to abort the workflow with a definitive outcome; for raising a recoverable exception use Throw inside a TryCatch. |
External integrations (24)
| Activity | Generator | Description | Use when |
|---|---|---|---|
AppendRange |
gen_append_range |
Classic Workbook 'Append Range' — append a DataTable below the existing data in a sheet without opening Excel. | User wants to add rows under existing data via the classic Workbook API. To overwrite from row 1 use WriteRange; for modern Excel (X) projects use AppendRangeX. |
BulkInsert |
BulkInsert (data-driven) |
Bulk-load every row of a DataTable into a target database table using the provider's bulk-copy API. | User has a DataTable whose schema matches an existing table and needs the fastest insert path. Requires a prior DatabaseConnect. For row-by-row inserts use ExecuteNonQuery; to update existing rows use BulkUpdate; to insert one DataTable th… |
BulkUpdate |
BulkUpdate (data-driven) |
Bulk-update existing rows in a target database table from a DataTable matched on primary key. | User has a DataTable whose rows already exist in the target table and need their non-key columns refreshed. Requires a prior DatabaseConnect. To insert new rows use BulkInsert. |
DatabaseConnect |
gen_database_connect |
Open a database connection from a connection string and return a DatabaseConnection variable for reuse. | User wants to share one connection across multiple subsequent ExecuteQuery / ExecuteNonQuery / BulkInsert / DatabaseTransaction calls. Always pair with DatabaseDisconnect; for one-off queries skip this and pass the connection string direct… |
DatabaseDisconnect |
DatabaseDisconnect (data-driven) |
Close a previously opened DatabaseConnection and release its underlying resources. | User wants to release a connection opened by DatabaseConnect (typically in a Finally block). To open the connection use DatabaseConnect. |
DatabaseTransaction |
DatabaseTransaction (data-driven) |
Scope that runs nested database activities inside a single transaction (commit on success, rollback on error). | User wants several ExecuteNonQuery / ExecuteQuery / BulkInsert calls to commit or roll back atomically. For one-off statements skip the transaction wrapper. |
ExecuteNonQuery |
gen_execute_non_query |
Run a SQL statement that does not return rows (INSERT/UPDATE/DELETE/DDL) and return the affected-row count. | User wants to mutate the database (insert/update/delete) or run DDL. For SELECT use ExecuteQuery; for batched loads use BulkInsert; to wrap several statements atomically use DatabaseTransaction. |
ExecuteQuery |
gen_execute_query |
Run a SELECT query against a database and return the rows as a DataTable. | User wants result rows from a SQL SELECT (or any query that returns a row set). For INSERT/UPDATE/DELETE without a result set use ExecuteNonQuery; for high-volume bulk loads use BulkInsert. |
ExportPDFPageAsImage |
ExportPDFPageAsImage (data-driven) |
Render one page of a PDF to a PNG/JPG image file at the requested DPI. | User wants a single PDF page as a raster image (for thumbnails, OCR pre-processing, embedding in reports). For all images embedded inside the PDF use ExtractImagesFromPDF; for OCR text use ReadPDFWithOCR. |
ExtractImagesFromPDF |
ExtractImagesFromPDF (data-driven) |
Save every embedded image in a PDF to files in an output folder. | User wants the original images embedded inside a PDF (logos, photographs, charts). For rasterised page snapshots use ExportPDFPageAsImage. |
ExtractPDFPageRange |
ExtractPDFPageRange (data-driven) |
Extracts a contiguous page range from a PDF into a new PDF file. | User wants a subset of pages saved as a separate PDF; for the entire page count use GetPDFPageCount; for OCR on extracted pages use ReadPDFWithOCR. |
GetIMAPMailMessages |
gen_get_imap_mail |
Read email messages from an IMAP mailbox folder into a List<MailMessage>. | User wants to fetch mail from an IMAP server (folders, server-side flags). For POP3 use GetPOP3MailMessages; for Exchange/EWS use GetExchangeMailMessages; for an Outlook desktop client use GetOutlookMailMessages. |
GetPDFPageCount |
GetPDFPageCount (data-driven) |
Returns the total number of pages in a PDF document. | User wants to size a loop or validate document length; for content extraction use ReadPDFText / ReadPDFWithOCR. |
InsertDataTable |
InsertDataTable (data-driven) |
Insert every row of a DataTable into a target database table via parameterised INSERTs. | User wants to push a DataTable into a table without the provider-specific bulk-copy fast path. For high-volume loads use BulkInsert; for hand-written SQL use ExecuteNonQuery. |
JoinPDF |
JoinPDF (data-driven) |
Concatenates multiple PDF files into a single output PDF. | User wants to merge several PDFs end-to-end; for a page-range subset of a single PDF use ExtractPDFPageRange. |
ManagePDFPassword |
ManagePDFPassword (data-driven) |
Adds or removes the owner/user password on a PDF document. | User wants to apply or strip a password from a PDF; the password value should come from a credential asset (GetRobotCredential), not be hardcoded. |
ReadPDFText |
gen_read_pdf_text |
Extract embedded text from a PDF file into a String variable. | User wants the text layer of a digitally-generated PDF. For scanned/image PDFs use ReadPDFWithOCR; for the page count use GetPDFPageCount. |
ReadPDFWithOCR |
gen_read_pdf_with_ocr |
Run OCR over a PDF (page-by-page rasterisation) and return the recognised text. | User wants text from a scanned or image-only PDF. For PDFs with an embedded text layer use ReadPDFText (faster, lossless). |
ReadRange |
gen_read_range |
Classic Workbook 'Read Range' — read a worksheet range into a DataTable without opening Excel. | User wants to read a sheet/range into a DataTable via the classic Workbook API (no ExcelApplicationScope). For modern Excel (X) projects use ReadRangeX; for classic-with-Excel use ExcelReadRange. |
ReadXPSText |
ReadXPSText (data-driven) |
Reads text content from an XPS document into a string variable. | User wants the text body of an XPS file; for PDF text use ReadPDFText; for OCR on scanned XPS use ReadXPSWithOCR. |
SaveMailAttachments |
gen_save_mail_attachments |
Save the attachments of a MailMessage to a folder on disk, optionally filtered by extension. | User has a MailMessage from any Get*MailMessages activity and wants its attachments written to disk. Pair with GetIMAPMailMessages, GetOutlookMailMessages, or GetExchangeMailMessages. |
SendMail |
gen_send_mail |
Send an email through an SMTP server (or Integration Service connection). | User wants to send mail via plain SMTP or an Integration Service mail connection. For Outlook desktop use SendOutlookMail; for Exchange Web Services use SendExchangeMail. |
WriteCell |
gen_write_cell |
Classic Workbook 'Write Cell' — write a single value or formula into one cell without opening Excel. | User wants to set one cell via the classic Workbook API. For a whole DataTable use WriteRange; for modern Excel (X) projects use WriteCellX. |
WriteRange |
gen_write_range |
Classic Workbook 'Write Range' — write a DataTable into a worksheet range without opening Excel. | User wants to push a DataTable to a sheet via the classic Workbook API (no ExcelApplicationScope). For modern Excel (X) projects use WriteRangeX; to append rather than overwrite use AppendRange. |
Testing (18)
| Activity | Generator | Description | Use when |
|---|---|---|---|
Address |
Address (data-driven) |
Returns a random plausible street address from a built-in dataset for test data. | User wants realistic address input; pair with GivenName / LastName for a synthetic person record. |
AttachDocument |
AttachDocument (data-driven) |
Attaches a file artifact (screenshot, log, evidence) to the current test result. | User wants to include evidence in a Test Manager run; for inline log messages use LogMessage; for screenshots specifically use TakeScreenshotAndSave first. |
BulkAddTestDataQueue |
BulkAddTestDataQueue (data-driven) |
Inserts many rows into a Test Data Queue from a DataTable in a single Orchestrator request. | User wants to seed a Test Data Queue from an Excel sheet; for one row at a time use NewAddTestDataQueueItem. |
ComparePdfDocuments |
ComparePdfDocuments (data-driven) |
Compares two PDF documents and reports per-page differences using a comparison rule. | User wants to verify that a generated PDF matches a baseline; for plain text comparison use CompareText. |
CompareText |
CompareText (data-driven) |
Compares two strings using a comparison rule (case-insensitive, whitespace-normalized, regex-aware). | User wants to assert string equivalence with normalization options; for raw equality use VerifyExpressionWithOperator with the Equals operator. |
CreateComparisonRule |
CreateComparisonRule (data-driven) |
Builds a reusable comparison rule object for ComparePdfDocuments / CompareText. | User wants to share a normalization configuration (ignore whitespace, case-insensitive, regex masks) across multiple comparisons. |
DeleteTestDataQueueItems |
DeleteTestDataQueueItems (data-driven) |
Deletes test data items from a Test Data Queue by ID list or filter. | User wants to clear a queue between test runs; pair with BulkAddTestDataQueue to refresh test data. |
GetTestDataQueueItem |
GetTestDataQueueItem (data-driven) |
Pops one test data row from a Test Data Queue and binds its fields to local variables. | User wants the next row of test data in a data-driven test; for many rows in one call use GetTestDataQueueItems. |
GetTestDataQueueItems |
GetTestDataQueueItems (data-driven) |
Returns a batch of test data rows from a Test Data Queue as a list. | User wants several rows in one call (faster than looping GetTestDataQueueItem); for a single row use GetTestDataQueueItem. |
GivenName |
GivenName (data-driven) |
Returns a random plausible given (first) name from a built-in dataset for test data. | User wants realistic first-name input; pair with LastName + Address for a synthetic person record. |
LastName |
LastName (data-driven) |
Returns a random plausible family (last) name from a built-in dataset for test data. | User wants realistic last-name input; pair with GivenName + Address for a synthetic person record. |
RandomDate |
RandomDate (data-driven) |
Generates a random DateTime within a specified [from, to] range. | User wants synthetic date input; for a calendar-aware business-day variant authoring is custom. |
RandomNumber |
RandomNumber (data-driven) |
Generates a random integer or decimal within a specified range for test data. | User wants synthetic numeric input; for a value drawn from an enum-like set use RandomValue. |
RandomString |
RandomString (data-driven) |
Generates a random string of given length and character class for test data. | User wants synthetic string input for a test; for numbers use RandomNumber; for human-shaped values (names, addresses) use GivenName / LastName / Address. |
RandomValue |
RandomValue (data-driven) |
Returns a random element from a supplied list of candidate values. | User wants a value picked from a fixed set (e.g. a category enum); for free-form strings use RandomString. |
VerifyExpression |
VerifyExpression (data-driven) |
Asserts that a boolean expression evaluates to True; fails the test step otherwise. | User wants a simple True/False assertion; for comparator-based assertions (eq/lt/gt/contains) use VerifyExpressionWithOperator; for numeric-range checks use VerifyRange. |
VerifyExpressionWithOperator |
VerifyExpressionWithOperator (data-driven) |
Asserts that two expressions satisfy a comparator (Equals, NotEquals, GreaterThan, LessThan, Contains). | User wants a typed comparator assertion; for raw boolean expressions use VerifyExpression; for numeric ranges use VerifyRange. |
VerifyRange |
VerifyRange (data-driven) |
Asserts that a numeric value falls within an inclusive [min, max] range. | User wants to verify a number is between two bounds; for equality / comparator checks use VerifyExpressionWithOperator. |
Don't auto-generate (18)
These activities require UiPath Studio's interactive wizard or otherwise cannot be reliably emitted programmatically. Direct the user to author them in Studio rather than calling the dispatcher.
| Activity | Reason | Description |
|---|---|---|
ApplicationEventTrigger |
wizard-only | Trigger that fires when a configured application event occurs (wizard-only). |
ChangeDataRangeModification |
wizard-only | Internal Excel range-modification helper without a stable XAML namespace (wizard-only). |
ExcelApplicationCard |
wizard-only | Modern Use Excel File scope (wizard-only) - opens a workbook and runs nested Excel activities against it. |
ExcelForEachRowX |
wizard-only | StudioX For Each Row in Excel (wizard-only) - iterates over rows in a sheet/table with a CurrentRow + CurrentIndex body. |
ExcelProcessScopeX |
wizard-only | Modern Excel Process Scope (wizard-only) - controls a single Excel process instance for nested activities. |
ExtractUIData |
wizard-only | Classic Data Scraping wizard output - extracts tabular UI data based on a recorded pattern (wizard-only). |
ForEachEmailX |
wizard-only | StudioX For Each Email iterator (wizard-only) over a mailbox folder. |
ForEachSheetX |
wizard-only | StudioX For Each Sheet (wizard-only) - iterates over each worksheet of the workbook with a CurrentSheet + CurrentIndex body. |
GetAttribute |
wizard-only | Read a named UI element attribute (innertext, aaname, etc.) into an output variable (wizard-only). |
MockActivity |
wizard-only | Substitutes a mocked implementation for a wrapped activity at test time, returning a canned output. |
NAccessibilityCheck |
wizard-only | Run an accessibility audit (axe-core) against the current browser/app state (wizard-only). |
NewAddTestDataQueueItem |
wizard-only | Inserts a single row into a Test Data Queue with the given field values. |
NExtractFormDataGeneric |
wizard-only | Extract form-field values from a captured form using AI (wizard-only). |
NSetValue |
wizard-only | Update a UI element value using AI-driven element resolution (wizard-only). |
OutlookApplicationCard |
wizard-only | Modern Use Outlook scope (wizard-only) - pins an Outlook account for nested mail activities. |
ReadXPSWithOCR |
wizard-only | Reads text from an XPS document using an OCR engine for image-based pages. |
UpdateChartX |
wizard-only | StudioX 'Update Chart' (wizard-only) - updates the data range or properties of an existing chart. |
VerifyControlAttribute |
wizard-only | Asserts that a UI element's attribute (Text, Enabled, Visible, etc.) matches an expected value. |
Alternatives (84)
Each row pairs an activity with its documented substitutes and the trigger that picks the substitute over the canonical activity.
| Activity | Alternative | Use alternative when |
|---|---|---|
AddQueueItem |
BulkAddQueueItems |
You have many items to enqueue at once; bulk uploads are dramatically faster than a per-item loop. |
AppendRange |
WriteRange |
The destination is empty (or you want to overwrite) rather than append below existing data. |
AppendRange |
AppendRangeX |
The workflow uses the modern Excel (X) suite rather than classic Workbook activities. |
AppendRangeX |
AppendRange |
You are using the classic ExcelApplicationScope rather than a modern Use Excel File scope. |
AppendRangeX |
WriteRangeX |
The destination is empty (or you want to overwrite) rather than append below existing rows. |
AppendWriteCsvFile |
ReadCsvFile |
You actually want to load a CSV from disk into a DataTable, not write one out. |
AppendWriteCsvFile |
WriteTextFile |
The payload is unstructured text rather than a DataTable that needs delimiter-aware formatting. |
Assign |
MultipleAssign |
You need to set two or more variables in one node; one MultipleAssign keeps related writes together. |
Assign |
BuildDataTable |
You are creating a DataTable with a fixed schema rather than assigning a scalar value. |
BuildDataTable |
Assign |
You only need to set a single variable; BuildDataTable is for constructing a tabular value with explicit columns/rows. |
BuildDataTable |
GenerateDataTable |
The source is a delimited string (CSV/TSV-style) that should be parsed into a table rather than typed in column-by-column. |
BulkAddQueueItems |
AddQueueItem |
You only have a single item to enqueue; the bulk path is overkill. |
BulkInsert |
BulkUpdate |
The DataTable rows already exist and need to be updated by primary key rather than appended. |
BulkInsert |
InsertDataTable |
You want a generic DataTable insert without the provider's bulk-copy fast path. |
BulkInsert |
ExecuteNonQuery |
Only a handful of rows; parameterised INSERTs are simpler than wiring DatabaseConnect+BulkInsert. |
BulkUpdate |
BulkInsert |
The rows are new and should be appended rather than matched and updated. |
CopyFile |
MoveFile |
The source should not remain at the original location after the transfer. |
DatabaseConnect |
DatabaseDisconnect |
You already have an open connection and want to close it instead of opening a new one. |
DatabaseDisconnect |
DatabaseConnect |
You need to open a new connection rather than close an existing one. |
Delay |
RetryScope |
You actually need to wait for a condition to succeed (with retry/backoff) rather than burn a fixed amount of time. |
DeleteFileX |
MoveFile |
The file should be archived to another folder rather than destroyed. |
ExcelApplicationCard |
ExcelApplicationScope |
You are using classic (non-modern-design) activities and just need a workbook scope around them. |
ExcelApplicationCard |
ExcelProcessScopeX |
You need a process-wide configuration covering multiple workbooks rather than a card around one Excel session. |
ExcelApplicationScope |
ExcelProcessScopeX |
The workflow runs the modern (X) Excel activities and you want a process-level scope that covers multiple workbooks rather than per-file. |
ExcelApplicationScope |
ExcelApplicationCard |
You are authoring inside a Modern Design experience (Application Card) rather than the classic scope. |
ExcelProcessScopeX |
ExcelApplicationScope |
You only need to open and operate on a single workbook with classic activities, not configure a process-wide Excel runtime. |
ExcelProcessScopeX |
ExcelApplicationCard |
You are authoring inside the Modern Design Application Card pattern rather than a process-level scope. |
ExcelReadColumn |
ReadRangeX |
You need a rectangular range with multiple columns, not a single column of values. |
ExcelReadColumn |
ReadCellValueX |
You only need one cell from the column. |
ExecuteNonQuery |
ExecuteQuery |
The statement is a SELECT and you need the result rows. |
ExecuteNonQuery |
BulkInsert |
You are loading a large DataTable into a single target table. |
ExecuteNonQuery |
DatabaseTransaction |
Several statements must commit or roll back together. |
ExecuteQuery |
ExecuteNonQuery |
The statement is INSERT/UPDATE/DELETE/DDL and you only need the affected-row count, not a result set. |
ExecuteQuery |
BulkInsert |
You are loading a large DataTable into a single table; BulkInsert is faster than parameterised inserts. |
ExportPDFPageAsImage |
ExtractImagesFromPDF |
You want the images that are already embedded in the PDF (not rasterised page snapshots). |
ExtractImagesFromPDF |
ExportPDFPageAsImage |
You want a rasterised snapshot of an entire page rather than the embedded image objects. |
FilterDataTable |
LookupDataTable |
You need a single matching row's value for a key, not a full filtered subset. |
FilterDataTable |
JoinDataTables |
You need to combine columns from two tables on a key rather than filter rows of one table. |
Flowchart |
StateMachine |
The graph has long-lived states with entry/exit actions and explicit triggers; StateMachine models that better than free-form arrows. |
ForEach |
ForEachRow |
You are iterating the rows of a DataTable; ForEachRow exposes the row item directly without indexing. |
ForEach |
NForEachUiElement |
You are iterating a live collection of UI elements found on screen rather than a generic collection. |
ForEach |
ForEachFileX |
You are iterating files (or folders) under a path; ForEachFileX handles enumeration, filtering, and recursion natively. |
ForEachFileX |
ForEach |
You already have an in-memory collection of file paths; do not re-enumerate the filesystem. |
ForEachFileX |
ForEachRow |
You are iterating rows of a DataTable, not files on disk. |
ForEachRow |
ForEach |
The collection is a generic IEnumerable (List, Array) rather than a DataTable. |
ForEachRow |
ForEachFileX |
You are walking files on disk rather than rows of an in-memory table. |
ForEachRow |
NForEachUiElement |
You are iterating UI elements on screen rather than tabular data. |
GetExchangeMailMessages |
GetOutlookMailMessages |
You want to use the locally-installed Outlook desktop client instead of talking to Exchange Web Services directly. |
GetExchangeMailMessages |
GetIMAPMailMessages |
The server only exposes IMAP, or you need vendor-neutral folder access without Exchange credentials. |
GetExchangeMailMessages |
GetPOP3MailMessages |
The server only exposes POP3 for a one-shot download. |
GetIMAPMailMessages |
GetPOP3MailMessages |
The mailbox only exposes POP3 (one-shot download) rather than IMAP (folders, server-side state). |
GetIMAPMailMessages |
GetExchangeMailMessages |
You can talk to the Exchange Web Services / EWS endpoint directly with credentials rather than going through a generic IMAP gateway. |
GetIMAPMailMessages |
GetOutlookMailMessages |
The robot has a logged-in Outlook desktop client and you want to read from the local profile rather than hit the server over IMAP. |
GetOutlookMailMessages |
GetExchangeMailMessages |
There is no locally-installed Outlook profile and you must hit Exchange Web Services directly. |
GetOutlookMailMessages |
GetIMAPMailMessages |
The mailbox is non-Exchange (e.g. Gmail, generic IMAP) and there is no Outlook client to drive. |
GetOutlookMailMessages |
GetPOP3MailMessages |
The server only exposes POP3 and you just need a one-shot download of new mail. |
GetPOP3MailMessages |
GetIMAPMailMessages |
The server supports IMAP and you need folder navigation or server-side flags rather than a one-shot POP3 download. |
GetPOP3MailMessages |
GetExchangeMailMessages |
You can use the Exchange Web Services endpoint directly for richer querying than POP3. |
GetPOP3MailMessages |
GetOutlookMailMessages |
You want to read from a logged-in Outlook desktop profile rather than poll a POP3 server. |
GetRobotAsset |
GetRobotCredential |
The asset is a Credential type and you need both username and password (as SecureString) returned. |
GetRobotCredential |
GetRobotAsset |
The asset is a non-credential value (text, integer, bool, JSON) rather than a username/password pair. |
If |
Switch |
You are branching on a single value across three or more discrete cases (use Switch for n-way dispatch). |
If |
IfElseIfV2 |
You have a chain of mutually exclusive boolean conditions and want explicit else-if branches rather than nested If activities. |
IfElseIfV2 |
If |
You only have one boolean branch (with optional else); the chained form is unnecessary. |
IfElseIfV2 |
Switch |
Every branch tests the same value against a constant; Switch is clearer for n-way dispatch on one expression. |
InputDialog |
MessageBox |
You only need to show information or get an OK acknowledgement, not collect typed input. |
InsertDataTable |
BulkInsert |
The DataTable is large and the provider supports a bulk-copy API. |
InsertDataTable |
ExecuteNonQuery |
You want explicit SQL/parameter control rather than the implicit column mapping. |
InvokeCode |
InvokeWorkflowFile |
The behavior is reusable and worth modeling as its own XAML workflow with named arguments. |
InvokeCode |
InvokeMethod |
You just need to call one method on an existing object; reflection is lighter than a code block. |
InvokeMethod |
InvokeCode |
You need more than one statement, control flow, or local variables; a code block is more natural than reflection. |
InvokeMethod |
InvokeWorkflowFile |
The behavior is reusable enough to warrant its own XAML workflow with explicit arguments. |
InvokeWorkflowFile |
InvokeCode |
The logic is short, language-level (VB.NET / C#) snippets that do not warrant a separate XAML file. |
InvokeWorkflowFile |
InvokeMethod |
You only need to call a single method on an existing .NET object via reflection, not run a whole workflow. |
JoinDataTables |
FilterDataTable |
You only need to subset one table by a condition, not combine columns from a second table. |
JoinDataTables |
LookupDataTable |
You only need to fetch a single value for a key rather than produce a joined result table. |
LookupDataTable |
FilterDataTable |
You need every matching row, not just the first hit's value. |
LookupDataTable |
JoinDataTables |
You want all matching rows merged with their right-side columns, not just one looked-up scalar. |
MessageBox |
InputDialog |
You need to read a value typed by the user, not just show information. |
MessageBox |
LogMessage |
The workflow is unattended or you only want a log entry rather than a blocking UI prompt. |
MoveFile |
CopyFile |
The original file must remain at its source location after the operation. |
MultipleAssign |
Assign |
You are only setting a single variable; one Assign is simpler than the multi-row form. |
MultipleAssign |
BuildDataTable |
The target is a tabular value with a fixed schema, not a set of scalars. |
NApplicationCardAttach |
NApplicationCardOpen |
You need to launch a browser at a URL rather than attach to an existing one. |
NApplicationCardAttach |
NApplicationCardDesktopOpen |
You need to launch a desktop executable rather than attach to an open window. |
NApplicationCardClose |
NApplicationCardAttach |
You want to keep the app running after the scope ends rather than close it. |
NApplicationCardDesktopOpen |
NApplicationCardOpen |
The target is a URL opened in a browser rather than a desktop executable. |
NApplicationCardDesktopOpen |
NApplicationCardAttach |
The desktop application is already running and you only need to attach to its window. |
NApplicationCardOpen |
NApplicationCardAttach |
The browser or app is already running and you only need to attach to its window. |
NApplicationCardOpen |
NApplicationCardDesktopOpen |
The target is a desktop executable launched by file path, not a URL in a browser. |
NCheck |
NClick |
The target is a generic button or link rather than a checkbox/radio; a raw click is enough. |
NCheck |
NSelectItem |
The control is a dropdown/list rather than a check or radio toggle. |
NCheck |
NCheckState |
You only need to read whether the box is checked, not change it. |
NCheckState |
NClick |
You need to act on the element rather than just observe its state. |
NCheckState |
NCheck |
You need to actually toggle the checkbox/radio rather than read its state. |
NCheckState |
NCheckElement |
You need to assert the element's existence/visibility rather than its checked state. |
NClick |
NCheck |
The target is a checkbox or radio button and you need to set its state instead of just clicking. |
NClick |
NSelectItem |
The target is a combo-box or list and you need to choose an item by visible text rather than firing a click. |
NClick |
NCheckState |
You only need to verify the element's state without interacting; this just observes, NClick acts. |
NGetBrowserData |
NGetText |
The data is rendered text on a UI element rather than browser storage/cookies/form values. |
NGetBrowserData |
NGetClipboard |
The data has already been copied to the clipboard rather than living in browser state. |
NGetClipboard |
NGetText |
The value lives inside a specific UI element rather than on the system clipboard. |
NGetClipboard |
NGetBrowserData |
You need browser-side data (storage, cookies) instead of generic clipboard contents. |
NGetText |
NGetClipboard |
The source already lives on the system clipboard (e.g. user-copied text) rather than inside a UI element. |
NGetText |
NGetBrowserData |
The source is structured browser data (cookies, storage, form values) rather than rendered text on an element. |
NHighlight |
NHover |
You need to actually trigger hover-state UI (tooltip, dropdown) rather than just outline the element for debugging. |
NHighlight |
NTakeScreenshot |
You want a captured image artifact for evidence/logging rather than a live on-screen overlay. |
NHover |
NHighlight |
You only want a visual debug outline, not a real mouse hover that fires the application's hover handlers. |
NHover |
NTakeScreenshot |
You need a saved image of the element rather than to interact with it. |
NSelectItem |
NClick |
The control is a free button or link, not a combo-box/list with named options. |
NSelectItem |
NCheck |
The control is a checkbox or radio button rather than a multi-option selector. |
NSelectItem |
NSetText |
The dropdown is editable and the value is free-form text rather than one of the predefined items. |
NSetClipboard |
NTypeInto |
You want the value entered keystroke-by-keystroke into a specific UI field rather than parked on the system clipboard. |
NSetClipboard |
NSetText |
You want the value committed directly to a specific element without a paste step. |
NSetText |
NTypeInto |
The target requires real keystrokes (e.g. fires onkeypress handlers, has masking, or rejects programmatic value assignment). |
NSetText |
NSetClipboard |
You will paste the value yourself and just need to load the clipboard, without writing into a specific element. |
NTakeScreenshot |
NHighlight |
You only need an ephemeral on-screen indicator for debugging, not a saved image. |
NTakeScreenshot |
NHover |
You need to trigger the application's hover behavior rather than capture the screen. |
NTypeInto |
NSetText |
The field already accepts a direct value-set and you do not need keystroke-level fidelity (faster, no focus needed). |
NTypeInto |
NSetClipboard |
The value is large or contains characters the target does not accept via keystrokes; paste from the clipboard instead. |
PathExists |
CreateDirectory |
You actually want to ensure the folder exists, not merely test it. |
ReadCell |
ReadRange |
You need more than a single cell; ReadRange returns a rectangular block as a DataTable. |
ReadCell |
ReadCellValueX |
The workflow uses the modern Excel (X) suite rather than the classic Workbook activities. |
ReadCsvFile |
ReadTextFile |
The file is plain text without delimited columns; you want the raw string, not a parsed DataTable. |
ReadPDFText |
ReadPDFWithOCR |
The PDF is scanned or image-based and has no embedded text layer. |
ReadPDFWithOCR |
ReadPDFText |
The PDF already has an embedded text layer; ReadPDFText is faster and lossless. |
ReadRange |
ReadRangeX |
The workflow uses the modern Modern Excel (X) suite with Use Excel File scope rather than the classic ExcelApplicationScope. |
ReadRange |
ReadCell |
You only need a single cell, not a rectangular range. |
ReadRangeX |
ReadRange |
You are inside a classic ExcelApplicationScope/Workbook scope rather than a modern Use Excel File context. |
ReadRangeX |
ReadCellValueX |
You only need the value of one cell; ReadRangeX is for rectangular ranges. |
ReadRangeX |
ExcelReadColumn |
You want every cell in one column without specifying the row count. |
ReadTextFile |
ReadCsvFile |
The file is a delimited CSV/TSV that should be parsed into a DataTable rather than handed back as a string. |
Rethrow |
Throw |
You want to raise a new exception (different type or message), not forward the one you caught. |
RetryScope |
TryCatch |
On failure you want a different code path (log, fall back, swallow) rather than another attempt. |
SendExchangeMail |
SendOutlookMail |
There is a logged-in Outlook desktop client; let it deliver the mail so it follows local Outlook rules. |
SendExchangeMail |
SendMail |
You do not have Exchange credentials and only need to push through a generic SMTP relay. |
SendMail |
SendOutlookMail |
There is a logged-in Outlook desktop client and you want messages to be sent through it (so they land in Sent Items, follow Outlook rules, etc.). |
SendMail |
SendExchangeMail |
You can authenticate to Exchange Web Services directly rather than relying on a generic SMTP relay. |
SendOutlookMail |
SendExchangeMail |
There is no locally-installed Outlook profile and you must talk to Exchange Web Services directly. |
SendOutlookMail |
SendMail |
You only have a generic SMTP relay (no Outlook client, no Exchange credentials). |
StateMachine |
Flowchart |
The graph is a one-shot decision tree with no persistent states; Flowchart is lighter weight than a state machine. |
Switch |
If |
You only need a binary true/false branch on a boolean expression. |
Switch |
IfElseIfV2 |
The branches depend on different boolean expressions (not values of one expression) and you want labeled else-if clauses. |
Throw |
Rethrow |
You are inside a Catch block and want to forward the original exception unchanged rather than construct a new one. |
TryCatch |
RetryScope |
The failure is a transient external problem and the right response is to retry the same activity, not to handle a different code path. |
TryCatch |
Throw |
You actually want to raise a new exception, not catch one. |
WriteCell |
WriteRange |
You are writing a DataTable or multiple cells, not a single cell. |
WriteCell |
WriteCellX |
The workflow uses the modern Excel (X) suite rather than classic Workbook activities. |
WriteCellX |
WriteCell |
You are using the classic Workbook activities rather than the modern Excel (X) suite. |
WriteCellX |
WriteRangeX |
You are writing a DataTable or multiple cells rather than a single value. |
WriteRange |
WriteRangeX |
The workflow uses the modern Excel (X) suite with Use Excel File scope rather than classic Workbook scope. |
WriteRange |
WriteCell |
You are writing a single value, not a DataTable's worth of rows. |
WriteRange |
AppendRange |
The destination already has data and you want to append below it instead of overwriting from the start cell. |
WriteRangeX |
WriteRange |
You are using the classic ExcelApplicationScope/Workbook scope, not a modern Use Excel File scope. |
WriteRangeX |
WriteCellX |
You are writing a single cell value rather than a DataTable. |
WriteRangeX |
AppendRangeX |
You want to append below the existing data instead of overwriting from the start cell. |
WriteTextFile |
AppendWriteCsvFile |
The data is tabular (DataTable) and needs delimiter-aware CSV formatting. |
WriteTextFile |
ReadTextFile |
You actually want to load text from disk, not write it. |
Index footer: 464 activities, 16 categories, 18 unsupported, 0 review-pending. Regenerate with python uipath-core/scripts/generate_routing_index.py.
Open this reference as its own page
Ground Rules Reference
Single source of truth for all generation and architecture rules. Other docs reference rules by ID (e.g., "Rule G-3"). Lint rules are in lint-reference.md — this file covers agent behavior rules (what the model must/must not do).
Generation Rules (G)
| ID | Severity | Rule | Rationale |
|---|---|---|---|
| G-1 | ⛔ HALT | Create .xaml files ONLY via scripts/generate_workflow.py. Never via Write, create_file, or hand-writing. Write a JSON spec → run the CLI → get validated .xaml. |
Hand-written XAML bypasses hallucination guardrails: wrong enum values, missing child elements, malformed namespaces. #1 cause of lint errors. |
| G-2 | ⛔ HALT | Write JSON specs to disk as .json files BEFORE calling generate_workflow.py. Never embed specs inline in Agent/subagent prompts or compose from memory. |
When specs are embedded in prompts, the subagent composes types from memory (Dictionary(String,Object) instead of Dictionary), skips TYPE_MAP normalization, and produces XAML that crashes Studio. |
| G-3 | ⛔ HALT | Framework wiring snippets MUST come from generator output. When using modify_framework.py (insert-invoke or replace-marker), the XAML snippet must be generated by generate_workflow.py or gen_*() functions first. Never compose XAML inline in tool arguments. |
The wiring script validates snippets and rejects hallucinated patterns (exit code 1). |
| G-4 | ⛔ HALT | Never generate XAML from scratch. All XAML in assets/ are real UiPath Studio exports. Copy from the closest template and modify. Never write namespace blocks, assembly references, or ViewState from memory. |
Studio's XAML schema is complex — invented namespaces or attributes crash the IDE. |
| G-5 | 🔴 ERROR | Never guess NuGet package versions. Run scripts/resolve_nuget.py. UiPath packages use non-standard version schemes. |
Grabbing latest without filtering picks up -preview versions that break projects. |
| G-6 | 🔴 ERROR | Never add variables to framework files via Write/Edit tool. Use modify_framework.py add-variables. |
It handles indent, creates <Sequence.Variables> if missing, and skips duplicates. |
| G-7 | 🟡 WARN | Use type shortcuts in JSON specs. "String" not "x:String", "Dictionary" not "Dictionary(String,Object)". See cheat-sheet.md § type keys. |
The generator auto-maps short forms. Long-form types bypass TYPE_MAP and crash Studio. |
| G-9 | 🔴 ERROR | UI activity specs MUST include obj_repo bindings. After generating the Object Repository (Phase 2c), read refs.json and add "obj_repo": {"reference": "...", "content_hash": "...", "guid": "..."} to every UI activity's args in the JSON spec. Add "obj_repo_app" to NApplicationCard specs. Skip only for NCheckState targeting elements not in selectors.json. |
Without obj_repo, the Object Repository exists but activities use hardcoded inline selectors — refactoring requires manually updating every activity. Lint 94 catches missing .objects/ but cannot detect missing bindings in XAML. |
| G-8 | ⛔ HALT | Never use Edit/Write tools on .xaml files. All XAML modifications go through scripts: generate_workflow.py (new files), modify_framework.py (framework wiring, variables, expressions), validate_xaml --fix (deterministic auto-fixes). If a framework file needs a type change, use add-variables with short-form types. If it needs an expression replacement, use set-expression. |
Hand-editing .xaml bypasses type normalization, snippet validation, and lint guardrails. Every raw Edit in the CCSH project produced errors that required further fixes. |
Inspection Rules (I)
| ID | Severity | Rule | Rationale |
|---|---|---|---|
| I-1 | ⛔ HALT | Playwright/browser inspection is READ-ONLY. Never type into form fields, enter credentials, or click submit. Login page → STOP, output the Login Gate message, WAIT for user. | Safety — never interact with live credentials or production systems. |
| I-2 | ⛔ HALT | HALT at login gates during Playwright inspection. When navigation hits a login redirect: inspect the login page, ask the user to log in, then END YOUR RESPONSE. Do not inspect other pages or proceed to XAML generation. Resume only after user confirms login. | The model cannot authenticate — attempting to continue produces wrong selectors from the login page. |
| I-3 | ⛔ HALT | Never guess selectors. Browser selectors come from Playwright MCP inspection. SAP selectors come from inspect-sap-tree.ps1. Desktop selectors come from inspect-ui-tree.ps1 via PowerShell. No "placeholder" selectors, no "TODO: VERIFY" markers. If you don't have real selectors, STOP. |
Guessed selectors are wrong 100% of the time for SAP dynpro paths and near-100% for dynamic web apps. |
| I-4 | 🟡 WARN | Inspect target applications BEFORE generating any XAML. If Playwright MCP or PowerShell is available (Windows), use it. Do NOT skip to generation with guessed selectors. | Real selectors from live inspection are the only reliable source. |
Architecture Rules (A)
| ID | Severity | Rule | Rationale |
|---|---|---|---|
| A-1 | 🔴 ERROR | ALL apps open and ready in InitAllApplications. Every app must be launched, logged in, and ready by end of InitAllApplications.xaml. Process.xaml and action workflows ONLY attach (OpenMode="Never"). They NEVER open or launch apps. |
Separates initialization from business logic. Apps stay open across transactions. |
| A-2 | 🔴 ERROR | Persistence activities MUST stay in Main.xaml. WaitForFormTaskAndResume and CreateFormTask+wait pairs are persistence points — they serialize workflow state to Orchestrator. They ONLY work in the entry-point file. Lint 26 enforces this. |
Runtime error — bookmark context unavailable in sub-workflows. |
| A-3 | 🔴 ERROR | Credentials retrieved where used, NEVER passed as arguments. GetRobotCredential goes inside the workflow that uses the credentials. Pass only in_strCredentialAssetName (the Orchestrator asset name string). Never pass in_strUsername/in_strPassword/in_secPassword. |
Security — credentials should never traverse argument boundaries. Orchestrator audit trail is per-robot. |
| A-4 | 🔴 ERROR | Never modify SetTransactionStatus.xaml. The default Framework implementation handles all cases correctly. |
Custom logic here breaks REFramework's retry/exception handling contract. |
| A-5 | 🔴 ERROR | Modular decomposition. Never put an entire process into a single Main.xaml. Break into Workflows/<AppName>/ subfolders connected via InvokeWorkflowFile. One UI scope per workflow, ≤150 lines per file. |
Long workflows are unreadable, untestable, and unmaintainable. |
| A-6 | 🔴 ERROR | Navigation is always a separate invoke from the page action. First invoke Browser_NavigateToUrl.xaml (from Utils/), then invoke AppName_DoAction.xaml. Never create app-specific NavigateTo workflows — the generic util handles all URL navigation. |
Keeps navigation reusable. Callers assemble full URLs from Config. |
| A-7 | 🟡 WARN | Log bookends on every workflow. First and last activity: LogMessage "[START/END] WorkflowName". Applies to Main.xaml AND all sub-workflows. |
Essential for production debugging and Orchestrator log analysis. |
| A-8 | 🟡 WARN | URLs from Config, never hardcoded. Store base URL + path segments in Config.xlsx Assets sheet. Caller assembles full URL via String.Format. Workflow receives complete URL in in_strUrl. |
Environment portability — Dev/UAT/Prod use different URLs. Lint 37 catches this. |
| A-9 | 🟡 WARN | Browser defaults: IsIncognito="True", InteractionMode="Simulate", AttachMode="SingleWindow". Desktop: NO IsIncognito, Simulate or HardwareEvents, AttachMode="ByInstance". |
Incognito kills session on close (no logout needed). Simulate is fastest and most reliable for web. |
| A-10 | 🟡 WARN | One browser instance per web app. Each web app gets its own incognito browser with a distinct UiElement variable (uiWebApp, uiSHA1Online). Never share tabs across apps. |
Tab-sharing causes race conditions and makes close/error-handling unpredictable. |
| A-11 | 🟡 WARN | Wrap API/network activities in RetryScope. 3 retries, 5s interval. Exception: NetHttpRequest has built-in retry — do NOT double-wrap. |
Transient failures are common with Orchestrator and external APIs. |
| A-12 | 🟡 WARN | Extraction workflows return ALL data — filtering is a separate step. AppName_ExtractData.xaml outputs the raw DataTable. Filtering belongs in the caller or Process_FilterData.xaml. |
Keeps extraction reusable across projects with different filter criteria. |
PDD Rules (P)
| ID | Severity | Rule | Rationale |
|---|---|---|---|
| P-1 | 🔴 ERROR | Follow the PDD exactly. Implement the PDD's specified approach faithfully — do NOT substitute alternatives without asking. If you believe an alternative is better: implement PDD way first, propose alternative separately, let user decide. | The PDD represents stakeholder requirements. Unilateral substitution breaks trust. |
| P-2 | 🔴 ERROR | Architecture check for PDDs. Does the PDD describe BOTH reading items AND processing each one? → Recommend Dispatcher + Performer (two projects). | Single-project approaches don't scale for transaction-level retry and status tracking. |
| P-3 | 🟡 WARN | Technical improvements are OK — functional changes are NOT. Override PDD only for: selector strategies, error handling, variable naming, decomposition, retry logic. Never for: which app to automate, which website to use, programmatic alternatives to UI automation. | The PDD defines WHAT to automate. The skill defines HOW to do it well. |
SAP-Specific Rules (S)
| ID | Severity | Rule | Rationale |
|---|---|---|---|
| S-1 | 🔴 ERROR | SAP activities MUST be inside NSAPLogon scope. All SAP-specific activities require a ScopeIdentifier referencing the parent NSAPLogon.ScopeGuid. |
SAP COM bridge context is scoped to the logon session. |
| S-2 | 🔴 ERROR | Status bar check after EVERY write operation. After Save, Type Into + Enter, or Call Transaction: NSAPReadStatusbar → check MessageType.Equals("E") → Throw. |
SAP errors are silent without status bar validation. |
| S-3 | 🔴 ERROR | Toolbar buttons are NOT regular NClick. System toolbar (Enter/Save/Back/Exit/Cancel) → NSAPClickToolbarButton. Only user area buttons use NClick with selectors. |
Wrong activity type produces no error but silently does nothing. |
| S-4 | 🔴 ERROR | Table cells use NSAPTableCellScope, not direct selectors. Wrap the action in NSAPTableCellScope targeting ColumnName + RowType. |
Direct cell selectors break when rows shift. The scope handles dynamic indexing. |
| S-5 | 🟡 WARN | Dynpro numbers are volatile — field names are stable. Don't "fix" dynpro numbers in selectors. Use the full path from inspection output. | Dynpro numbers change when sections expand/collapse. Field names (txtMEPO_TOPLINE-EBELN) are stable. |
| S-6 | 🟡 WARN | NEVER hardcode SAP values. Every data value (credentials, transaction codes, asset names, field values, connection names) comes from arguments or variables, never as literals in XAML. | Hardcoded values break reusability and environment portability. |
Skill Authoring Rules (K)
| ID | Severity | Rule | Rationale |
|---|---|---|---|
| K-1 | 🟡 WARN | SKILL.md should be a routing table + ground rules + architecture constraints. Target ≤8,000 tokens for 1M-context models. Code recipes, expression guides, and selector references belong in references/ files loaded on demand. Routing tables, capabilities, decomposition rules (K-3), and ground rules belong inline. Avoid line counts or other metadata that drifts silently. Run scripts/check_skill_budget.py to verify. |
SKILL.md is loaded into context on skill invocation. With 1M-context models, 3 skills at 8K each = 24K tokens (2.4% of budget) — negligible. On 200K-context models the same 24K is ~12% — still manageable but no longer negligible; tighten budgets or reduce active skills if targeting smaller contexts. The old 3K target forced externalizing content that models then skipped, causing worse routing and monolith generation. Keep essential guidance inline; externalize only reference data that's useful on-demand (code recipes, expression syntax, selector patterns). |
| K-2 | 🟡 WARN | Mark "always read" references in the routing table with ⚠️. If a reference file should be read on every task for that skill (e.g., sap-generation.md for any SAP generation), mark the routing entry with ⚠️ and bold text. |
The agent needs a strong signal to not skip critical references. ⚠️ markers in the routing table are the mechanism — they're cheaper than putting the content inline. |
| K-3 | 🟡 WARN | Keep decomposition rules inline in SKILL.md. Decomposition/architecture sections are the most likely to be skipped if externalized — agents love to skip decomposition and generate monoliths. These stay in SKILL.md even if they push past the 3K token target. | The cost of the agent skipping decomposition (monolith workflows, failed battle tests) outweighs the token savings from externalizing it. |
Open this reference as its own page
Scaffolding & Templates
Template selection, NuGet mapping, validation, and project scaffolding. Core rules are in SKILL.md.
Template Selection
| Need | Template |
|---|---|
| Non-REFramework project | simple-sequence/Main.xaml (276 lines) |
| Assign, BuildDataTable, Switch, Flowchart | simple-sequence/Main.xaml — real exports of all these |
| Process cleanup (ForEach + TryCatch) | reframework/Framework/KillAllProcesses.xaml (155 lines) |
| CloseAllApplications orchestrator | reframework/Framework/CloseAllApplications.xaml (65 lines) — invokes App_Close.xaml per app |
| Clean process placeholder | reframework/Framework/Process.xaml (92 lines) |
| Sequence with arguments | reframework/Framework/InitAllApplications.xaml (75 lines) |
| App close/browser navigate | samples/common-workflows/Workflows/Utils/App_Close.xaml, Workflows/Utils/Browser_NavigateToUrl.xaml |
| App login (web or desktop) | samples/common-workflows/Workflows/WebAppName/WebAppName_Launch.xaml |
| HTTP/REST API, OAuth, queue dispatch | samples/common-workflows/HttpApiDispatcher_Main.xaml (orchestrator) + Workflows/Api/Api_FetchInvoices.xaml (credential+OAuth+fetch) |
| If/Else branching | reframework/Framework/GetTransactionData.xaml |
| ForEachRow + TryCatch | reframework/Framework/InitAllSettings.xaml |
| Multi-branch conditions | stripped/SetTransactionStatus.xaml |
| UI automation (modern) | stripped/FormFilling_Main.xaml, samples/common-workflows/Workflows/WebAppName/WebAppName_Launch.xaml |
| Email automation (Integration Service) | No golden template — follow xaml-integrations.md Email section |
| Web form filling, browser automation | stripped/FormFilling_Main.xaml |
| PDF extraction (native + OCR), file iteration | simple-sequence/PDFExtraction_Main.xaml |
| Web scraping, Extract Table Data, pagination | simple-sequence/WebScraping_Sequence1.xaml |
| StateMachine (REFramework) | stripped/REFramework_Main.xaml |
No template? If the user needs an activity not in any template (e.g., HTTP Request, Invoke Code), use the closest template for the overall structure, then insert activity XAML from the relevant references/xaml-*.md file (see SKILL.md routing table). For Tasks form tasks, see the uipath-tasks skill.
Large template files: Use stripped excerpts in assets/stripped/ (visual metadata removed, 50-70% smaller). E.g., stripped/FormFilling_Main.xaml is 26KB vs 94KB original. Full originals needed only for --golden validation.
Activity → NuGet Package Mapping
When generating XAML, auto-resolve required dependencies from activities used. UiPath.System.Activities is always required. Add others based on the activities present in the workflow:
| Activities | NuGet Package |
|---|---|
| Sequence, If, ForEach, While, Switch, Assign, MultipleAssign, TryCatch, Throw, Rethrow, RetryScope, InvokeWorkflowFile, InvokeCode, InvokeMethod, LogMessage, Comment, Break, Continue, MessageBox, InputDialog, DeserializeJson, AddDataRow, AddDataColumn, BuildDataTable, FilterDataTable, ForEachRow, JoinDataTables, LookupDataTable, MergeDataTable, OutputDataTable, RemoveDuplicateRows, SortDataTable, GenerateDataTable, CopyFile, MoveFile, DeleteFileX, CreateDirectory, PathExists, ForEachFileX, GetRobotAsset, GetRobotCredential, AddQueueItem, GetQueueItem, SetTransactionStatus, IfElseIfV2 | UiPath.System.Activities (always) |
UseApplicationBrowser, NClick, NTypeInto, NSelectItem, NGetText, NGetAttribute, NCheckAppState, ElementExists, TakeScreenshot, NHoverElement, NHighlightElement, any uix: prefixed activity |
UiPath.UIAutomation.Activities |
| UseExcelFile, ReadRange (modern), WriteRange (modern), ForEachSheetRow, ExcelApplicationScope (legacy) | UiPath.Excel.Activities |
| HttpClient (HTTP Request) | UiPath.WebAPI.Activities (NOT Web.Activities — that package doesn't exist) |
| GetIMAPMailMessages, SendMail, SaveMailAttachments | UiPath.Mail.Activities |
| CreateFormTask, WaitForFormTaskAndResume | UiPath.Persistence.Activities + UiPath.FormActivityLibrary (form designer — must be added explicitly, NOT a transitive dependency of Form.Activities) |
| VerifyExpression, VerifyControlAttribute | UiPath.Testing.Activities |
| DatabaseConnect, ExecuteQuery, ExecuteNonQuery | UiPath.Database.Activities |
| ReadPDFText, ReadPDFWithOCR, ExtractPDFPageRange, MergePDFs | UiPath.PDF.Activities |
| GoogleOCR (Tesseract OCR engine) | UiPath.UIAutomation.Activities |
When scaffolding a project, inspect the workflows being generated, identify which packages are needed from the table above, then query the NuGet API for their latest stable versions and include them all via --deps.
Adding Dependencies to an Existing Project
When generating a workflow INSIDE an existing project (project.json already exists):
- Identify which packages are needed from the Activity → NuGet Package Mapping table above
- Add them in one command:
This resolves the latest stable version and updates project.json automatically. Packages already at the latest version are skipped. Existing packages are updated if newer versions are available.# Single package python3 scripts/resolve_nuget.py --add /path/to/project UiPath.UIAutomation.Activities # Multiple packages python3 scripts/resolve_nuget.py --add /path/to/project UiPath.Excel.Activities UiPath.Mail.Activities
Common missed dependencies (causes "activity not found" in Studio):
- HTTP/REST API workflows →
UiPath.WebAPI.Activities - Email workflows →
UiPath.Mail.Activities - Tasks / Form tasks →
UiPath.Persistence.Activities+UiPath.FormActivityLibrary(both required — Persistence for runtime, FormActivityLibrary for form designer) - Database queries →
UiPath.Database.Activities - UI automation (clicks, types) →
UiPath.UIAutomation.Activities
Workflow: Validating XAML
Environment note: All
python3commands below target Claude's Linux container (Claude Code, claude.ai compute). On Windows/PowerShell, substitutepythonforpython3.
# Single file
python3 scripts/validate_xaml path/to/workflow.xaml
# Entire project
python3 scripts/validate_xaml path/to/project/
# Strict mode (naming convention warnings)
python3 scripts/validate_xaml path/to/project/ --strict
# Lint mode (semantic / best-practice checks)
python3 scripts/validate_xaml path/to/project/ --lint
# Both
python3 scripts/validate_xaml path/to/project/ --lint --strict
# Golden template mode (suppress Studio export noise: naming, Config .ToString, DisplayName, hardcoded idx, FuzzySelector)
python3 scripts/validate_xaml assets/ --lint --golden
# Regression test (validates golden templates + scaffolds all variants)
python3 scripts/regression_test.py
Structural checks (always run): well-formed XML, root Activity element, x:Class, xmlns declarations vs usage, unique IdRefs, HintSize attributes, argument types/naming, ViewState dictionaries, InvokeWorkflowFile path resolution, expression language consistency.
Lint checks (--lint) — 71 numbered lint rules (+ plugin lint rules). See lint-reference.md for the full table searchable by lint number.
Workflow: Scaffolding a UiPath Project
Three project types are supported:
| Variant | Use case | Template | Base dependencies |
|---|---|---|---|
sequence |
Simple linear automation, no transactions | simple-sequence-template/ |
System only (add others per mapping table) |
dispatcher |
REFramework — reads data, creates queue items | reframework/ |
System + UIAutomation + Excel + Testing |
performer |
REFramework — processes queue items | reframework/ |
System + UIAutomation + Excel + Testing |
Choosing the Right Variant
Decision tree — ask these questions in order:
- Does the PDD/requirements describe BOTH (a) reading items from a list/table/web page AND (b) processing each item individually with status updates? →
dispatcher+performerpair (two separate projects). This is the production-standard pattern. The Dispatcher scrapes/reads the source data and populates an Orchestrator Queue; the Performer consumes queue items one by one. This is the correct choice for any PDD that describes iterating through work items, cases, records, or transactions from a source system. - Does the process ONLY consume items from an Orchestrator Queue that already exists? →
performeronly - Does the process ONLY read bulk data and push to a Queue (no per-item processing)? →
dispatcheronly - Does the process read bulk data and process each item in a loop WITH per-item retry/status tracking, but without Orchestrator Queues? →
dispatcherwith DataRow transaction type (single project, self-contained) - Everything else →
sequence
⚠️ Common mistake: choosing performer-only when Dispatcher + Performer is correct. If the PDD describes both data extraction and per-item processing (e.g., "access Work Items listing" + "for each activity, perform steps"), the answer is almost always a Dispatcher + Performer pair, not a single Performer that assumes queue items magically exist. Ask yourself: "Who puts the items in the queue?" — if the answer is "the robot needs to scrape them from a web page/Excel/DB", you need a Dispatcher.
Keyword signals from the user's request:
| User says... | Variant |
|---|---|
| PDD with "for each item/activity, perform steps" + list/table scraping | dispatcher + performer pair |
| "work items listing", "for each WI5", "scrape table and process each row" | dispatcher + performer pair |
| "queue item", "Orchestrator queue", "transaction item", "SetTransactionStatus" | performer |
| "read from Excel/DB and add to queue", "dispatcher", "bulk upload to queue" | dispatcher |
| "REFramework", "Config.xlsx", "retry failed transactions", "InitAllSettings" | dispatcher or performer (ask which) |
| "just automate X", "fill a form", "run a script", "attended bot", "simple process" | sequence |
| "input dialog", "message box", "one-shot", "no queue" | sequence |
When in doubt: Start with sequence. REFramework adds significant complexity (StateMachine, Config.xlsx, 8+ framework files). Only use it when the process genuinely needs transaction-level retry, queue integration, or the structured init/process/end lifecycle.
PDD adherence: When a PDD or requirements document specifies a particular approach, tool, or method — implement it as specified. Do NOT substitute alternatives you consider superior without proposing them to the user first. If you want to suggest an alternative, present it as an option alongside the PDD-specified approach, explain the tradeoff, and let the user choose. Never label your preferred alternative as "(Recommended)" when it deviates from what the PDD says.
Dispatcher + Performer pairs: Many production processes use both — a Dispatcher reads source data and populates the queue, a Performer consumes and processes items. If the user describes an end-to-end pipeline, scaffold both projects.
CRITICAL — Dependency versions: Template project.json files contain baseline versions that go stale. Before scaffolding, query the UiPath Official NuGet feed for current stable versions of all required packages.
NuGet v3 flat2 API — fetch all versions for a package:
https://pkgs.dev.azure.com/uipath/5b98d55c-1b14-4a03-893f-7a59746f1246/_packaging/1c781268-d43d-45ab-9dfc-0151a1c740b7/nuget/v3/flat2/{package-id-lowercase}/index.json
Returns {"versions": [...]} sorted oldest-first (ascending). The array contains ALL versions including prereleases.
Filtering — MUST follow these steps:
- Fetch the JSON response
- Filter OUT any version containing
-(this catches-preview,-beta,-rc,-alpha, etc.) - Take the LAST remaining entry = latest stable version
- If no stable versions remain (all are prerelease), report the issue to the user
Example script (Linux/macOS — on Windows use resolve_nuget.py instead):
curl -s "https://pkgs.dev.azure.com/uipath/5b98d55c-1b14-4a03-893f-7a59746f1246/_packaging/1c781268-d43d-45ab-9dfc-0151a1c740b7/nuget/v3/flat2/uipath.uiautomation.activities/index.json" \
| python3 -c "import json,sys; vs=[v for v in json.load(sys.stdin)['versions'] if '-' not in v]; print(vs[-1] if vs else 'ERROR: no stable version found')"
Common mistake: Grabbing the last entry WITHOUT filtering → picks up 26.1.0-preview instead of 25.10.26. Always filter out versions with - in the string before selecting.
# Step 1: Resolve latest stable versions (ALWAYS do this first — Rule G-5)
python3 scripts/resolve_nuget.py UiPath.System.Activities UiPath.UIAutomation.Activities
# Step 2: Use resolved versions in scaffold command
# Simple sequence project (e.g. attended automation with UI + dialogs)
python3 scripts/scaffold_project.py \
--name "MyProject" \
--variant sequence \
--attended \
--output /path/to/output \
--deps "UiPath.System.Activities:[<version>],UiPath.UIAutomation.Activities:[<version>]"
# REFramework performer
python3 scripts/resolve_nuget.py UiPath.System.Activities UiPath.UIAutomation.Activities UiPath.Excel.Activities UiPath.Testing.Activities
python3 scripts/scaffold_project.py \
--name "MyProject" \
--variant performer \
--output /path/to/output \
--queue-name "MyProjectQueue" \
--queue-folder "Shared" \
--deps "UiPath.System.Activities:[<version>],UiPath.UIAutomation.Activities:[<version>],UiPath.Excel.Activities:[<version>],UiPath.Testing.Activities:[<version>]"
⚠️ Do NOT create the project folder before running scaffold. The script creates <output>/<name>/ automatically. If you mkdir MyProject then run --output MyProject --name MyProject, you get MyProject/MyProject/. Use --output <parent_dir> (e.g. /home/claude on Linux, $env:USERPROFILE\Desktop on Windows) and let the script create the folder.
Dispatcher vs Performer
- Dispatcher reads source data (Excel, DB, API), creates Orchestrator Queue Items for each transaction, then exits
- Performer picks Queue Items one by one, processes each, and sets status (Success/Failed/Retry)
⛔ Never modify SetTransactionStatus.xaml — the default Framework implementation handles all cases correctly. Do NOT generate custom logic in this file.
Dispatcher gotcha: in_TransactionItem must be Nothing in the Dispatcher's Main.xaml calls to SetTransactionStatus, because the Dispatcher creates queue items — it does NOT consume them, so there is no QueueItem to pass.
⛔ Process.xaml scope: in_TransactionNumber is NOT passed to Process.xaml — it lives in Main.xaml's state machine and flows only to GetTransactionData.xaml and SetTransactionStatus.xaml. In Process.xaml, reference transaction fields via in_TransactionItem (e.g., in_TransactionItem("WIID").ToString for DataRow, in_TransactionItem.SpecificContent("Key").ToString for QueueItem). Lint 100 catches this.
Transaction Item Types
By default, REFramework templates use QueueItem as the transaction type. For dispatchers that process data directly (without Orchestrator Queues), the transaction type is typically DataRow.
To switch from QueueItem to DataRow: Use scaffold_project.py --variant dispatcher --transaction-type DataRow which handles all files automatically, including test cases (Tests/GetTransactionDataTestCase.xaml, Tests/ProcessTestCase.xaml).
If manually switching (not recommended), change these files:
TransactionItemvariable declaration in Main.xaml- All
OutArgument/InArgumentreferencing TransactionItem in Main.xaml out_TransactionItemargument in GetTransactionData.xamlin_TransactionItemargument in Process.xaml (⛔ NOT SetTransactionStatus.xaml)- Test case files:
Tests/GetTransactionDataTestCase.xaml,Tests/ProcessTestCase.xaml - Add the required xmlns if not already present
⛔ GetTransactionData.xaml body MUST also change for dispatchers. The performer template body contains RetryScope → GetQueueItem which fetches from an Orchestrator queue. Dispatchers iterate a local DataTable — they MUST replace the entire RetryScope+GetQueueItem block with DataTable row indexing:
If in_TransactionNumber <= io_dt_TransactionData.Rows.Count
Then: out_TransactionItem = io_dt_TransactionData.Rows(in_TransactionNumber - 1)
Else: out_TransactionItem = Nothing ← triggers End Process state
Why this matters: GetQueueItem.TransactionItem outputs QueueItem, but a dispatcher's out_TransactionItem is DataRow. Studio will throw a type mismatch compile error. The scaffold script (--variant dispatcher) handles this automatically. If writing GetTransactionData manually, NEVER leave GetQueueItem in a dispatcher project. Lint rule 51 catches this.
Generating a Full Project
Copy this checklist and track progress. See decomposition.md for detailed rules, folder structure examples, naming conventions, and argument design. See golden-templates.md → "Sample Workflows" for a real example project. See xaml-invoke.md for InvokeWorkflowFile XAML structure.
Project Generation:
- [ ] Phase 0: If implementing from a PDD — read it fully, implement EXACTLY as specified
Do NOT substitute alternative approaches without proposing to the user first
Technical improvements (selectors, error handling, retry) are OK — functional changes are NOT
- PDD says "use website X to do Y" → automate website X. Do NOT replace with InvokeCode/programmatic alternative
- PDD says "use application X" → automate application X. Do NOT substitute a different tool
- If you think an alternative is better → implement the PDD way FIRST, then PROPOSE the alternative
ARCHITECTURE CHECK: Does the PDD describe BOTH reading/scraping items AND processing each one?
→ YES = Dispatcher + Performer (two separate projects). ALWAYS recommend this split to the user.
→ See "CRITICAL: Architecture Selection for PDDs" section above.
→ Do NOT default to a single project. If unsure, ask the user.
- [ ] Phase 1: Plan decomposition — list workflows, map to Workflows/ subfolders, define arguments
For each workflow: verify it matches the PDD's specified approach (not a substitution)
If any workflow deviates from PDD (e.g. InvokeCode SHA1 instead of browser SHA1Online) → STOP and ask
⛔ CREDENTIAL CHECK: No workflow may accept username/password/SecureString as arguments.
Credentials are retrieved via GetRobotCredential INSIDE the workflow that uses them.
Pass only `in_strCredentialAssetName` (the Orchestrator asset name string). See `decomposition.md` Rule 8.
PLAN SELF-CHECK — answer BEFORE presenting your plan to the user:
□ For EACH workflow in my plan: does it implement the PDD's specified approach, or did I substitute
a "better" alternative? (e.g., InvokeCode SHA1 instead of browser automation of sha1-online.com)
→ If ANY substitution exists: REMOVE it and implement the PDD way. Propose alternative AFTER.
□ Does my plan include an explicit inspection step for EVERY target app?
→ Browser apps: "Inspect [app] with Playwright" (if Playwright MCP available)
→ Desktop apps: "Inspect [app] with PowerShell" (if PowerShell available on Windows)
→ If ANY app lacks an inspection step and the tool is available: ADD it now.
If you cannot answer YES to all checks, revise your plan before presenting it.
PLAN OUTPUT FORMAT — present your plan using this structure:
Phase 0: [Architecture decision] Phase 1: [Workflows + arguments]
Phase 2: [EACH app to inspect — e.g. "Inspect WebApp with Playwright"] Phase 3-6: [Generate → Wire → Validate → Config]
If Phase 2 is empty or missing, you are violating the skill rules.
- [ ] Phase 2: Inspect target applications BEFORE generating any XAML — MANDATORY when inspection tools are available
If Playwright MCP is available → use it. Do NOT skip to Phase 3 with guessed selectors.
Browser apps → Playwright MCP: navigate to each page, snapshot/inspect elements, record real selectors
LOGIN PAGES: snapshot for selectors → ask user to simulate failed login (capture error element) → then ask user to log in correctly
Wait for user confirmation that they've logged in before inspecting authenticated pages
Desktop apps → PowerShell: run inspect-ui-tree.ps1, record real selectors
Fallback (no MCP tools available): use PDD screenshots/descriptions — but never guess selectors for dynamic elements
See `ui-inspection.md` for detailed Playwright and desktop inspection workflows.
- [ ] Phase 2b: Write `selectors.json` — structured output of ALL Playwright inspection results
Write to project root (shared across Dispatcher+Performer if same apps).
Format: `{"apps": [{"name": "...", "selector": "...", "browser_type": "Edge", "screens": [{"name": "...", "url": "...", "elements": [{"name": "...", "selector": "...", "taxonomy_type": "Input|Button|..."}]}]}]}`
taxonomy_type values: Input, Password, Button, Dropdown, Link, CheckBox, RadioButton, Text
Screen = one page/URL. Group elements by the page they were inspected on.
This file is consumed by BOTH generate_object_repository.py AND workflow JSON specs (selectors).
- [ ] Phase 2c: Generate Object Repository — `python3 scripts/generate_object_repository.py --from-selectors selectors.json --project-dir <project>`
Run for EACH project (Dispatcher + Performer). Lint 94 is ERROR — project CANNOT pass validation without this.
- [ ] Phase 2d: **`--project-dir` auto-wires Object Repository (Rule G-9)** — Phase 2c wrote `.objects/refs.json`. When you pass `--project-dir <project>` to `generate_workflow.py` in Phase 3, the script automatically injects `obj_repo`/`obj_repo_app` into every matching activity. No manual `refs.json` reading needed. See `generation.md` § "Wiring Object Repository References" for the manual approach if needed.
- [ ] Phase 3: Generate sub-workflows ONE AT A TIME, Main.xaml LAST. For EACH file:
⛔ **SEQUENTIAL ONLY — NEVER generate multiple .xaml files in parallel.** Each file depends on the previous (argument names, variable types, UiElement reference chain). Parallel generation = guaranteed mismatches.
⛔ **SPEC FILES ONLY** — Rule G-2 in `rules.md`. Write spec → disk → run generator. Never inline in Agent prompts.
a) Write a JSON spec → `python3 scripts/generate_workflow.py spec.json output.xaml --project-dir <project>`. Rules G-1, I-3 — never hand-write XAML, never guess selectors.
b) **Validate immediately:** `python3 scripts/validate_xaml path/to/file.xaml --lint` — **fix all errors before the next file.**
⛔ When copying from golden templates: do NOT rename/fix namespaces. `UIAutomationNext` is CORRECT — see CRASH PREVENTION
- [ ] Phase 3b: **Wire UiElement chain** — for EACH app with UI: `python3 scripts/modify_framework.py wire-uielement <project_dir> <AppName>` (e.g., `WebApp`, `SHA1Online`). This adds typed arguments across InitAllApplications → Main → Process → CloseAllApplications. Run BEFORE Phase 4.
⛔ **Framework namespace rule:** Framework files already declare `xmlns:sd="...System.Data.Common"`. When inserting DataTable references into framework files (GetTransactionData, Process), use `sd:DataTable` — NEVER add `xmlns:sd2`. All DataTable references across the entire project use `sd:DataTable`. The `sd2` prefix does not exist in generate_workflow.py output.
- [ ] Phase 3c (Dispatcher only): **Wire GetTransactionData.xaml body** — replace SCAFFOLD.DISPATCHER_GET_ITEM marker.
⛔ Rule G-3 — generate snippet first, then wire. `modify_framework.py` rejects hallucinated patterns.
⛔ The `<xaml_snippet>` argument must be **actual XAML content**, not a file path. Passing a path like `C:/path/to/snippet.json` inserts it as text → Studio crash: *"Collection does not support text content"*.
1. Create JSON spec → `generate_workflow.py spec.json /tmp/gtd_body.xaml`
2. Extract inner activities → pass to `modify_framework.py replace-marker <GTD_path> DISPATCHER_GET_ITEM '<generator_output>'`
- [ ] Phase 4: Wire Main.xaml — orchestration only, InvokeWorkflowFile calls, log bookends **(A-7)**. Then validate Main.xaml immediately.
⛔ Rule G-3 applies here too — all snippets from generator output.
- [ ] Phase 5: Final project-level validation — `python3 scripts/validate_xaml <project_folder> --lint` (catches cross-file issues: lint 50/60/61/63)
- [ ] Phase 6: Output required Config.xlsx keys **grouped by sheet** — run `validate_xaml --config-keys <project_folder>`. See `config-sample.md` for sheet placement decision flowchart.
Key rules: Sequential generation only — one file at a time, validate after each. Sub-workflows first, Main.xaml last. Every .xaml gets LogMessage "[START/END] AppName_Action" bookends. Copy from golden templates, never from scratch. Unique IdRef per activity.
Key project.json Configuration Fields
runtimeOptions
isAttended: false— unattended robot (typical for REFramework)isAttended: true— attended robotrequiresUserInteraction: true— needs UI interactionisPausable: true— can be paused from Orchestrator
designOptions
outputType: "Process"— standard processoutputType: "Library"— reusable libraryprojectProfile: "Developement"— note the typo, this is how Studio spells it
expressionLanguage
"VisualBasic"— VB.NET expressions (default, most common)"CSharp"— C# expressions
Open this reference as its own page
UiPath Skill Guide
Task-specific workflows and examples. The core rules are in SKILL.md. Detailed reference content has been split into focused files — read only the one you need.
Reference Files
| Task | Read |
|---|---|
| Template selection, NuGet mapping, scaffolding, project generation checklist | scaffolding.md |
| Naming conventions, decomposition rules, Login/Launch pattern, Init/Close, UiElement chain | decomposition.md |
| Object Repository, Workflow Generation CLI (JSON specs), Activity Generators (94 core + plugin extensions) | generation.md |
| Playwright MCP inspection, desktop inspection (PowerShell), selector mapping | ui-inspection.md |
Examples
Example 1: "Create a UiPath workflow that reads an Excel file and logs each row"
- Write a JSON spec using
read_range,foreach_row, andlog_messagegenerators:
{"class_name": "Excel_ReadAndLog",
"arguments": [{"name": "in_strFilePath", "direction": "In", "type": "String"}],
"variables": [{"name": "dt_Data", "type": "DataTable"}],
"activities": [
{"gen": "log_message", "args": {"message_expr": "\"[START] Excel_ReadAndLog\""}},
{"gen": "read_range", "args": {"workbook_path_variable": "in_strFilePath", "output_variable": "dt_Data", "sheet_name": "\"Sheet1\"", "range": "\"\""}},
{"gen": "foreach_row", "args": {"datatable_variable": "dt_Data", "row_variable": "row"},
"children": [
{"gen": "log_message", "args": {"message_expr": "\"Row: \" & row(0).ToString"}}
]},
{"gen": "log_message", "args": {"message_expr": "\"[END] Excel_ReadAndLog\""}}
]}
- Save spec to disk →
python3 scripts/generate_workflow.py spec.json Excel_ReadAndLog.xaml(Rules G-1, G-2) - Validate:
python3 scripts/validate_xaml Excel_ReadAndLog.xaml --lint
Output: Single .xaml file
Example 2: "Scaffold a performer REFramework project for processing invoices"
- Run
scaffold_project.py --name "InvoiceProcessor" --variant performer --output /path - Tell user: edit
Framework/Process.xamlfor invoice logic, setOrchestratorQueueNameinData/Config.xlsx - Validate project
Output: Full project directory
Example 3: "Write the VB.NET expression to filter a DataTable where Amount > 1000"
- Read
expr-datatable.md→ LINQ on DataTable section - Answer directly — no XAML needed:
(From row In dt_Input.AsEnumerable()
Where CDbl(row("Amount")) > 1000
Select row).CopyToDataTable()
Example 4: "Create a workflow that calls an API with OAuth and retries on failure"
- Read
xaml-orchestrator.md→ HTTP Request section for OAuth property reference - Write a JSON spec using
getrobotcredential,net_http_request, anddeserialize_jsongenerators:
{"class_name": "Api_FetchData",
"arguments": [
{"name": "in_strCredentialAssetName", "direction": "In", "type": "String"},
{"name": "in_strApiUrl", "direction": "In", "type": "String"},
{"name": "out_joResponse", "direction": "Out", "type": "Object"}
],
"variables": [
{"name": "strUsername", "type": "String"},
{"name": "secstrPassword", "type": "SecureString"},
{"name": "strResponse", "type": "String"}
],
"activities": [
{"gen": "log_message", "args": {"message_expr": "\"[START] Api_FetchData\""}},
{"gen": "retryscope", "children": [
{"gen": "getrobotcredential", "args": {"asset_name_variable": "in_strCredentialAssetName",
"username_variable": "strUsername", "password_variable": "secstrPassword"}}
]},
{"gen": "net_http_request", "args": {"url_variable": "in_strApiUrl", "method": "GET",
"response_variable": "strResponse", "retry_count": 3}},
{"gen": "deserialize_json", "args": {"json_string_variable": "strResponse", "output_variable": "out_joResponse"}},
{"gen": "log_message", "args": {"message_expr": "\"[END] Api_FetchData\""}}
]}
- Save spec to disk →
python3 scripts/generate_workflow.py spec.json Api_FetchData.xaml(Rules G-1, G-2) - Validate:
python3 scripts/validate_xaml Api_FetchData.xaml --lint
Example 5: "Create an Tasks task with a form for address parsing"
- Read uipath-tasks skill →
references/tasks.md - Copy CreateFormTask pattern, define form.io JSON schema with datagrid for addresses
- Add WaitForFormTaskAndResume after creation
- Bind DataTable via InOutArgument for two-way data flow
Example 6: User uploads a .xaml file and asks "Fix this workflow"
- Run
validate_xamlon uploaded file — report errors - Read the file to understand structure
- For fixes: copy correct activity patterns from the relevant
xaml-*.mdreference file - Preserve user's existing structure — add/fix only what's needed
- Validate modified file
Anti-Example: What NOT To Do
WRONG: Writing XAML from memory — e.g., a bare <Activity><Sequence><Assign .../></Sequence></Activity> without xmlns declarations, IdRefs, HintSize, ViewState, or namespace/assembly blocks. This fails immediately.
CORRECT: Use generate_workflow.py with a JSON spec, or copy from a golden template (e.g. Browser_NavigateToUrl.xaml), keep ALL boilerplate intact, only modify business logic.
Do NOT: Generate xmlns blocks from memory. Rewrite the user's entire file when they ask for a small change. Generate a full XAML when the user only needs an expression.
Example 7: "Build a browser automation for the target web application login and work item processing"
Phase 1: Plan decomposition → WebApp_Launch, Browser_NavigateToUrl (Utils), WebApp_GetWorkItems, WebApp_UpdateRecord, App_Close (Utils)
Phase 2: Inspect with Playwright MCP (this phase is MANDATORY before generating any XAML — see ui-inspection.md):
1. Check available tools → find playwright_navigate, playwright_snapshot
2. Navigate to https://webapp-example.com → redirects to login page
3. Snapshot login page → find: input#email, input#password, button#loginButton
4. Map to UiPath:
- ScopeSelectorArgument: <html app='msedge.exe' title='the target web application - Login' />
- Email field: <webctrl id='email' tag='INPUT' />
- Password field: <webctrl id='password' tag='INPUT' type='password' />
- Login button: <webctrl id='loginButton' tag='BUTTON' />
5. Ask user: "I've reached the WebApp login page. Could you first enter wrong credentials
and click Login so I can capture the error message? Then log in with your real credentials.
I'll wait here — I cannot and will not type anything into the login form."
6. User enters bad credentials → error appears → snapshot → get error element selector
If no error or user can't simulate: use placeholder selector with TODO comment
7. User logs in correctly → confirms → now on dashboard/home page
8. Click "Work Items" menu → lands on /work-items → copy URL → navigate directly →
page loads OK → URL is stable → use NGoToUrl in workflow
9. Snapshot work items page → record selectors for table rows, links
10. Click work item "WI-123" → lands on /work-item/WI-123 → copy URL → navigate directly →
page loads OK → URL pattern /work-item/{WIID} is stable → use NGoToUrl with dynamic URL
11. Snapshot detail page → record selectors for form fields, status dropdown, update button
Phase 3: Generate XAML files ONE AT A TIME, sequentially — never in parallel. For each file: (a) write JSON spec → python3 scripts/generate_workflow.py spec.json output.xaml, (b) insert real selectors from Phase 2, (c) validate immediately: python3 scripts/validate_xaml path/to/file.xaml --lint, (d) fix all errors before starting the next file. Use NGoToUrl for all page navigation (URLs confirmed stable in Phase 2). Use NClick only for in-page actions (buttons, form submits).
Phase 4: Wire Main.xaml — validate immediately after.
Phase 5: Final project-level validation: python3 scripts/validate_xaml <project_folder> --lint (catches cross-file issues: argument mismatches, Config.xlsx sync, Init/Close symmetry).
Open this reference as its own page
UI Inspection Reference
Reference documentation for the inspect-ui-tree.ps1 PowerShell script. This script uses the Windows UI Automation (UIA) API to inspect desktop application UI structures and generate UiPath-compatible selector information.
Contents
- Quick Start
- Parameters
- Output Formats (tree, flat, selectors, json)
- Flags Reference
- Framework Detection
- UiPath Activity Mapping (WinForms inferred types)
- WinForms Spatial Label Association
- DataGrid/Table Collapse
- Sample Outputs (Calculator UWP, Desktop App WinForms)
- Workflow: Using Inspect Output to Build UiPath Automation
- Dynamic Name Detection
- Troubleshooting
Quick Start
# Basic tree view
.\inspect-ui-tree.ps1 -WindowTitle "Calculator" -OutputFormat tree
# Generate UiPath selectors
.\inspect-ui-tree.ps1 -WindowTitle "Calculator" -OutputFormat selectors
# Match by process name
.\inspect-ui-tree.ps1 -ProcessName "desktopapp.exe" -OutputFormat tree
# Match by window class
.\inspect-ui-tree.ps1 -WindowClass "CabinetWClass" -OutputFormat flat
# JSON output for programmatic use
.\inspect-ui-tree.ps1 -WindowTitle "Calculator" -OutputFormat json
# Control depth and element count
.\inspect-ui-tree.ps1 -WindowTitle "*Notepad" -OutputFormat tree -MaxDepth 4 -MaxElements 100
Parameters
| Parameter | Default | Description |
|---|---|---|
-WindowTitle |
"" | Window title (supports wildcards: *Notepad, Create Purchase*) |
-WindowClass |
"" | Window ClassName (e.g., CabinetWClass) |
-ProcessName |
"" | Process name with extension (e.g., desktopapp.exe) |
-MaxDepth |
8 | Maximum UI tree traversal depth |
-MaxElements |
200 | Maximum elements to output (prevents runaway on deep apps) |
-OutputFormat |
tree | tree, flat, selectors, or json |
Output Formats
tree
Indented hierarchy showing all element properties. Best for understanding app structure.
flat
Pipe-delimited rows for scripting/parsing: Type|Name|AutomationId|ClassName|FrameworkId|Patterns|Rect|Idx|Flags
selectors
Ready-to-use UiPath <wnd> + <uia> selector pairs with activity hints. Only emits interactive/actionable elements.
json
Structured JSON for programmatic consumption. Includes full metadata, type counts, and duplicate tracking.
Flags Reference
| Flag | Meaning | Impact on Selectors |
|---|---|---|
[!NO_AID] |
Missing AutomationId | Selector depends on name — locale-fragile |
[!NO_CLS] |
Missing ClassName | Less selector specificity |
[!DYNAMIC] |
Name has dynamic content (numbers, dates, counters) | Use wildcard: name='Display is *' |
[!DUP_AID] |
AutomationId not unique among siblings | Needs idx attribute |
[!DUP_NAME] |
Name+ClassName not unique among siblings | Needs idx attribute |
[!POS_AID] |
AutomationId is a numeric positional index | Unstable — changes with content |
[!VERIFY_TYPE] |
WinForms Button* could be CheckBox/RadioButton | Verify in UiPath UI Explorer |
[!EMPTY_FIELD] |
Edit field with no current text | Field exists but currently blank |
[!DISABLED] |
Element is not enabled | May need Wait for Element before interacting |
Framework Detection
The script auto-detects the application framework and adjusts its behavior:
| Framework | Detection | Selector Style | Notes |
|---|---|---|---|
| UWP | ClassName = ApplicationFrameWindow |
<wnd appid='...' /> + <uia> |
Resolves AppId from package |
| WPF | FrameworkId = WPF |
<wnd> + <uia automationid='...' /> |
Rich automation support |
| Win32 | FrameworkId = Win32 |
<wnd> + <uia> |
Standard controls |
| DirectUI | FrameworkId = DirectUI |
<wnd> + <uia> |
Explorer shell, some system UI |
| WinForms | FrameworkId = WinForm or ClassName ~ WindowsForms10.* |
<ctrl name='...' /> (default), <wnd ctrlname='...' /> (with UI Explorer) |
Script generates <ctrl> selectors; UI Explorer needed for ctrlname |
UiPath Activity Mapping
The script maps ControlTypes and UIA patterns to UiPath activities:
| ControlType | Activity Hint |
|---|---|
| Edit, Document | Type Into / Get Text |
| Button | Click |
| Button (with Toggle pattern) | Check / Uncheck |
| CheckBox | Check / Uncheck |
| RadioButton | Select Item |
| ComboBox | Select Item |
| ListItem | Select Item / Click |
| TabItem | Select Item |
| MenuItem, Hyperlink | Click |
| Text | Get Text |
| DataGrid, Table | Extract Data / For Each Row |
| Slider | Set Range Value |
WinForms inferred types
The script infers control types from WinForms ClassNames:
| ClassName Pattern | Inferred Type |
|---|---|
WindowsForms10.EDIT.* |
Edit |
WindowsForms10.BUTTON.* |
Button* (could be Button, CheckBox, or RadioButton) |
WindowsForms10.COMBOBOX.* |
ComboBox |
WindowsForms10.STATIC.* |
Label |
WindowsForms10.RichEdit20W.* |
RichTextBox |
WindowsForms10.SysListView32.* |
ListView |
WindowsForms10.SysTreeView32.* |
TreeView |
WindowsForms10.SysDateTimePick32.* |
DatePicker |
WindowsForms10.Window.* |
Container |
WinForms Spatial Label Association
For WinForms apps, the script uses BoundingRectangle proximity to associate labels with their adjacent input fields:
Primary match — label to the left on the same row (Y within 15px, label's right edge before field's left edge).
Fallback — label directly above (X within 30px, label's bottom above field's top).
This produces output like:
Edit 'Oscar' (near: 'First') -> Type Into / Get Text
ComboBox 'NY' (near: 'State') -> Select Item
DataGrid/Table Collapse
DataGrid and Table elements are collapsed into a summary instead of recursing into every cell:
[2] === DataGrid: listView (rows=5, cols=3) ===
Columns: Name | Email | Phone
-> Activity: Extract Data / For Each Row
Sample Outputs
Sample 1: Calculator (UWP)
Command: .\inspect-ui-tree.ps1 -WindowTitle "Calculator" -OutputFormat selectors
=== UI TREE INSPECTION ===
Window:
Title = Calculator
ClassName = ApplicationFrameWindow
FrameworkId = Win32
ProcessName = ApplicationFrameHost.exe
UWP AppId = Microsoft.WindowsCalculator_8wekyb3d8bbwe!App
UiPath Window Selector: <wnd app='applicationframehost.exe' appid='Microsoft.WindowsCalculator_8wekyb3d8bbwe!App' />
(add cls='ApplicationFrameWindow' or title='Calculator' only if multiple windows need disambiguation)
# Display is 0 (Text) [!NO_CLS,DYNAMIC]
<wnd app='applicationframehost.exe' appid='Microsoft.WindowsCalculator_8wekyb3d8bbwe!App' />
<uia automationid='CalculatorResults' name='Display is *' role='text' />
# Activity: Get Text (Name attribute)
# Seven (Button)
<wnd app='applicationframehost.exe' appid='Microsoft.WindowsCalculator_8wekyb3d8bbwe!App' />
<uia automationid='num7Button' cls='Button' />
# Activity: Click
# Equals (Button)
<wnd app='applicationframehost.exe' appid='Microsoft.WindowsCalculator_8wekyb3d8bbwe!App' />
<uia automationid='equalButton' cls='Button' />
# Activity: Click
=== Summary ===
Total elements: 56 (max: 200, depth: 6)
Key observations:
- UWP apps need
appidin the window selector - All buttons have stable AutomationIds (
num7Button,equalButton) - Display text is dynamic (
Display is 0) → wildcarded toDisplay is * - Window title doesn't need wildcarding (Calculator is fixed)
Sample 2: Desktop App (WinForms)
Command: .\inspect-ui-tree.ps1 -WindowTitle "Desktop App*" -OutputFormat tree -MaxDepth 4
=== UI TREE INSPECTION ===
Window:
Title = Desktop App (Sample App)
ClassName = WindowsForms10.Window.8.app.0.378734a
FrameworkId = WinForm
ProcessName = DesktopApp.exe
** WinForms Detected **
NOTE: WinForms .NET Control.Name (ctrlname/automationid) is NOT accessible
via standard APIs. Use UiPath UI Explorer to capture real selectors.
[0] === Desktop App (Sample App) ===
[1] TabControl (empty) -> Click tab item
[2] === People ===
[3] === Name: ===
[4] Button* 'Female' -> Click [!VERIFY_TYPE]
[4] Button* 'Male' -> Click [!VERIFY_TYPE]
[4] Label: 'Last:'
[4] Label: 'First:'
[4] Edit 'Smith' (near: 'Last') -> Type Into / Get Text
[4] Edit 'Jane' (near: 'First') -> Type Into / Get Text
[3] === Email ===
[4] Edit 'work.email@example.com' (near: 'Work') -> Type Into / Get Text
[4] Edit 'personal.email@example.com' (near: 'Personal') -> Type Into / Get Text
[3] === Phone ===
[4] Edit '555-012-3456' (near: 'Mobile') -> Type Into / Get Text [!DYNAMIC]
[4] Edit '555-098-7654' (near: 'Home') -> Type Into / Get Text [!DYNAMIC]
[3] === Address ===
[4] ComboBox 'NY' (near: 'State') -> Select Item
[4] Edit '90210' (near: 'Zip') -> Type Into / Get Text [!DYNAMIC]
[4] Edit '742 Evergreen Terrace' (near: 'Add Line 1') -> Type Into / Get Text [!DYNAMIC]
=== Summary ===
Total elements: 37 (max: 200, depth: 4)
Framework: WinForms (.NET)
Controls: Edit:12, Label:12, Container:7, Button*:4, ComboBox:1, TabControl:1
Selector strategy: <wnd> chains with ctrlname attribute (requires UI Explorer)
Key observations:
- WinForms apps expose everything as
Panevia UIA — script infers types from ClassNames Button*indicates ambiguity: could be Button, CheckBox, or RadioButton (Male/Female are likely RadioButtons)- Spatial label association works:
Edit 'Oscar' (near: 'First')correctly pairs the field with its label - Phone numbers flagged as
[!DYNAMIC]— they contain digit patterns selectorsmode generates<ctrl name='...' role='...' />selectors for WinForms using UIA Name property- For more stable
ctrlnameselectors, use UiPath UI Explorer
WinForms Tab Control Hierarchy (CRITICAL)
In the Sample 2 output above, the hierarchy reveals:
[1] TabControl (empty) -> Click tab item
[2] === People === <- TabItem -- NAVIGATION TARGET
[3] === Name: === <- GroupBox -- visual container INSIDE People tab
[3] === Email === <- GroupBox -- visual container
[3] === Phone === <- GroupBox -- visual container, NOT a tab
[3] === Address === <- GroupBox -- visual container, NOT a tab
Key distinction:
- Children of TabControl (depth [2]) = TabItems — these are the clickable tabs. Use their names for navigation selectors (
aaname='People'). - Children of a TabItem (depth [3]) = GroupBoxes — visual containers that organize fields on that tab's page. Do NOT use their names for tab navigation.
Why this matters: The tree only expands the active tab. If DesktopApp has tabs People/Company/Other but "People" is active, you'll see People expanded with its GroupBoxes (Name, Email, Phone, Address). The other tabs (Company, Other) appear at depth [2] but are collapsed. The model must NOT assume "Phone" and "Address" are tab names — they're GroupBoxes visible because People is active.
Verification: Ask the user to confirm the tab names, or inspect with -MaxDepth 2 to see only TabControl and its direct TabItem children without GroupBox noise.
Workflow: Using Inspect Output to Build UiPath Automation
- Run inspection against the target application
- Identify interactive elements — look for activity hints in the output
- Check flags — elements with
[!DUP_AID]needidx,[!DYNAMIC]needs wildcards - For WinForms —
selectorsmode generates<ctrl name='...' />selectors. For more stablectrlnameselectors, use UiPath UI Explorer - For standard apps (UWP, WPF, Win32) — the generated selectors are ready to use in XAML workflows
Dynamic Name Detection
The script flags names as [!DYNAMIC] when they contain patterns likely to change between runs:
| Pattern | Example |
|---|---|
| Calculator display | Display is 42 |
| Status counters | 3 items, Line 7 |
| Dates | 15/02/2026, 2026-02-15 |
| Timestamps | 14:30:00 |
| Phone numbers | 718-860-7100 |
| Large numbers | 4500021714 |
| IDs with 4+ digits | DOC0012345 |
| Currency | $1,234.56 |
| Percentages | 42.5% |
Dynamic names are wildcarded in selector output: name='Display is *'
Troubleshooting
"Window not found" — The script lists all available windows. Check title spelling, try wildcards, or use -ProcessName instead.
WinForms selectors use <ctrl> tags — The script generates <ctrl name='...' role='...' /> selectors from UIA Name property. For more stable ctrlname/automationid selectors, use UiPath UI Explorer.
Too many elements / truncated — Increase -MaxElements and -MaxDepth. For very large apps, use -OutputFormat json and filter programmatically.
Empty output for some controls — Some frameworks (DirectUI, some custom controls) expose limited UIA data. Use UiPath UI Explorer for manual inspection.
Open this reference as its own page
UI Inspection — Playwright & Desktop
Mandatory inspection workflows for browser and desktop automation. Run these BEFORE generating any XAML. For XAML generation see generation.md. For decomposition rules see decomposition.md.
Workflow: UI Automation with Playwright MCP
⚠️ MANDATORY STEP for browser automation. When building browser automation workflows and Playwright MCP is available, ALWAYS navigate to the target web pages and inspect elements BEFORE generating XAML. Do NOT guess selectors from PDD screenshots, descriptions, or assumptions — inspect the live DOM.
⛔ HARD RULE: Playwright is READ-ONLY. You are an observer, not a user.
- NEVER type into ANY form field, NEVER enter credentials, NEVER click Login/Submit
- Login page → follow the exact Login Gate sequence in SKILL.md § "PLAYWRIGHT INSPECTION — PHASE 2 LOGIN GATE"
- If user can't simulate failure → use placeholder error selector with TODO comment
- If you are about to call a Playwright tool to type or click on a login page — STOP. You are violating this rule.
- Violation of this rule has been the single most recurring bug across all testing sessions
Never guess these if Playwright MCP is available:
- "What is the selector for the login button?" → navigate to the page, inspect it
- "What's the id of the status dropdown?" → navigate to the page, inspect it
- "What tag is the hash result element?" → navigate to the page, inspect it
Steps:
Step 0: Check tool availability. List your available MCP tools. Look for Playwright-related tools (common names: playwright_navigate, browser_navigate, playwright_snapshot, browser_snapshot, playwright_evaluate). If no Playwright tools are available, fall back to PDD screenshots/descriptions and note in your output that selectors are estimated.
Step 1: Navigate to each target page. For every web application the workflow interacts with, navigate to the actual URL. If the app requires login, navigate to the login page first — but DO NOT interact with the login form (see "Handling login-protected pages" immediately below). While navigating, check the address bar for stable URL patterns — if a page has a direct URL (e.g., /work-items, /work-item/{id}, /dashboard?tab=reports), the generated workflow should use NGoToUrl to navigate there instead of clicking through UI elements. Only use NClick for navigation when the page has no addressable URL.
⚠️ STOP-AND-ASK RULE: If ANY page redirects to a login screen, you MUST: (1) inspect the login page selectors, (2) ask the user to log in, (3) END YOUR RESPONSE IMMEDIATELY — do not make any more tool calls, do not inspect other pages "in the meantime", do not start generating XAML. Your response ENDS with the login request. Resume only in your NEXT response after the user confirms login.
Handling login-protected pages — MANDATORY, NEVER SKIP: When you navigate to a page and hit a login screen, do NOT skip the page or guess what's behind it. Do NOT move on to inspect other pages first. Instead:
- Inspect the login page first — capture selectors for username field, password field, login button (you need these for the Launch workflow anyway)
- Ask the user to log in — tell them: "Could you enter incorrect credentials and click Login so I can capture the error message element? Then log in correctly and tell me when you're done." Do NOT type anything yourself.
- HALT. END YOUR RESPONSE. STOP GENERATING TEXT. Do not inspect other pages. Do not inspect non-auth pages "in the meantime." Do not say "while waiting" and continue working. Do not proceed to XAML generation. Your message must END after asking the user to log in. The very last thing in your response is the login request — nothing after it.
- On the user's next message (e.g., "I'm logged in" / "done" / "logged in, also tried wrong creds"):
- If they simulated a failed login: snapshot the page to capture the error element selector
- If they didn't (or no error appears): use placeholder
FullSelectorArgument="<webctrl tag='DIV' class='PLACEHOLDER_ERROR_SELECTOR' />"with<!-- TODO: Replace with real error selector --> - Navigate to each authenticated page and inspect it
- Resume inspection — NOW continue navigating and inspecting the authenticated pages
Why HALT is mandatory: Claude's agentic loop will happily keep running tool calls without user input. But you NEED the user to perform manual actions in the browser (enter credentials, click Login). If you keep running, you'll exhaust your tool calls inspecting irrelevant pages and then start generating XAML with missing selectors — which is exactly the failure mode this rule prevents.
During Playwright inspection you may: navigate to URLs, take snapshots, read the DOM/accessibility tree, click links/menus to discover pages. During Playwright inspection you must NEVER: type into any form field, submit any form, enter credentials (real or fake — not fake ones either, not any), click "Login"/"Submit" buttons, or perform any action that modifies application state.
Never skip authenticated pages. Never guess what elements exist behind a login. The whole point of Playwright inspection is getting real selectors — that means inspecting the actual pages the workflow will interact with, which are usually behind authentication.
URL-first discovery technique: When inspecting, click a link/menu item to reach the next page, then copy the resulting URL. Open a new tab (or reload) and paste the URL directly — if the page loads correctly, it's a stable URL and the workflow should use NGoToUrl instead of replicating the click chain. If it doesn't load (redirects to login, shows error, or loads a different state), the URL is not directly addressable and you must use UI navigation.
Example — inspecting the target web application:
1. Navigate to https://webapp-example.com → redirects to /login
2. Snapshot/inspect the login page → get selectors for username, password, login button
3. Ask user: "I've captured the login page selectors. Could you first enter wrong credentials
and click Login so I can capture the error message element? Then log in with your real credentials.
I'll wait here — I cannot and will not type anything into the login form."
4. **END RESPONSE HERE. Do not continue.** Wait for user's next message.
--- user replies: "Done, I'm logged in. Wrong creds showed a red banner." ---
5. Snapshot → get error element selector (e.g. <webctrl class='alert alert-danger' />)
6. Navigate to /work-items → page loads (user is authenticated) →
copy URL → stable → use NGoToUrl
7. Snapshot/inspect the work items listing → get selectors for table rows, status column, links
8. Click on work item "WI-123" → lands on /work-item/WI-123 →
URL pattern /work-item/{WIID} is stable → use NGoToUrl with dynamic URL
9. Snapshot/inspect → get selectors for form fields, update button, status dropdown
Step 2: Extract element attributes + screenshot coordinates. Use the Playwright snapshot/accessibility tree tool to get the DOM structure. For each interactive element you need, record: tag, id, name, aria-label (→ aaname), type, class, placeholder, role, and the page <title>.
Then, in the same step, run this JavaScript via Playwright MCP browser_evaluate to collect screen coordinates for all elements you identified. Adjust the els array to match the CSS selectors and names from your inspection:
const els = [
{ sel: '#email', name: 'email_field' },
{ sel: '#password', name: 'password_field' },
{ sel: 'button[type="submit"]', name: 'login_button' }
];
const dpr = window.devicePixelRatio || 1;
const chromeY = window.outerHeight - window.innerHeight;
const chromeX = (window.outerWidth - window.innerWidth) / 2;
const results = els.map(e => {
const el = document.querySelector(e.sel);
if (!el) return null;
el.scrollIntoView({ block: 'center' });
const r = el.getBoundingClientRect();
return {
name: e.name,
x: Math.round((window.screenX + chromeX + r.x) * dpr),
y: Math.round((window.screenY + chromeY + r.y) * dpr),
w: Math.round(r.width * dpr),
h: Math.round(r.height * dpr)
};
}).filter(Boolean);
JSON.stringify(results);
Save the JSON output — you need it for Step 3.
Step 3: Map to UiPath selectors using the mapping rules below. Build ScopeSelectorArgument (HTML node from page title + browser) and FullSelectorArgument (WEBCTRL node from element attributes). Copy XAML patterns from references/xaml-ui-automation.md (NClick/NTypeInto/NSelectItem golden patterns) and insert the real selectors. Set SearchSteps="Selector" (strict).
Step 4: Generate XAML. Use activity generators from generate_activities:
gen_nclick("Click Login", selector, "NClick_1", scope_id)
gen_ntypeinto("Type Into 'Email'", selector, "strUsername", "NTypeInto_1", scope_id)
Step 5: Record what you inspected. When generating XAML, add a comment noting the selectors came from live inspection, e.g. <!-- Selector from Playwright inspection of webapp-example.com/login -->. This helps future maintainers know which selectors are verified vs guessed.
Quick mapping: aria-label / visible text → aaname, tagName → tag (UPPERCASE), id → id, page title → ScopeSelectorArgument.
Workflow: Inspecting Desktop Apps (PowerShell)
⚠️ MANDATORY STEP for desktop automation. When building desktop automation workflows and PowerShell is available (Windows), ALWAYS run inspect-ui-tree.ps1 BEFORE generating XAML. Do NOT ask the user what UI framework the app uses or what selectors to use — the script detects the framework automatically and returns real element attributes from the running app.
Never ask the user these questions if PowerShell is available:
- "What UI framework does your app use?" → inspect it
- "What are the selector attributes?" → inspect it
- "Is it WinForms or WPF?" → inspect it
1. Copy the script to the user's machine
# Via PowerShell — copy from WSL to user's home (adjust distro name if needed)
Copy-Item "\\wsl$\Ubuntu-24.04\mnt\user-data\outputs\uipath-core\scripts\inspect-ui-tree.ps1" "$env:USERPROFILE\inspect-ui-tree.ps1" -Force
If the WSL path doesn't work (distro name differs, or no WSL), write the file content directly via [System.IO.File]::WriteAllText().
2. Run inspection
# Tree view — understand the app structure
& "$env:USERPROFILE\inspect-ui-tree.ps1" -WindowTitle "Desktop App*" -OutputFormat tree -MaxDepth 6
# Selector output — ready-to-use UiPath selectors (all desktop apps)
& "$env:USERPROFILE\inspect-ui-tree.ps1" -WindowTitle "Calculator" -OutputFormat selectors
# Match by process name
& "$env:USERPROFILE\inspect-ui-tree.ps1" -ProcessName "desktopapp.exe" -OutputFormat tree
# With element screenshots — captures each interactive element's region as PNG
& "$env:USERPROFILE\inspect-ui-tree.ps1" -WindowTitle "Calculator" -OutputFormat json -ScreenshotDir "$projectPath\.screenshots"
3. Interpret the output
- UWP/WPF/Win32 apps:
selectorsmode generates ready-to-use<wnd>+<uia>selector pairs with activity hints. Copy these directly intoFullSelectorArgument. - WinForms apps:
selectorsmode generates<ctrl name='...' role='...' />selectors using UIA Name property and inferred control roles. For more stablectrlname/automationidselectors, use UiPath UI Explorer. - Flags:
[!DUP_AID]→ addidxto selector.[!DYNAMIC]→ use wildcardname='Display is *'.[!VERIFY_TYPE]→ check if Button is actually CheckBox/RadioButton.
4. Build selectors from output
For non-WinForms apps, the script outputs selector pairs. Trim to minimal — keep only app + appid (UWP) or app alone (.exe):
<wnd app='applicationframehost.exe' appid='...' />
<uia automationid='num7Button' cls='Button' />
# Activity: Click
Map to XAML:
- Window selector →
ScopeSelectorArgumentonTargetAnchorable - Element selector →
FullSelectorArgumentonTargetAnchorable - Activity hint → which XAML activity to use (NClick, NTypeInto, NSelectItem, etc.)
- Always set
SearchSteps="Selector"(strict)
See references/ui-inspection-reference.md for full property mapping tables, framework behaviors, and sample outputs.
Open this reference as its own page
Control Flow Activities
If, IfElseIf, ForEach, ForEachRow, While, DoWhile, Break/Continue, ForEachFile, Flowchart, State Machine, annotations.
Contents
- If
- If Else If (IfElseIfV2)
- Pick / PickBranch (Parallel Race)
- For Each
- For Each Row in DataTable
- While
- Do While
- Break & Continue (Loop Control)
- Annotations
- For Each File in Folder (ForEachFileX)
- Flowchart (alternative to Sequence-based workflows)
- State Machine
- Data Manipulation Activities
If
→ Use gen_if() — generates correct XAML deterministically.
If Else If (IfElseIfV2)
Multi-branch conditional — equivalent to ElseIf chains. Uses BindingList for additional branches.
→ Use gen_if_else_if() — generates correct XAML deterministically.
Notes:
- Namespace required:
xmlns:sc="clr-namespace:System.ComponentModel;assembly=System.ComponentModel.TypeConverter" Conditionon root element is the firstIftest- Each
ui:IfElseIfBlockhasBlockType="ElseIf"and its ownCondition BindingListattributesAllowEdit="True" AllowNew="True" AllowRemove="True" RaiseListChangedEvents="True"are always present- Conditions use XML entity encoding:
<for<,>for>,&for& - Multiline conditions use

for line breaks within attributes
⚠️ WRONG property names (common hallucination — Studio crashes):
IfElseIfV2.Conditions→ WRONG. UseIfElseIfV2.ElseIfs(for extra branches) +Conditionattribute on root elementIfElseIfV2Condition→ WRONG. The type isIfElseIfBlockIfElseIfV2Condition.Body→ WRONG. UseIfElseIfBlock.ThenIfElseIfV2.ElseBody→ WRONG. UseIfElseIfV2.Else
Pick / PickBranch (Parallel Race)
Pick runs multiple PickBranch triggers in parallel — the first trigger that fires wins, its Action body executes, and all other branches are cancelled. Primary use case: login validation (race between "success element appears" and "error element appears").
⚠️ MANDATORY for Launch workflows with login. Every Launch workflow that performs login MUST use Pick to validate the outcome. See golden sample WebAppName_Launch.xaml for complete XAML.
→ Use gen_pick_login_validation() — generates correct XAML deterministically.
Key patterns:
- OutUiElement on NCheckState in the error branch → passes the found element to NGetText via
InUiElement(avoids re-locating the element) - NCheckState is the trigger activity — it blocks until the element appears or times out
- Throw in error branch creates an Exception with the actual error message from the page
For Each
→ Use gen_foreach() — generates correct XAML deterministically. For DataTable iteration, use gen_foreach_row() instead.
For Each Row in DataTable
→ Use gen_foreach_row() — generates correct XAML deterministically. Handles ActivityAction wrapper, DelegateInArgument, sd:DataRow TypeArguments.
While
→ Use gen_while() — generates correct XAML deterministically.
Do While
→ Use gen_do_while() — generates correct XAML deterministically.
Break & Continue (Loop Control)
→ Use gen_break() and gen_continue() — generates correct XAML deterministically.
Notes:
- Only valid inside loop bodies (ForEach, ForEachRow, While, DoWhile)
gen_break()commonly used with an If condition to exit early when a match is found- Both produce self-closing elements (no child content)
Annotations
Add sap2010:Annotation.AnnotationText="..." attribute on any activity element. Set IsAnnotationDocked ViewState key to True (attached) or False (floating). Annotations are design-time metadata — the generators don't produce them, but they can be added manually to generated XAML if needed.
- Requires
xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation" - Can be added to any activity element (Assign, If, Sequence, ForEach, etc.)
For Each File in Folder (ForEachFileX)
Iterates over files in a directory. Uses two delegate arguments: CurrentFile (System.IO.FileInfo) and CurrentIndex (Int32).
→ Use gen_foreach_file() — generates correct XAML deterministically.
Key differences from ForEachRow:
- Requires
xmlns:si="clr-namespace:System.IO;assembly=System.Private.CoreLib"namespace - Uses two delegate arguments (
Argument1+Argument2) vs one for ForEachRow TypeArguments="si:FileInfo, x:Int32"— comma-separated pairCurrentFileproperties:.FullName(full path),.Name(filename),.Extension,.DirectoryNameOrderBy:NameAscFirst,NameDescFirst,DateAscFirst,DateDescFirst,SizeAscFirst,SizeDescFirstIncludeSubDirectories:True/False- ViewState block appears after
.Body(unlike most activities) → Usegen_switch()— generates correct XAML deterministically.
Notes:
x:TypeArgumentssets the switch type:x:String,x:Int32, etc.- Case labels go in
x:Keyattribute — these are the match values (can contain spaces:x:Key="ANY EXISTS") - Case body can be a single activity or a Sequence (for multiple). The generator wraps multi-activity case bodies in Sequence automatically.
- Each case body
DisplayNameis"Body"by convention (but not required) - IdRef uses backtick notation:
Switch`1_1 - Nested Switch is valid (Switch inside a case's Sequence body)
Real-world example — Switch on DataRow column value with case bodies updating Data Service entity:
→ Use gen_switch() — generates correct XAML deterministically.
Pattern notes:
- Switch Expression uses DataRow column:
CurrentRow("Column Name").ToString - Case keys match exact string values from the data (can contain spaces and hyphens)
- Each case updates a different set of Data Service entity properties
Capacity="16"— set higher than actual operation count to avoid reallocations
Flowchart (alternative to Sequence-based workflows)
→ Use gen_flowchart() — generates correct XAML deterministically.
Critical Flowchart rules:
- Requires
xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation"forav:Point,av:Size,av:PointCollection - Nodes use
__ReferenceID{N}naming (Studio convention for cross-references) Flowchart.StartNodereferences the first FlowStep- FlowDecision conditions use
<VisualBasicValue x:TypeArguments="x:Boolean" ExpressionText="..." /> - All
x:Namereferences must be listed as<x:Reference>at end of Flowchart - Each FlowStep/FlowDecision needs
ShapeLocationandShapeSizeViewState for Studio layout
State Machine
Used by REFramework Main.xaml. States contain Entry actions and Transitions with conditions that route to other states. The XAML structure is deeply nested — gen_state_machine() handles all of it: inline state definitions, x:Reference back-references, ViewState, and av: namespace.
{
"gen": "state_machine",
"args": {
"states": [
{
"ref": "S0", "display_name": "State A",
"entry_content": "<!-- entry activities -->",
"transitions": [
{"to_ref": "S1", "display_name": "Go to B", "condition": "boolCondition"},
{"to_ref": "S2", "display_name": "Go to Final (no condition)"}
]
},
{
"ref": "S1", "display_name": "State B",
"transitions": [
{"to_ref": "S0", "display_name": "Back to A", "condition": "otherCondition"},
{"to_ref": "S2", "display_name": "Go to Final"}
]
},
{"ref": "S2", "display_name": "End", "is_final": true}
],
"initial_state_ref": "S0"
}
}
Critical structural rules:
InitialState="{x:Reference __ReferenceID_N}"— points to the starting state'sx:Name- First reference defines inline, subsequent references use
<x:Reference>: Each State is defined in full XML exactly once — inside the firstTransition.Tothat targets it. All other transitions to that state use<x:Reference>__ReferenceID_N</x:Reference> - Final state: REFramework uses
IsFinal="True"on a regular<State>element. Studio also supports a standalone<FinalState>element (only has Entry, no Exit or Transitions). Both are valid. Final states haveState.Entrybut noState.Transitions - All back-referenced states listed at StateMachine level: After the first inline State, all other states appear as
<x:Reference>elements directly inside StateMachine (before.Variables) - Transitions are ordered: First matching condition wins. Omit
Transition.Conditionfor the default/fallback transition (should be last)
ViewState keys specific to StateMachine/State:
ShapeLocation(av:Point) — position in the designer canvasStateContainerWidth/StateContainerHeight(x:Double) — state box dimensionsConnectorLocation(av:PointCollection) — arrow path between states, on both StateMachine and Transition ViewStateSrcConnectionPointIndex/DestConnectionPointIndex(x:Int32) — connector anchor points on Transition ViewState- Requires
xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
State child elements:
State.Entry— activities executed when entering the state (Sequence or single activity)State.Exit— activities executed when leaving the state (optional, not used in REFramework). Runs before the transition's ActionState.Transitions— container for all outgoing Transition elements
Transition child elements (order varies in exports):
Transition.Trigger— activity that triggers the transition evaluation (optional, not used in REFramework). In most cases transitions are evaluated automatically after the Entry completesTransition.Condition— VB.NET boolean expression (optional — omit for default/fallback transition)Transition.Action— activities to execute during the transition, after Condition is true but before entering the target state (optional)Transition.To— target state (inline<State>or<x:Reference>)- Order in exports varies — Studio exports these in different orders. Common pattern:
.To→.Action→.Condition. Sometimes.Conditionappears before.To
FinalState variants:
- REFramework uses
IsFinal="True"on a regular<State>element (most common in real exports) - Studio also supports a standalone
<FinalState>element (functionally identical, only has Entry section — no Exit or Transitions) - Only one initial state is allowed, but multiple Final States are permitted
REFramework State Machine structure (4 states):
Initialization ──[Success]──> Get Transaction Data
^ |
| [New Transaction]──> Process Transaction
| | | | |
| [No Data]──> End Process | | |
| | | |
+────────[System Exception]────────────────────+ | |
[Business Exception]───────────────────────+ |
[Success]───────────────────────────────────────+
(both go back to Get Transaction Data)
Argument default values on root Activity:
REFramework Main.xaml sets argument defaults using the this: namespace prefix (e.g., this:Main.in_boolAttendedRun="True" on the <Activity> element). The this: prefix references the workflow's own class namespace. Scaffold handles this.
Data Manipulation Activities
Open this reference as its own page
Data & File Activities
BuildDataTable, AddDataRow, FilterDataTable, MergeDataTable, SortDataTable, RemoveDuplicateRows, OutputDataTable, JoinDataTables, LookupDataTable, GenerateDataTableFromText, DeserializeJSON, file system operations.
Contents
- Build DataTable
- Add Data Row
- Filter Data Table
- Merge Data Table
- Sort Data Table
- Remove Duplicate Rows
- Output Data Table
- Join Data Tables
- Lookup Data Table
- Generate Data Table From Text
- Deserialize JSON
- File System Activities
- Error Handling
Build DataTable
Uses TableInfo attribute containing an XSD schema + initial row data, all XML-escaped. Studio generates this — the schema defines columns and types.
⚠️ CRITICAL — BuildDataTable is a SELF-CLOSING tag. It has NO child elements. Columns are defined entirely inside the TableInfo attribute as an XML-escaped XSD schema. ⛔ .Columns property does NOT exist. ⛔ DataTableColumnInfo does NOT exist. Using either causes Cannot set unknown member 'BuildDataTable.Columns' → Studio crash.
→ Use gen_build_data_table() — generates correct XAML deterministically.
Schema column type mapping:
xs:string(withmaxLengthrestriction) — System.Stringxs:int— System.Int32xs:boolean— System.Booleanxs:double— System.Doublexs:dateTime— System.DateTime
Initial data rows go after </xs:schema> as <TableName> elements.
Add Data Row
→ Use gen_add_data_row() — generates correct XAML deterministically.
Notes:
ArrayRowtakes a VB.NET array literal:[{"val1", "val2"}](XML-escaped quotes for string literals)- For variable references, no quotes needed:
[{strCol1, strCol2, strCol3}] DataRow="{x:Null}"when using ArrayRow (mutually exclusive)- Can also use
DataRow="[dataRowVariable]"withArrayRowomitted - Complex arrays use

(newlines) and	(tabs) for formatting within XAML attributes - Each element can be any VB.NET expression:
If(condition, value, default),obj.Property, LINQ results, etc. - Column count must match DataTable schema — mismatches cause runtime errors
⚠️ Mixed-type arrays MUST use New Object() syntax:
When ArrayRow contains values of different types (strings + numbers + booleans), wrap with New Object(). Plain {val1, val2} only works when all values are strings.
<!-- ❌ WRONG — mixed types without New Object() causes type inference error -->
ArrayRow="[{"GRAND TOTAL", decGrandTotal, intGrandCount, decGrandAvg}]"
<!-- ✅ RIGHT — New Object() for mixed String + Decimal + Integer -->
ArrayRow="[New Object() {"GRAND TOTAL", decGrandTotal, intGrandCount, decGrandAvg}]"
Rule: if the array contains ANY non-string value (numeric variables, booleans, expressions returning non-string types) → always use New Object() {}.
Add Data Column (AddDataColumn)
Adds a column to an existing DataTable. Use this instead of InvokeCode to define DataTable schemas.
→ Use gen_add_data_column() — generates correct XAML deterministically.
For typed columns, change the TypeArguments:
x:TypeArguments="x:String"— String columnx:TypeArguments="x:Int32"— Integer columnx:TypeArguments="x:Decimal"— Decimal columnx:TypeArguments="x:Boolean"— Boolean columnx:TypeArguments="x:Object"— generic (default)
⚠️ Preferred pattern for creating DataTables with columns:
Instead of InvokeCode with New DataTable + dt.Columns.Add(...):
Declare variable with default — in the JSON spec
variablesarray, pass"default": "new DataTable". The generator wraps it inVisualBasicValueautomatically.Add columns — use
AddDataColumnactivities (one per column): → Usegen_add_data_column()— generates correct XAML deterministically.
This is cleaner than InvokeCode and stays within the low-code paradigm. For aggregation/grouping logic, use Assign or MultipleAssign with LINQ expressions in the Value field (e.g., dt_Data.AsEnumerable().GroupBy(...)) rather than InvokeCode.
Filter Data Table
→ Use gen_filter_data_table() — generates correct XAML deterministically.
Properties:
FilterRowsMode:Keep(keep matching rows) orRemove(remove matching rows)SelectColumnsMode:Keep(keep listed columns) orRemove(remove listed columns)Operator:EQ,NE,LT,LE,GT,GE,CONTAINS,STARTS_WITH,ENDS_WITH,EMPTY,NOT_EMPTY(ALL CAPS — source: real Studio export)BooleanOperator:And,Or(for chaining multiple filters)- For
EMPTY/NOT_EMPTY: usesOperand="{x:Null}"attribute (no value needed) - Operand type varies:
x:Stringfor text,x:Int32for numeric comparisons OutputDataTablecan be same as input (in-place filter) or different variable
Merge Data Table
→ Use gen_merge_data_table() — generates correct XAML deterministically.
Properties:
Source— DataTable to add rows fromDestination— DataTable receiving the rows (modified in-place)MissingSchemaAction:Add(add missing columns),Ignore,Error,AddWithKey- Source columns not in Destination are added when
MissingSchemaAction="Add" - Both tables should share same schema for best results
Sort Data Table
→ Use gen_sort_data_table() — generates correct XAML deterministically.
Properties:
ColumnName— column name to sort by (string)SortOrder:AscendingorDescendingDataTable— input DataTable to sortOutputDataTable— can be same as input (in-place) or a new variableColumnIndex/DataColumn— alternative column selectors (usually{x:Null}when usingColumnName)- For multi-column sort, chain multiple SortDataTable activities (secondary sort first, then primary — stable sort preserves order within ties)
⚠️ WRONG property names (common hallucination): OrderByColumnName → use ColumnName. OrderByType → use SortOrder.
Remove Duplicate Rows
→ Use gen_remove_duplicate_rows() — generates correct XAML deterministically.
Properties:
DataTable— input DataTableOutputDataTable— can be same as input (in-place) or new variable- Keeps first occurrence of each duplicate row
- Compares ALL columns — for key-based dedup use Assign with
dt_Data.AsEnumerable().GroupBy(Function(r) r("Key")).Select(Function(g) g.First()).CopyToDataTable()
Output Data Table
→ Use gen_output_data_table() — generates correct XAML deterministically.
Properties:
DataTable— DataTable to convertText— output string in CSV format (headers + rows)- Useful for logging, debugging, or writing to text files
- For custom formatting, use Assign with
String.Join(separator, dt_Data.AsEnumerable().Select(Function(r) r("Col").ToString))
Join Data Tables
→ Use gen_join_data_tables() — generates correct XAML deterministically.
Properties:
JoinType:Inner,Left,FullInner— only matching rows from both tablesLeft— all rows from DataTable1, matching from DataTable2 (nulls for non-matches)Full— all rows from both tables (nulls where no match)
Operator:EQ,NE,LT,LE,GT,GE,CONTAINS,STARTS_WITH,ENDS_WITHBooleanOperator:And,Or(for multi-column join conditions)- Column1 = column from DataTable1, Column2 = column from DataTable2
- If column names collide, DataTable2 columns get
_1suffix (e.g.,Name_1) - Order of DataTable1 vs DataTable2 matters — affects output structure
Lookup Data Table
→ Use gen_lookup_data_table() — generates correct XAML deterministically.
Properties:
LookupValue— value to search for (String)DataTable— DataTable to search inLookupColumnName— column to search in (useLookupColumnIndexfor index)TargetColumnName— column to return value from (useTargetColumnIndexfor index)RowIndex— output Int32: row index where found (-1 if not found)CellValue— output: value from the target column at the found row- Equivalent to Excel VLOOKUP — search one column, return from another
- For multiple matches or complex lookups, use Assign with
dt_Data.AsEnumerable().Where(Function(r) r("Key").ToString = strSearch).FirstOrDefault()
Generate Data Table From Text
→ Use gen_generate_data_table() — generates correct XAML deterministically.
Properties:
Input— structured text string to parseColumnSeparators— character array for column delimiter (e.g.,","cfor CSV)NewLineSeparator— row separator (default:\n)UseColumnHeader— if True, first row becomes column headersAutoDetect— auto-detect column types (String, Int32, etc.)DataTable— output DataTable variable- Parsing methods: CSV, Custom (specify separators), Fixed width columns
Deserialize JSON
Requires xmlns:njl="clr-namespace:Newtonsoft.Json.Linq;assembly=Newtonsoft.Json" for JObject output type.
→ Use gen_deserialize_json() — generates correct XAML deterministically.
Properties:
x:TypeArguments— output type:njl:JObject(most common), or a custom typeJsonString— VB.NET expression returning string to deserializeJsonObject— output variable receiving deserialized objectJsonSample— optional sample JSON for type inference (usually empty string)
File System Activities
⚠️ Exact activity element names (do NOT invent alternatives):
ui:CopyFile— copy file (NOTCopyFileXorFileCopy)ui:MoveFile— move file (NOTMoveFileXorFileMove)ui:DeleteFileX— delete file (NOTDeleteFileorui:DeleteFile— that doesn't exist and becomesUnresolvedActivity)ui:CreateDirectory— create folderui:PathExists— check if path existsui:ForEachFileX— iterate files in folder (NOTForEachFile)
Copy File
→ Use gen_copy_file() — generates correct XAML deterministically.
Path— source file. Can be a literal relative path (from project root) or VB.NET expression[variable]Destination— target file path (VB.NET expression)Overwrite—True/False(default False). Whether to overwrite if destination existsPathResource/DestinationResource—{x:Null}unless using storage bucket references
Move File
→ Use gen_move_file() — generates correct XAML deterministically.
- Same properties as Copy File, but moves instead of copies (source is deleted after transfer)
- Common pattern: move to archive folder after processing, building destination with
Path.GetFileName
Create Directory
→ Use gen_create_directory() — generates correct XAML deterministically.
Path— directory path to create (creates parent directories if needed, likemkdir -p)Output—{x:Null}(optional DirectoryInfo output, rarely used)- Safe to call on existing directories — does nothing if directory already exists (no error)
- Common pattern: create output/log/archive folders during Init phase from config dictionary
Delete File
→ Use gen_delete_file() — generates correct XAML deterministically.
⚠️ DeleteFileX does NOT have ContinueOnError — it's a newer "X" activity that doesn't inherit from legacy ActivityBase. Wrap in TryCatch if you need error suppression.
Path Exists
→ Use gen_path_exists() — generates correct XAML deterministically.
PathType—"File"or"Folder"Result— Boolean output
Common File System Patterns
Init phase:
CreateDirectory → logs folder (from config)
CreateDirectory → output folder (from config)
CreateDirectory → archive folder (from config)
CopyFile → template from Data\ folder to output path
Processing:
ForEachFileInFolder → iterate files in input folder
(process each file)
MoveFile → archive folder after success
Cleanup:
DeleteFile → temp files
PathExists → check before operations
Error Handling
Open this reference as its own page
Database Activities
SQL database interaction via UiPath.Database.Activities. All activities live under the ui: namespace.
Contents
- When to use
- Connection lifecycle
- DatabaseConnect
- DatabaseDisconnect
- ExecuteQuery (SELECT → DataTable)
- ExecuteNonQuery (INSERT/UPDATE/DELETE/DDL)
- BulkInsert
- BulkUpdate
- InsertDataTable
- DatabaseTransaction
- Common pitfalls
When to use
Reach for these activities when a PDD specifies a RDBMS source/sink (SQL Server, Oracle, PostgreSQL, MySQL, ODBC). For SharePoint lists, REST endpoints, or Orchestrator queues, use the relevant HTTP/Orchestrator activities instead.
Prerequisite: the robot machine must have the ADO.NET provider for the target database installed. Common providers:
Microsoft.Data.SqlClient— SQL Server (modern; preferred over legacySystem.Data.SqlClient)System.Data.Odbc— any ODBC-exposed sourceOracle.ManagedDataAccess.Client— OracleNpgsql— PostgreSQL (add via dependency manager)MySql.Data.MySqlClient— MySQL
Connection lifecycle
Every database workflow should follow:
DatabaseConnect— open connection, storeDatabaseConnectionin a variableExecuteQuery/ExecuteNonQuery/BulkInsert/BulkUpdate/InsertDataTable/DatabaseTransaction— use the connection viaExistingDbConnectionorDatabaseConnectionDatabaseDisconnect— close connection (put insideFinallyblock of an outerTryCatch)
Always wrap the entire block in TryCatch so DatabaseDisconnect runs even when a query fails.
DatabaseConnect
→ Use gen_database_connect() — generates correct XAML deterministically.
Opens a connection and returns a DatabaseConnection object reused by downstream activities.
Critical: use ConnectionSecureString (SecureString input), not ConnectionString. The non-secure attribute exists but triggers lint warnings because it puts the password on the canvas.
Retrieve the connection string from Orchestrator Asset via GetRobotCredential / GetRobotAsset, never hardcode it in the workflow.
DatabaseDisconnect
Self-closing. Takes a DatabaseConnection variable. Place in the Finally branch of a TryCatch so connections leak on failure are prevented.
ExecuteQuery
→ Use gen_execute_query() — generates correct XAML deterministically.
Executes a parameterized SELECT, returns a DataTable.
Always parameterize. Pass values via the Parameters dictionary — never string-concatenate user input into the SQL. The helper emits the dictionary correctly; hand-authored SQL with inline values is a lint error (SQL injection).
Connection is passed via either ExistingDbConnection (from prior DatabaseConnect) or ConnectionSecureString (ad-hoc). The two are mutually exclusive — one must be {x:Null}.
ExecuteNonQuery
→ Use gen_execute_non_query() — generates correct XAML deterministically.
Executes INSERT, UPDATE, DELETE, or DDL. Returns affected row count via AffectedRecords.
Same parameterization rule as ExecuteQuery. Same connection-exclusivity rule.
Use for single-row operations or schema changes. For many-row INSERT, prefer BulkInsert (orders of magnitude faster).
BulkInsert
Insert the entire contents of a DataTable into a target table in a single round-trip. Requires the source DataTable's column names to match the target table's column names.
JSON spec:
{
"gen": "bulkinsert",
"args": {
"db_connection_variable": "dbConn",
"table_name": "Customers",
"data_table_variable": "dt_NewCustomers",
"affected_records_variable": "intInserted"
}
}
Gotchas:
- Target table must already exist (BulkInsert does not create it).
- Identity/auto-increment columns: leave them out of the source DataTable, or configure the provider to allow explicit inserts.
- NULLs: source DataTable cells must be
DBNull.Value, not""ornull— mismatched types cause provider-specific cast errors.
BulkUpdate
Match rows in the DataTable to rows in the target table by key column(s) and update them. Best for "upsert"-style syncs where most rows are updates.
Shares the same shape as BulkInsert. Identity/auto-increment columns must map 1:1. Parameters: db_connection_variable, table_name, data_table_variable, affected_records_variable (output).
InsertDataTable
Row-by-row insert (as opposed to BulkInsert's single round-trip). Slower but works with providers where BulkInsert is unavailable (e.g., older ODBC drivers). Prefer BulkInsert first; fall back to InsertDataTable only when the provider forces it.
Same parameters as BulkInsert.
DatabaseTransaction
Executes its Body inside a single transaction. Any unhandled exception inside Body rolls back; normal completion commits. Nested queries inside the Body must use the same DatabaseConnection passed to the Transaction.
JSON spec:
{
"gen": "databasetransaction",
"args": {
"db_connection_variable": "dbConn",
"use_transaction": "True"
},
"body": [
{ "gen": "execute_non_query", "args": { "..." } },
{ "gen": "bulkinsert", "args": { "..." } }
]
}
⚠️ Generator emits an empty <Sequence DisplayName="Do" /> placeholder body. Caller must inject activities into the body — annotation-fallback does not yet wire child activities through the Body element. For complex transaction bodies, use modify_framework.py to inject or author a hand-written generator.
Common pitfalls
| Pitfall | Symptom | Fix |
|---|---|---|
| Hardcoded connection string | lint warning, security review fail | Use GetRobotCredential / GetRobotAsset; pass SecureString to ConnectionSecureString |
| Missing provider on robot | Unable to find assembly … at runtime |
Add NuGet to project.json; ensure provider installed on robot machine; see scripts/resolve_nuget.py |
| Leaked connection | idle connections accumulate, eventual "connection pool exhausted" | Put DatabaseDisconnect in Finally, not after the last query |
| SQL injection via string concat | data leak / exception | Always use Parameters dictionary |
Mixing ExistingDbConnection and ConnectionSecureString |
Studio design error, activity refuses to run | Provide exactly one; set the other to {x:Null} |
| BulkInsert into non-existent table | runtime exception | Pre-create the table via ExecuteNonQuery DDL, or at project setup time |
| DataTable schema mismatch on BulkInsert | String or binary data would be truncated, Invalid cast |
Define columns with exact target types; coerce values before populating |
Template selection
None of these activities map to golden templates — the hand-written generators (gen_database_connect, gen_execute_query, gen_execute_non_query) and data-driven generators (gen_bulkinsert, gen_bulkupdate, gen_insertdatatable, gen_databasedisconnect, gen_databasetransaction) produce the XAML directly. Reference the harvested templates under references/studio-ground-truth/UiPath.Database.Activities/2.0/ for Studio's default shape.
Open this reference as its own page
Error Handling
TryCatch, Throw/Rethrow, exception types, RetryScope.
Contents
- Try Catch
- Throw / Rethrow
- Exception Types — When to Use Which
- Common Specific Exception Types
- Exception Property Access
- Error Handling Best Practices
- Retry Scope
Try Catch
→ Use gen_try_catch() — generates correct XAML deterministically. Handles Catch block ordering, exception TypeArguments, and ActivityAction wrappers.
⚠️ TypeArguments must use xmlns prefix, never fully-qualified CLR names.
Wrong: <Catch x:TypeArguments="System.Exception"> — XAML parser cannot resolve dotted CLR names.
Right: <Catch x:TypeArguments="s:Exception"> — using the s: xmlns prefix.
Same applies to ActivityAction, DelegateInArgument, Variable, and any element with x:TypeArguments.
Common mappings: System.Exception → s:Exception, System.Data.DataTable → sd:DataTable, UiPath.Core.Activities.BusinessRuleException → ui:BusinessRuleException.
Lint 99 catches this.
Throw / Rethrow
Throw expression syntax: [New ExceptionType("message")] — always VB.NET New keyword, always wrapped in [...] brackets. The Throw activity's Exception= attribute takes a VB.NET expression that creates the exception object.
→ Use gen_throw() — generates correct XAML deterministically.
Common mistakes to avoid:
- ❌
throw new BusinessRuleException(...)— this is C# syntax, UiPath uses VB.NET - ❌
Throw New BusinessRuleException(...)— theThrowkeyword is the activity, not part of the expression - ❌
[BusinessRuleException("msg")]— missingNewkeyword - ❌
[New BRE("msg")]or[New BusinessException("msg")]— wrong type name - ❌
[New UiPath.Core.Activities.BusinessRuleException("msg")]— fully-qualified namespace, Studio cannot resolve - ❌
[New System.Exception("msg")]— same issue, use short form - ✅
[New BusinessRuleException("msg")]— correct - ✅
[New Exception("msg")]— correct for system exceptions
Notes:
Throwis self-closing (no child elements)- Inside a Catch block,
exception(or whatever theDelegateInArgumentis named) provides access to the caught exception - Common pattern: wrap in new Exception with context:
New Exception("Context message. " + exception.Message) Rethrowonly valid inside a Catch block — re-raises the caught exception with original stack trace
Exception Types — When to Use Which
BusinessRuleException (ui:BusinessRuleException)
- Data is incomplete, invalid, or violates a business rule
- Examples: missing phone digit, invalid email format, required field empty, duplicate record
- Retrying will NOT help — the data itself is the problem
- Orchestrator does NOT auto-retry queue items failed with BRE
- Action: log the issue, skip transaction, notify human user
- Throw:
[New BusinessRuleException("Phone number missing digit")] - Catch type:
<Catch x:TypeArguments="ui:BusinessRuleException">
ApplicationException (s:ApplicationException — System namespace)
- Technical/infrastructure issue — app froze, element not found, timeout, network error
- Examples: browser crash, application not responding, selector timeout, API 500 error
- Retrying MAY help — the problem could be transient
- Orchestrator WILL auto-retry queue items failed with ApplicationException (if Auto Retry = Yes on queue)
- Action: retry transaction, restart application if needed
- Throw:
[New ApplicationException("Financial app not responding")] - Catch type:
<Catch x:TypeArguments="s:ApplicationException"> - Requires:
xmlns:s="clr-namespace:System;assembly=System.Private.CoreLib"
System.Exception (s:Exception)
- Generic catch-all — catches both BRE and ApplicationException
- Use as the last Catch block to handle unexpected errors
- In REFramework SetTransactionStatus: determines retry behavior based on exception type
Catch block ordering rule: Most specific first, most general last.
<TryCatch.Catches>
<!-- 1. Business rule issues (no retry) -->
<Catch x:TypeArguments="ui:BusinessRuleException">...</Catch>
<!-- 2. Application/technical issues (may retry) -->
<Catch x:TypeArguments="s:ApplicationException">...</Catch>
<!-- 3. Catch-all for anything unexpected -->
<Catch x:TypeArguments="s:Exception">...</Catch>
</TryCatch.Catches>
REFramework SetTransactionStatus decision logic:
Exception caught
├─ Is BusinessRuleException?
│ ├─ Yes → Set status = Failed (BRE), log, move to next transaction
│ └─ No → Is retry limit reached?
│ ├─ Yes → Set status = Failed (Application), log, restart apps
│ └─ No → Increment retry counter, restart apps, retry same transaction
Common Specific Exception Types
| Exception | Namespace | Typical Cause | Action |
|---|---|---|---|
ui:BusinessRuleException |
ui: |
Invalid data, business rule violation | Skip transaction, notify |
s:ApplicationException |
s: |
App crash, infra failure | Retry, restart app |
s:TimeoutException |
s: |
Operation exceeded time limit | Retry with longer timeout |
s:NullReferenceException |
s: |
Accessing null variable/object | Fix logic, add null checks |
s:ArgumentException |
s: |
Invalid argument to method | Fix input data/logic |
s:FormatException |
s: |
Parse failure (CInt, CDate on bad data) | Validate input first |
s:IO.IOException |
s: |
File locked, disk full, path not found | Retry, check permissions |
s:Net.WebException |
s: |
HTTP request failed, DNS error | Retry with backoff |
UiPath-specific (from uix: namespace):
- Selector not found → caught as generic
s:Exceptionwith message containing "selector" - Element not interactable → usually
s:Exceptionfrom UI automation
Exception Property Access
' In Catch block, the exception variable (e.g., "exception") has:
exception.Message ' Error description
exception.GetType.Name ' "BusinessRuleException", "ApplicationException"
exception.Source ' Assembly that threw
exception.StackTrace ' Full stack trace
exception.InnerException ' Nested exception (can be Nothing)
exception.InnerException?.Message ' Safe inner message access (C# only)
' VB.NET safe inner exception
If(exception.InnerException IsNot Nothing, exception.InnerException.Message, "")
' Check exception type in expressions (e.g., in If condition)
TypeOf exception Is BusinessRuleException
TypeOf exception Is ApplicationException
Error Handling Best Practices
1. Where to put TryCatch:
- Around individual risky operations (API calls, file operations, UI interactions)
- NOT around the entire Process.xaml — that's REFramework's job
- Around groups of related steps that should fail together
2. When to Rethrow vs handle:
- In Process.xaml: Rethrow — let REFramework handle retry/status logic
- In utility workflows: Rethrow with context —
Throw New ApplicationException("Failed to login: " + exception.Message, exception) - In non-REFramework: Handle locally if you have recovery logic
3. Logging pattern:
' Always include: what failed + exception message + relevant context
"[ERROR] Failed to process invoice " + strInvoiceId + ": " + exception.Message
"[ERROR] API call failed for endpoint " + strEndpoint + " - Status: " + intStatusCode.ToString + " - " + exception.Message
4. Throw with inner exception (preserves stack trace):
→ Use gen_throw() — generates correct XAML deterministically.
The second parameter wraps the original exception as InnerException.
Retry Scope
→ Use gen_retryscope() — generates correct XAML deterministically.
Properties:
NumberOfRetries— max retry attempts (default: 3). Omit to use defaultRetryInterval— delay between retries. Generator omits this (uses Studio default)LogRetriedExceptions="{x:Null}"— suppress retry exception logging- Condition uses
ActivityFunc x:TypeArguments="x:Boolean"(NOTActivityAction) ui:CheckTrue Expression="[...]"— VB.NET boolean expression. If False, retry continues
Empty condition variant — retry on any exception, no success check:
→ Use gen_retryscope() — generates correct XAML deterministically.
Use empty condition when you just want to retry on exception without validating a result.
Best practice — Navigation retry with NCheckState condition:
When retrying UI navigation, use NCheckState inside the Condition to verify the target page actually loaded. This is better than empty condition because it catches silent navigation failures (page didn't load but no exception thrown).
⛔ The element in NCheckState must be the FIRST element the next workflow will interact with (click, type into, get text, etc.) — NOT a generic page title or header. This guarantees the page is ready for the next action. Example: if the next step types into a search box, check for that search box; if the next step clicks an "Update" button, check for that button.
→ Use gen_ncheckstate() — generates correct XAML deterministically.
Use this pattern for: navigation retries, login verification (check for first dashboard element to interact with), page load confirmations. The NCheckState returns True if the element is found (success = stop retrying) or False if not found (keep retrying). Always target the first element the next workflow step will interact with — never a generic header or page title.
Common pattern — RetryScope wrapping TryCatch:
→ Use gen_retryscope() with gen_try_catch() nested inside — generates correct XAML deterministically.
⚠️ ALWAYS wrap API-interacting activities in RetryScope. Any activity that makes a network/API call can fail due to transient issues (timeouts, rate limits, DNS, connectivity). This includes:
NetHttpRequest(HTTP Request) — REST/SOAP callsAddQueueItem— Orchestrator API behind the scenesGetQueueItem/SetTransactionStatus— Orchestrator APIGetRobotAsset/GetRobotCredential— Orchestrator APIQueryEntityRecords(Data Service) — Orchestrator API- Any Integration Service activity — external API calls
SendMail/GetMailMessages— SMTP/IMAP connections
Use empty condition (retry on any exception) for simple cases, or add a Condition with CheckTrue when you need to validate the response. Default: NumberOfRetries="3", RetryInterval omitted (Studio default). If you need custom intervals for external APIs with rate limits, set manually in Studio.
Exception: Activities already inside REFramework's Process.xaml — the framework's own retry mechanism (via SetTransactionStatus → Retry) handles transaction-level retries. But if Process.xaml makes multiple API calls, each individual call should still be wrapped in its own RetryScope to handle transient failures within a single transaction attempt.
Open this reference as its own page
XAML Foundations
File structure, namespaces, core activities (Assign, Log, InputDialog, MessageBox, Delay), variables & arguments.
Contents
- XAML File Structure
- Namespace Declarations
- Core Activities
- Variable and Argument Declarations
- Control Flow Activities
XAML File Structure
Every UiPath XAML workflow has: root <Activity> element with x:Class and xmlns declarations, optional TextExpression.NamespacesForImplementation / ReferencesForImplementation, then a <Sequence> body with variables and activities. generate_workflow.py builds this entire structure from a JSON spec — never hand-write the skeleton.
⚠️ CRITICAL — Sequence child element order: Inside any <Sequence>, the order MUST be: (1) <sap:WorkflowViewStateService.ViewState> (optional), (2) <Sequence.Variables> (optional), (3) child activities. Placing <Sequence.Variables> after any child activity causes XamlDuplicateMemberException: 'Activities' property has already been set on 'Sequence' because the XAML parser opens the implicit Activities collection for the first child and cannot reopen it after Variables. Same rule applies to <Flowchart.Variables> inside <Flowchart>.
Collection type variants: Studio exports use two interchangeable collection types for namespace/reference lists:
sco:Collection x:TypeArguments="x:String"—xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=System.Private.CoreLib"(more common)scg:List x:TypeArguments="x:String" Capacity="N"—xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System.Private.CoreLib"(includesCapacityhint)
Both work identically at runtime. Note the assembly may be mscorlib or System.Private.CoreLib depending on the .NET version — both are valid. Match what the project's existing files use.
C# vs VB.NET Expression Mode
For VB.NET (legacy default), expressions use VisualBasicValue/VisualBasicReference. For C#, use CSharpValue/CSharpReference with xmlns:mca="clr-namespace:Microsoft.CSharp.Activities;assembly=System.Activities". The generators handle expression mode internally.
XAML Attribute Encoding Rules
XML encoding in attribute values:
"→"(inside VB.NET string literals)&→&<→<,>→>- Newlines →

, tabs →	
⚠️ CRITICAL — Curly brace escape for JSON/literal values:
When an attribute value starts with {, XAML interprets it as a markup extension (like {x:Null}, {Binding}). If the value is actually a literal string (e.g., JSON), Studio crashes with:
Quote characters ' or " are only allowed at the start of values
Fix: Prefix with {} (empty curly braces = "treat rest as literal"):
<!-- WRONG — XAML parser crash -->
FormLayout="{"components":[...]}"
<!-- CORRECT — {} escape prefix -->
FormLayout="{}{"components":[...]}"
This applies to ANY attribute whose value starts with { but is NOT a XAML markup extension. Most commonly: FormLayout (Tasks forms) and any attribute holding inline JSON.
Namespace Declarations
generate_workflow.py handles all xmlns declarations automatically based on which activities are used. The sd: prefix is resolved via Option B strategy: sd=Data when DataTable is present, sd=Drawing for UI-only, sd=Data + sdd=Drawing when both are needed. Never hand-write namespace declarations.
Core Activities
Assign
→ Use gen_assign() — generates correct XAML deterministically.
Note: DisplayName is optional on Assign. Type in x:TypeArguments must match the variable type.
⚠️ CRITICAL — Assign.Value and Assign.To child types: <Assign.Value> MUST contain <InArgument x:TypeArguments="..."> and <Assign.To> MUST contain <OutArgument x:TypeArguments="...">. Never use a bare <x:String>, <x:Int32>, <Literal>, or plain text. Doing so causes: Type 'x:String' is not assignable to type 'InArgument' of member 'Value'. Always use gen_assign() to avoid this.
Multiple Assign
Assigns multiple variables in a single activity. Uses ui:AssignOperation list.
→ Use gen_multiple_assign() — generates correct XAML deterministically.
Properties:
- Each
ui:AssignOperationhas.To(OutArgument) and.Value(InArgument), same structure as regular Assign - ⚠️ MUST use element syntax —
<ui:AssignOperation.To><OutArgument x:TypeArguments="x:String">[var]</OutArgument></ui:AssignOperation.To>. The attribute shorthandTo="[var]" Value="[expr]"does NOT work — Studio throwsx:String is not assignable to OutArgument. Capacityattribute on the list should match or exceed the number of operations- More compact than multiple separate Assign activities — good for initializing or resetting several variables at once
- ⛔ HALLUCINATION TRAP:
MultipleAssign.Body,ActivityAction,AssignOperationSet,MultipleAssignBody,AssignItemdo NOT exist. The ONLY valid child is.AssignOperations>scg:List>ui:AssignOperation. Lint 52 catches this.
Nullable Types in AssignOperations
Data Service entity fields use Nullable(Of T) with s: prefix in the value_type param of gen_multiple_assign(): s:Nullable(x:Boolean), s:Nullable(x:Decimal), s:Nullable(x:Int32), s:Nullable(x:Int64), s:Nullable(x:DateTime).
Literal Empty String (Explicit Empty Value)
Studio serializes explicit "" as a Literal child inside InArgument. The gen_multiple_assign() generator handles this when the value expression is "".
Log Message
→ Use gen_logmessage() — generates correct XAML deterministically.
Input Dialog (Text)
Shows a dialog with a text field. Result is always String.
→ Use gen_input_dialog() — generates correct XAML deterministically.
Input Dialog (Dropdown)
Shows a dialog with a dropdown list. Options are semicolon-separated in OptionsString. Options stays {x:Null} (do NOT use VB arrays).
→ Use gen_input_dialog() — generates correct XAML deterministically.
Properties:
Label— prompt text displayed to the userTitle— dialog window titleIsPassword— masks input (True/False)OptionsString— semicolon-separated dropdown options;{x:Null}for text inputOptions— always{x:Null}(legacy, do NOT use VB array expressions)TopMost— keep dialog above other windows (True/False)Result— must use child element syntax (not inline attribute). Generator handles this.
Message Box
→ Use gen_message_box() — generates correct XAML deterministically.
Properties:
Caption— window title (optional, null for default)Text— body text (VB.NET expression)ChosenButton— OutArgument to capture which button was clickedAutoCloseAfter— TimeSpan, "00:00:00" = no auto-close
Comment Out
Wraps activities to disable them without deleting. The wrapped activities are not executed.
→ Use gen_comment_out() — generates correct XAML deterministically.
Delay
→ Use gen_delay() — pass seconds as integer. Expression: TimeSpan.FromSeconds(N).
Comment
→ Use gen_comment() — generates correct XAML deterministically.
Variable and Argument Declarations
Variables (inside Sequence.Variables or Flowchart.Variables)
Naming: camelCase with type prefix. See SKILL.md → Naming Conventions for full prefix table. Use the variables array in the JSON spec for generate_workflow.py — type shortcuts: String, Int32, Boolean, DataTable, SecureString, UiElement, Dictionary, Array_String, QueueItem.
⚠️ CRITICAL — Array types: x:String[] is INVALID — the x: namespace has no array support. Use s:String[]. The generators auto-normalize these types. Lint 93 catches this.
<!-- WRONG: x:String[] does not exist -->
<Variable x:TypeArguments="x:String[]" Name="arrLines" />
<!-- CORRECT: s:String[] with xmlns:s declared on root Activity -->
<Variable x:TypeArguments="s:String[]" Name="arrLines" />
Complex defaults — pass a default value in the variables spec (e.g., "new DataTable", "new List(Of String)"). The generator wraps it in VisualBasicValue.
Arguments (at Activity level, before the main Sequence)
Naming: {direction}_{typePrefix}{Name} — direction prefix (in_, out_, io_) + type prefix + descriptive name. Use the arguments array in the JSON spec for generate_workflow.py.
⚠️ DataTable prefix is NOT always
sd. The prefix depends on the file's xmlns declarations.generate_workflow.pyresolves this automatically via Option B strategy. Lint 87 catches wrong prefix usage.
Control Flow Activities
Open this reference as its own page
App Integrations
Excel Classic Workbook (ReadRange, WriteRange, WriteCell), Email/Integration Service (GetIMAPMailMessages, SendMail, SaveMailAttachments), PDF (ReadPDFText, ReadPDFWithOCR, native+OCR fallback), Database (DatabaseConnect, ExecuteQuery, ExecuteNonQuery), Screenshot (TakeScreenshot, SaveImage).
Contents
- Read Range (Workbook)
- Write Range (Workbook)
- Common Excel Pattern — Read, Process, Write
- Write Cell (Workbook)
- Email Activities (Integration Service)
- PDF Activities
- Database Activities
- Screenshot Activities
- Modern UI Automation (uix: namespace)
These are the classic workbook activities (ui: namespace) — they work without Excel installed, operating directly on .xlsx files. For Modern Excel activities (UseExcelFile), see separate section below.
Read Range (Workbook)
→ Use gen_read_range() — generates correct XAML deterministically.
Properties:
WorkbookPath— VB.NET expression for file path:[str_ExcelFilePath]or["C:\path\file.xlsx"]SheetName— VB.NET expression:[str_Sheet]or["Sheet1"]Range="{x:Null}"— reads entire sheet. Or specify range:Range="A1:D100"AddHeaders="True"— first row becomes column names in DataTableDataTable="[dt_Output]"— output DataTable variableWorkbookPathResource="{x:Null}"— no linked resource file
Write Range (Workbook)
→ Use gen_write_range() — generates correct XAML deterministically.
Properties:
WorkbookPath— output file path. Creates file if it doesn't existSheetName— can be literal string"Sheet1"or VB expression[str_Sheet]StartingCell="{x:Null}"— writes from A1. Or specify:StartingCell="B2"DataTable="[dt_Input]"— DataTable to write
Common Excel Pattern — Read, Process, Write
Bulk write (preferred for performance): Read → process into DataTable → WriteRange once.
→ Use gen_read_range() + processing logic + gen_write_range() — generates correct XAML deterministically.
Per-cell write (simpler but slower): WriteCell inside a loop. Opens/closes file each call — avoid for large datasets. Use AddDataRow + WriteRange instead.
Write Cell (Workbook)
→ Use gen_write_cell() — generates correct XAML deterministically.
Properties:
Cell— VB.NET expression for cell address. Dynamic:["F"+intRow.ToString]builds "F2", "F3", etc. Static:"A1"Text— value to write (VB.NET expression)SheetName— target sheet name (literal string)WorkbookPath— path to the workbook (VB.NET expression)- Performance note: Each WriteCell call opens and closes the file. For writing multiple cells per row, prefer building a DataRow and using AddDataRow + a single WriteRange at the end
Email Activities (Integration Service)
Requires UiPath.Mail.Activities package. Uses Orchestrator Integration Service connections — no Outlook Desktop dependency. The generators handle all required xmlns declarations (umae:, umame:, usau:, snm:) automatically.
⚠️ Do NOT use Outlook-specific activities: OutlookApplicationCard, ForEachEmailX, GetOutlookMailMessages, MoveOutlookMessage, SendOutlookMailMessage. These require Outlook Desktop installed and are not portable. Use ui:SendMail (SMTP via Integration Service) instead of SendOutlookMailMessage.
Get IMAP Mail Messages (GetIMAPMailMessages)
Retrieves emails via Integration Service IMAP connection. Works with any email provider (Gmail, Outlook 365, Exchange) configured in Orchestrator Integration Service. Supports folder access, server-side filtering, and unread/read state.
→ Use gen_get_imap_mail() — generates correct XAML deterministically.
Properties:
Messages— OutArgument receivingList(MailMessage)ConnectionMode="IntegrationService"+UseISConnection="True"— Orchestrator Integration Service connection (no hardcoded credentials)MailFolder— IMAP folder name (e.g."Inbox","Sent","Archive")Top— max number of emails to retrieveOnlyUnreadMessages— filter to unread onlyOrderByDate—"NewestFirst"or"OldestFirst"FilterExpression— IMAP search filter (e.g."SUBJECT \"Invoice\"","FROM \"noreply@example.com\"")FilterExpressionCharacterSet—"US-ASCII"(default)SecureConnection—"Auto","SSL", or"None"- The
ConnectionDetailsBackupSlotblock is required boilerplate for Integration Service mode
For Each Email (loop pattern)
Use ui:ForEach with TypeArguments="snm:MailMessage" to iterate the retrieved mail list. Requires xmlns:snm="clr-namespace:System.Net.Mail;assembly=System.Net.Mail".
→ Use gen_foreach() with item_type="snm:MailMessage" — generates correct XAML deterministically.
Notes:
- The delegate variable name (
currentMailMessage) is used in expressions inside the loop Valuespoints to theList(MailMessage)output from GetIMAPMailMessages- This is a standard
ui:ForEachwith typed argument — same pattern works for anyList(T)
Send Mail (SendMail)
Sends email via Integration Service SMTP connection.
→ Use gen_send_mail() — generates correct XAML deterministically.
Properties:
To,Cc,Bcc— recipient addresses (comma-separated for multiple)Subject,Body— email contentIsBodyHtml— set True for HTML bodyResourceAttachments—String[]array of file paths to attachAttachmentInputMode="Existing"— attach files from diskConnectionMode="IntegrationService"+UseISConnection="True"— Integration Service connection- The
AttachmentsBackup,ConnectionDetailsBackupSlot, andFileschild elements are required boilerplate
Additional namespace for SendMail attachments:
xmlns:umame="clr-namespace:UiPath.MicrosoftOffice365.Activities.Mail.Enums;assembly=UiPath.Mail.Activities"
MailMessage Properties (in expressions)
CurrentMail.Subject ' Email subject line
CurrentMail.Body ' Email body (HTML if HTML email)
CurrentMail.From.Address ' Sender email address
CurrentMail.From.DisplayName ' Sender display name
CurrentMail.To(0).Address ' First recipient
CurrentMail.CC ' CC recipients collection
CurrentMail.Attachments(0).Name ' First attachment filename
CurrentMail.Headers("Date") ' Email date header
CurrentMail.IsBodyHtml ' Boolean
Save Mail Attachments (SaveMailAttachments)
Saves email attachments to disk in a single activity. Use this instead of manual InvokeCode with FileStream.
→ Use gen_save_mail_attachments() — generates correct XAML deterministically.
Variable for Attachments output: type scg:IEnumerable(x:String), name list_Attachments. Declare in the JSON spec variables array with type "scg:IEnumerable(x:String)".
Properties:
Message— the MailMessage to extract attachments from (e.g.[in_mmMail])FolderPath— destination folder pathFilter— wildcard filter:"*.pdf","*.xlsx","*.*"(all). Leave empty or"*.*"for all attachmentsAttachments— (optional) output receiving saved file paths. ⚠️ Type isIEnumerable(x:String), NOTList(String).ExcludeInlineAttachments— skip embedded images (usually False)OverwriteExisting— overwrite if file exists
⚠️ Do NOT use InvokeCode to manually save attachments. SaveMailAttachments handles file streams, naming conflicts, and filtering in a single activity.
PDF Activities
Requires UiPath.PDF.Activities package. Add namespace xmlns:ui="http://schemas.uipath.com/workflow/activities" (same as core activities — PDF activities are in the ui: prefix). Also needs these assembly references:
<AssemblyReference>UiPath.PDF.Activities</AssemblyReference>
And these namespace imports:
<x:String>UiPath.PDF.Activities</x:String>
Read PDF Text (native/digital PDFs)
Extracts text from native (digitally-created) PDF files. Fast and accurate but returns empty string for scanned/image PDFs.
→ Use gen_read_pdf_text() — generates correct XAML deterministically.
Properties:
FileName— VB.NET expression for the PDF file path (e.g.,[CurrentFile.FullName])Text— output variable to receive extracted text (String)Range— page range:"All","1","1-3","1,3,5"PreserveFormatting="{x:Null}"— default; set toTrueto keep original layout spacing
Read PDF With OCR (scanned/image PDFs)
Extracts text from scanned PDFs using an OCR engine. Slower than ReadPDFText but works on image-based PDFs. Uses an ActivityFunc delegate pattern for the OCR engine — this is a real export structure, not simplified.
Requires both UiPath.PDF.Activities AND UiPath.UIAutomation.Activities (the Tesseract OCR engine ui:GoogleOCR lives in UIAutomation).
→ Use gen_read_pdf_with_ocr() — generates correct XAML deterministically.
Properties:
FileName,Range,Text— same as ReadPDFTextImageDpi— DPI for rendering pages to images before OCR (default300, lower = faster but less accurate;150is a common tradeoff)DegreeOfParallelism—-1for automatic threading, or a specific number- OCR Engine delegate pattern: The
.OCREnginechild usesActivityFuncwith specific type arguments that include System.Drawing types. This requires these namespaces:xmlns:sd="clr-namespace:System.Drawing;assembly=System.Drawing.Common"xmlns:sd1="clr-namespace:System.Drawing;assembly=System.Drawing.Primitives"
- OCR engine element: Despite the class name
ui:GoogleOCR, theDisplayNamemay say"Tesseract OCR"— UiPath reuses this element for both engines. TheProfileattribute controls the engine mode - Package:
ui:GoogleOCR(Tesseract) is part ofUiPath.UIAutomation.Activities— this package MUST be added to project.json for the OCR engine to work.UiPath.OCR.Activitiesis a separate package for advanced OCR engines (OmniPage, Google Cloud Vision, Microsoft OCR) used in Document Understanding workflows Image="[Image]"— must reference the delegate argument nameImage
Common PDF Pattern — Native + OCR Fallback
Standard pattern: try ReadPDFText first, if result is empty (scanned PDF), fall back to ReadPDFWithOCR:
→ Use gen_read_pdf_text() + gen_if() + gen_read_pdf_with_ocr() — compose the fallback chain.
Notes:
- Different regex patterns may be needed for native vs scanned PDFs (different text formatting)
String.IsNullOrEmpty()is the only correct check — ReadPDFText returns empty string (not Nothing) for scanned PDFs- ⚠️ Do NOT add length checks like
OrElse strText.Length < 50— short text is legitimate (cover pages, one-line invoices). Only truly scanned PDFs return empty/null. - For bulk extraction, combine with ForEachFileX + BuildDataTable + AddDataRow + WriteRange
Database Activities
Requires NuGet: UiPath.Database.Activities. Namespace: xmlns:ui="http://schemas.uipath.com/workflow/activities" (same as core activities).
⚠️ Do NOT use InvokeCode with SqlConnection/SqlClient for database operations. Use the dedicated database activities below — they handle connection pooling, parameterized queries, and proper disposal.
DatabaseConnect
{
"gen": "database_connect",
"args": {
"connection_variable": "secstrConnectionString",
"output_variable": "dbConnection"
}
}
Properties:
provider—"Microsoft.Data.SqlClient"(default, SQL Server),"System.Data.Odbc"(ODBC),"Oracle.ManagedDataAccess.Client"(Oracle)connection_variable— connection string as SecureString (from GetRobotCredential or asset)output_variable— outputDatabaseConnectionvariable for reuse in ExecuteQuery/ExecuteNonQuery
ExecuteQuery (SELECT → DataTable)
{
"gen": "execute_query",
"args": {
"sql": "SELECT * FROM ProcessLog WHERE Status = @status",
"output_variable": "dt_Output",
"connection_string_variable": "secstrConnectionString",
"parameters": [{"name": "status", "type": "x:String", "value": "[strStatus]"}]
}
}
Properties:
sql— SQL query string (use@paramNamefor parameterized queries)output_variable— output DataTable variableconnection_variable— reuse aDatabaseConnectoutput (alternative toconnection_string_variable)parameters— typed params for parameterized queries (prevents SQL injection)
ExecuteNonQuery (INSERT/UPDATE/DELETE)
{
"gen": "execute_non_query",
"args": {
"sql": "INSERT INTO ProcessLog (Amount, ProcessedAt) VALUES (@amt, GETDATE())",
"connection_variable": "dbConnection",
"parameters": [{"name": "amt", "type": "x:Decimal", "value": "[dblAmount]"}]
}
}
Properties:
sql— INSERT/UPDATE/DELETE statement with@paramNameplaceholdersaffected_records_variable— (optional) Int32 output of rows affectedconnection_variable— reuse DatabaseConnect output for multiple operations in same connection
Screenshot Activities
Requires NuGet: UiPath.UIAutomation.Activities. These activities use the ui: namespace (xmlns:ui="http://schemas.uipath.com/workflow/activities").
TakeScreenshot + SaveImage
For error screenshots, use the built-in TakeScreenshot + SaveImage activities. In REFramework projects, call Framework/TakeScreenshot.xaml via InvokeWorkflowFile.
⚠️ Do NOT use InvokeCode with System.Drawing.Graphics.CopyFromScreen. The activities handle DPI scaling, multi-monitor setups, and memory disposal correctly.
{
"gen": "take_screenshot_and_save",
"args": {
"screenshot_variable": "imgScreenshot",
"save_path_variable": "strScreenshotPath"
}
}
Properties:
screenshot_variable— intermediateui:Imagevariable (declare as variable typeui:Image)save_path_variable— file path to save the screenshot-Target—{x:Null}selector captures full screen; provide a selector for specific window/elementSaveImage.FileName— output file path (.pngrecommended)SaveImage.Image— theui:Imagefrom TakeScreenshot
Modern UI Automation (uix: namespace)
Open this reference as its own page
Invoke Activities
InvokeWorkflowFile, InvokeCode, InvokeMethod.
Contents
Invoke Workflow File
→ Use gen_invoke_workflow() — generates correct XAML deterministically.
Notes:
ArgumentsVariable="{x:Null}"— always present in real exports (legacy compatibility)x:Keymust exactly match the argument name defined in the invoked workflow- Arguments can be
InArgument,OutArgument, orInOutArgument - Complex types supported:
njl:JObject,scg:List(x:String),sd:DataTable, custom entity types WorkflowFileName— relative path from project root (e.g.,"Subfolder\MyWorkflow.xaml")UnSafe="False"— default;Trueallows running in isolated context
⚠️ Out/InOut arguments MUST have variable bindings. <OutArgument ... x:Key="io_uiBrowser" /> (self-closing, no value) or <OutArgument ...>[]</OutArgument> means the output is silently lost. Always bind: <OutArgument ...>[myVariable]</OutArgument>. Also ensure direction matches argument name prefix: io_ → InOutArgument, out_ → OutArgument, in_ → InArgument. Lint 55.
Invoke Code
Executes inline VB.NET or C# code within the workflow. Used for multi-statement logic that doesn't fit in a single expression (loops, algorithms, complex transformations).
⚠️ When NOT to use InvokeCode — prefer MultipleAssign instead:
InvokeCode is overused. If the code is just assigning expression results to variables (even complex ones like Regex matches, LINQ queries, GroupBy aggregations), use Assign or MultipleAssign with inline VB expressions. LINQ queries like .AsEnumerable().Where(), .GroupBy(), .Select(), .OrderBy() all work as Assign values. InvokeCode should only be used when you need procedural control flow inside the code block (loops, Using statements, Try/Catch, multi-step algorithms that can't be expressed as a single expression).
⚠️ When NOT to use InvokeCode — DataTable setup belongs in activities: Never create a DataTable and add columns inside InvokeCode. Use the activity-based approach:
- Initialize — variable
Defaultattribute:<mva:VisualBasicValue x:TypeArguments="sd:DataTable" ExpressionText="new DataTable" /> - Add columns — one
AddDataColumnactivity per column (seexaml-data.md) - Business logic — Assign/MultipleAssign with LINQ expressions, or SortDataTable/FilterDataTable activities
❌ Wrong — InvokeCode doing everything (schema + logic):
Code="Dim dt As New DataTable()
dt.Columns.Add("Country", GetType(String))
dt.Columns.Add("Amount", GetType(Decimal))
...business logic..."
✅ Right — activities for setup, Assign for LINQ logic:
- Variable:
dt_Summarywith Defaultnew DataTable - AddDataColumn × N (one per column)
- Assign:
dt_Summary = dt_Raw.AsEnumerable().GroupBy(Function(r) r("Country").ToString).Select(Function(g) ...).CopyToDataTable() - SortDataTable for ordering (chain for multi-column)
❌ Wrong — InvokeCode just to do regex extractions:
Code="Dim m = Regex.Match(body, pattern)
out_strVendor = If(m.Success, m.Groups(1).Value, "N/A")"
✅ Right — MultipleAssign with inline expressions:
→ Use gen_multiple_assign() — generates correct XAML deterministically.
✅ Right — InvokeCode for actual procedural logic (loops, using, multi-step):
Code="Using fs As New IO.FileStream(path, IO.FileMode.Create)
 stream.CopyTo(fs)
End Using"
→ Use gen_invoke_code() — generates correct XAML deterministically.
Key properties:
Language—"CSharp"or"VBNet". Determines code syntaxCode— inline code string. In XAML, newlines are
, tabs are	,<is<,>is>,"is"- Arguments work the same as InvokeWorkflowFile:
InArgument,OutArgument,InOutArgument ContinueOnError="{x:Null}"— standard; setTrueto swallow exceptions- No return statement — assign results to
OutArgumentvariables directly
Code String Encoding
The Code attribute contains the full code body as an XML-encoded string:
// C# source code:
if (x > 0) { result = "positive"; }
// Encoded in XAML Code attribute:
Code="if (x > 0) { result = "positive"; }"
Multi-line code uses 
 for line breaks:
Code="int count = 0;
foreach (string s in list_items)
{
 count++;
}
out_count = count;"
Argument Type Patterns
<!-- Simple types -->
<InArgument x:TypeArguments="x:String" x:Key="str_param">[strVar]</InArgument>
<InArgument x:TypeArguments="x:Int32" x:Key="int_param">[intVar]</InArgument>
<InArgument x:TypeArguments="x:Boolean" x:Key="bool_param">[boolVar]</InArgument>
<InArgument x:TypeArguments="x:Double" x:Key="dbl_param">[dblVar]</InArgument>
<!-- Collections -->
<InArgument x:TypeArguments="scg:List(x:String)" x:Key="list_param">[listVar]</InArgument>
<InArgument x:TypeArguments="scg:Dictionary(x:String, x:Object)" x:Key="dict_param">[dictVar]</InArgument>
<!-- Complex types -->
<OutArgument x:TypeArguments="scg:KeyValuePair(x:String, x:Double)" x:Key="kvp_result">[kvpVar]</OutArgument>
<InOutArgument x:TypeArguments="sd:DataTable" x:Key="dt_data">[dtVar]</InOutArgument>
Real Example: Levenshtein Distance (C#)
Fuzzy string matching — finds best match from a reference list against lines in a document.
Shows: nested loops, 2D arrays, early exit, KeyValuePair construction, Math operations.
→ Use gen_invoke_code() — generates correct XAML deterministically.
Notes on this example:
- InArgument variables can be modified inside the code (
list_refToMatch.ConvertAllmutates the input) - OutArgument
key_bestMatchis assigned at the end — this is how results flow back to the workflow - KeyValuePair used as a simple tuple:
Key= matched reference,Value= similarity percentage - Similarity formula:
100 - (editDistance / referenceLength * 100)→ 100% = exact match - Sliding window technique: when line is longer than reference, slides a window of reference length across the line to find best substring match
When to Use Invoke Code vs Expressions
| Scenario | Use |
|---|---|
| Single-line calculation | Expression (in Assign) |
| LINQ query (Where, Select, GroupBy, OrderBy) | Assign / MultipleAssign — never InvokeCode |
| Sorting a DataTable | SortDataTable activity — never InvokeCode |
| Multi-statement logic, loops, Using blocks | Invoke Code |
| Algorithm with complex state | Invoke Code |
| String manipulation pipeline | Expression if ≤3 chained methods, Invoke Code if more |
| Modifying a DataTable in-place (row-level loop) | Invoke Code (InOutArgument) |
| Calling a void method (Add, Clear) | Invoke Method |
Invoke Method
Calls a method on an object or a static method on a type. Useful when you need to call a void method that can't be used in an Assign expression (e.g., JArray.Add(), List.Sort(), DataTable.AcceptChanges()).
⛔ Do NOT write InvokeMethod XAML by hand. Use
gen_invoke_method()viagenerate_workflow.py.
Instance Method Call
{
"gen": "invoke_method",
"args": {
"method_name": "Add",
"target_object": "jArrItems",
"target_object_type": "njl:JArray",
"parameters": [{"type": "njl:JObject", "value": "[jObjNewItem]"}],
"display_name": "Invoke Method (Append to JArray)"
}
}
Key properties:
method_name— the method to call (e.g.,"Add","Sort","Clear","Remove")target_object+target_object_type— instance method on a variableparameters— positional InArguments passed to the method- No return value capture — for void methods only. Use Assign for methods that return values
Static Method Call
{
"gen": "invoke_method",
"args": {
"method_name": "Copy",
"target_type": "sio:File",
"parameters": [
{"type": "x:String", "value": "[strSourcePath]"},
{"type": "x:String", "value": "[strDestPath]"},
{"type": "x:Boolean", "value": "[True]"}
],
"display_name": "Invoke Static Method"
}
}
target_type— the type containing the static method (instead oftarget_object)- Parameters listed as positional typed arguments
Common Use Cases
| Call | What it does |
|---|---|
JArray.Add(JObject) |
Append JSON object to array |
List.Sort() |
In-place sort |
List.Clear() |
Remove all items |
DataTable.AcceptChanges() |
Commit row changes |
File.Copy(src, dst, overwrite) |
Static file copy |
Directory.CreateDirectory(path) |
Static directory creation |
Open this reference as its own page
Orchestrator & Services
GetRobotAsset, GetRobotCredential, AddQueueItem, GetQueueItem, SetTransactionStatus, HTTP Request. Tasks (CreateFormTask, WaitForFormTask) → decoupled to uipath-tasks skill.
Contents
- Get Robot Asset (GetRobotAsset)
- Get Credential (GetRobotCredential)
- Add Queue Item (AddQueueItem)
- Get Queue Item (GetQueueItem)
- Set Transaction Status (SetTransactionStatus)
- HTTP Request (NetHttpRequest)
- Tasks Activities (Form Tasks) → Decoupled to uipath-tasks skill
Get Robot Asset (GetRobotAsset)
Retrieves a non-credential config value from Orchestrator (URLs, folder paths, feature flags, thresholds).
→ Use gen_get_robot_asset() — generates correct XAML deterministically.
Properties:
AssetName— name of the Orchestrator asset (string literal, not VB expression)CacheStrategy:None(always fetch),PerRobot,GlobalTimeoutMS="{x:Null}"— no timeout (use default)- Output: element syntax
.ValuewithOutArgument— type matches asset type:x:String,x:Int32,x:Boolean - ⚠️ Output property is
.Value(element syntax), NOTResult.Resultdoes not exist — Studio crashes withCould not find member 'Result'. Must use:<ui:GetRobotAsset.Value><OutArgument x:TypeArguments="x:String">[var]</OutArgument></ui:GetRobotAsset.Value>
⚠️ Do NOT use GetRobotAsset for credentials (passwords, API keys, secrets, tokens). Use GetRobotCredential instead — it stores secrets as SecureString and returns username + password in a single call from a Credential asset type.
Get Credential (GetRobotCredential)
Use for any credential pair: login credentials, API client ID + secret, tokens, service accounts. Returns Username (String) + Password (SecureString) from a single Orchestrator Credential asset.
→ Use gen_getrobotcredential() — generates correct XAML deterministically.
⚠️ CRITICAL — common hallucinations:
Result=does NOT exist on this activity — Studio crashes with "Could not find member 'Result'". UsePassword=andUsername=attributes directly.- Password is SecureString — the variable must be declared as
ss:SecureString, notx:String. UseSecureText=(notText=) on NTypeInto for password fields. - Retrieve inside NApplicationCard (minimal scope) — do NOT place GetRobotCredential outside the browser/app session. See golden sample
WebAppName_Launch.xaml. - Wrap in RetryScope — Orchestrator API calls can transiently fail. See golden sample.
- AssetName from argument — pass
in_strCredentialAssetNamefrom Config, never hardcodeAssetName="WebApp_Credential".
Properties:
AssetName— Orchestrator Credential asset name (string literal or VB expression)Username— OutArgumentx:String(e.g. API client ID, login username, service account)Password— OutArgumentSecureString(e.g. API secret, password, token)CacheStrategy:None(always fetch),Execution(cache per run),Global- Password is SecureString — convert to plain text only when needed:
New System.Net.NetworkCredential("", secstrPassword).Password
Examples of what goes in Credential assets:
- Login credentials → Username =
"user@example.com", Password = password - API auth → Username = client_id, Password = client_secret
- Service account → Username = account name, Password = API key/token
❌ WRONG: Two separate GetRobotAsset calls for username and password — stores secrets as plain text assets.
✅ RIGHT: One GetRobotCredential call — retrieves both username and SecureString password from a single Credential asset.
→ Use gen_getrobotcredential() — generates correct XAML deterministically.
Add Queue Item (AddQueueItem)
Adds a new item to an Orchestrator queue with custom data fields. Used in dispatcher workflows to populate queues for performer bots.
→ Use gen_add_queue_item() — generates correct XAML deterministically.
Properties:
QueueType— queue name in Orchestrator (VB.NET expression). ⚠️ Property isQueueType, NOTQueueName—QueueNamedoes not exist and crashes Studio. Common hallucination because Config key isOrchestratorQueueNameand model field isqueue_name. Lint 54.FolderPath— Orchestrator folder path. Use{x:Null}for default folderReference— unique transaction reference string (for deduplication / tracking)Priority:Normal,High,LowServiceBaseAddress="{x:Null}"— uses robot's default Orchestrator connectionTimeoutMS="{x:Null}"— default timeout.ItemInformationchild — dictionary of key-value pairs (queue item specific content). Each entry is<InArgument x:TypeArguments="x:String" x:Key="FieldName">[value]</InArgument>. All values must be strings — convert non-strings with.ToString
⚠️ CRITICAL — ItemInformation vs SpecificContent:
- WRITING (AddQueueItem in XAML): property is
<ui:AddQueueItem.ItemInformation>— ⛔ NOTSpecificContent - READING (VB.NET expressions at runtime): property is
TransactionItem.SpecificContent("Key") - Using
SpecificContentin XAML causes:Could not find member 'SpecificContent'→ activity becomes UnresolvedActivity
⚠️ RESERVED KEY NAMES: Do NOT use these as x:Key in ItemInformation — they conflict with AddQueueItem's built-in properties and cause "RuntimeArgument already exists" errors: DueDate, DeferDate, Reference, Priority. Use prefixed names instead (e.g. InvoiceDueDate, ItemPriority).
⚠️ WRONG ELEMENT TYPE: Entries must be <InArgument x:TypeArguments="x:String" x:Key="..."> — ⛔ NOT <x:String x:Key="...">. Using x:String causes: x:String is not assignable to Dictionary(String,InArgument) → activity becomes ErrorActivity.
⚠️ WRONG DICTIONARY PATTERN: ItemInformation entries are flat <InArgument> elements directly under .ItemInformation — ⛔ NOT wrapped in <scg:Dictionary x:TypeArguments="x:String, InArgument"> (Studio accepts both, but emits flat). ⛔ And definitely NOT a single <InArgument x:TypeArguments="scg:Dictionary(x:String, x:Object)"> wrapping a New Dictionary(...) VB expression — that crashes Studio with Missing key value on 'InArgument' object.
⚠️ WRONG TYPE NAME: ⛔ NOT <scg:Dictionary x:TypeArguments="x:String, Argument"> — Argument type does not exist. Correct is InArgument. Crashes: Could not resolve type 'Dictionary(String,Argument)'.
⚠️ WRONG NAMESPACE PREFIX: ⛔ NOT <ui:InArgument> — InArgument is in the default XAML activities namespace, not ui:. Crashes: Could not find type 'InArgument(String)' in namespace 'http://schemas.uipath.com/workflow/activities'. Use <InArgument> (no prefix).
Get Queue Item (GetQueueItem)
Retrieves the next available item from an Orchestrator queue. Returns Nothing when the queue is empty.
→ Use gen_get_queue_item() — generates correct XAML deterministically.
Properties:
QueueType— queue nameFolderPath— Orchestrator folderTransactionItem— output variable of typeui:QueueItem.Reference— optional: filter by specific reference string (empty = next available).TimeoutMS— empty = default- Check for empty queue:
[TransactionItem Is Nothing]— standard REFramework pattern to detect when all items are processed
Accessing QueueItem fields (SpecificContent):
' Get a field value (returns Object — cast with .ToString)
in_TransactionItem.SpecificContent("FieldName").ToString
' Iterate all fields
For Each item In in_TransactionItem.SpecificContent ' KeyValuePair(String, Object)
item.Key ' field name
item.Value ' field value
The ui:ForEach over SpecificContent uses: x:TypeArguments="scg:KeyValuePair(x:String, x:Object)"
Set Transaction Status (SetTransactionStatus)
Updates the status of a queue item in Orchestrator. Three usage patterns: Success, Business Exception (won't retry), System Exception (will retry).
⛔ NEVER modify
SetTransactionStatus.xaml. It is a framework file handled entirely by the REFramework template. No generator needed — the scaffold provides it.
Status values: Successful, Failed
ErrorType values: Business (won't retry — data/rule issue), Application (will retry — system/infra issue)
Properties:
Status+ErrorType— determine retry behaviorReason— error message VB expression (e.g.,[in_BusinessException.Message]). Set for failed transactionsDetails— additional info (e.g., screenshot path). OptionalTransactionItem— the QueueItem to update.Analytics,.Output— dictionaries (usually empty but required as child elements)- Always wrap in RetryScope + TryCatch — Orchestrator calls can fail transiently
HTTP Request (NetHttpRequest)
Requires NuGet: UiPath.WebAPI.Activities. Response variable type: uwahm:HttpResponseSummary.
POST with OAuth Token Authentication
{
"gen": "net_http_request",
"args": {
"method": "POST",
"request_url_variable": "in_strApiEndpoint",
"result_variable": "httpReqResponse",
"auth_type": "OAuthToken",
"oauth_token_variable": "strApiAccessToken",
"text_payload_variable": "in_strApiBody",
"content_type": "application/json",
"parameters_expr": "new Dictionary(Of String, String) From {{ \"externalId\", in_strApiExternalIdParam }}",
"timeout_ms": 10000,
"retry_count": 3,
"display_name": "HTTP Request (API - Create Record)"
}
}
GET Request
{
"gen": "net_http_request",
"args": {
"method": "GET",
"request_url_variable": "strApiEndpoint",
"result_variable": "obj_httpResponse",
"timeout_ms": 30000,
"display_name": "HTTP Request (GET - API Endpoint)"
}
}
The generator handles all {x:Null} boilerplate props (~15), FormDataParts, RetryStatusCodes list, TimeoutInMiliseconds child element (note: the typo is real — UiPath's actual property name), and namespace wiring.
Key Properties
Method:GET,POST,PUT,PATCH,DELETERequestUrl— VB.NET expression for endpoint URLResult—uwahm:HttpResponseSummaryvariableTextPayload— request body as VB.NET string expressionTextPayloadContentType:application/json,application/x-www-form-urlencoded,text/xmlContinueOnError="True"— common on HTTP calls to handle errors in workflow logic (check StatusCode) rather than throwingFileOverwrite="AutoRename"— rename strategy when downloading files that already exist- Timeout uses Nullable(Int32) child element (milliseconds) — note typo:
TimeoutInMiliseconds - Many
{x:Null}attributes are required — omitting them causes validation warnings
Authentication Types
AuthenticationType="None"— no auth,OAuthToken="{x:Null}"AuthenticationType="OAuthToken"— OAuth bearer token:OAuthToken="[strToken]"AuthenticationType="Basic"— basic auth:BasicAuthUsername="[strUser]"+BasicAuthPassword="[strPass]"AuthenticationType="OsNegotiatedAuth"— Windows/NTLM:UseOsNegotiatedAuthCredentials="True"
Query Parameters (URL ?key=value pairs)
' Empty parameters
Parameters="{x:Null}"
' Single parameter — inline Dictionary
Parameters="[new System.Collections.Generic.Dictionary(Of System.String, System.String) From { { "externalId", strIdParam } }]"
' Multiple parameters
Parameters="[new System.Collections.Generic.Dictionary(Of System.String, System.String) From { { "page", intPage.ToString }, { "limit", "100" } }]"
Custom Headers
' Empty headers (still requires Dict initialization in some exports)
Headers="[new System.Collections.Generic.Dictionary(Of System.String, System.String) From { }]"
Headers="{x:Null}"
' With custom headers
Headers="[new System.Collections.Generic.Dictionary(Of System.String, System.String) From { { "X-Custom-Header", "value" }, { "Accept", "application/json" } }]"
Retry Configuration
RetryCount— number of retries (0 = no retry)RetryPolicyType:None,Basic,ExponentialInitialDelay— ms before first retry (for Exponential: base delay)Multiplier— exponential backoff multiplier (e.g., 2 = double each retry)UseJitter— randomize retry delays to avoid thundering herdRetryStatusCodes— VB.NET List of HttpStatusCode enum values that trigger retry:
' Standard retryable status codes
[New List (Of System.Net.HttpStatusCode) From _
{
System.Net.HttpStatusCode.RequestTimeout,
System.Net.HttpStatusCode.TooManyRequests,
System.Net.HttpStatusCode.InternalServerError,
System.Net.HttpStatusCode.BadGateway,
System.Net.HttpStatusCode.ServiceUnavailable,
System.Net.HttpStatusCode.GatewayTimeout
}]
FormDataParts (for multipart/form-data requests)
' Default empty form data parts (always present in exports even if unused)
[New List (Of FormDataPart) From _
{
New FileFormDataPart(),
New BinaryFormDataPart(),
New TextFormDataPart()
}]
Response Handling
' Response body as string
httpReqResponse.TextContent
' HTTP status code (integer)
httpReqResponse.StatusCode
' Common pattern: fetch response into output variables
out_intStatusCode = httpReqResponse.StatusCode
out_strResponseBody = httpReqResponse.TextContent
' Parse JSON response
JObject.Parse(httpReqResponse.TextContent)("data")("id").ToString
' Check success
httpReqResponse.StatusCode >= 200 AndAlso httpReqResponse.StatusCode < 300
Typical API Call Pattern (OAuth Flow)
Real-world sequence from clipboard export:
1. LogMessage → "[START] Create record via API"
2. InvokeWorkflowFile → fetch OAuth token workflow
in_OAuthCredentialsAssetName = config("OAuth2_ClientCredentials").ToString
in_OAuthGetAccessTokenEndpoint = config("OAuth2_GetAccessToken_Endpoint").ToString
in_OAuthGetAccessTokenBody = config("OAuth2_GetAccessToken_Body").ToString
out_strApiAccessToken → [strApiAccessToken]
3. LogMessage → "Sending API request..."
4. NetHttpRequest → POST with OAuthToken="[strApiAccessToken]"
ContinueOnError="True" (handle errors in workflow, not exception)
→ [httpReqResponse]
5. LogMessage → "Fetching API request response data..."
6. Assign → httpReqResponse.TextContent → [out_strRequestMsgDetails]
7. Assign → httpReqResponse.StatusCode → [out_intStatusCode]
8. LogMessage → "API request status code: " + out_intStatusCode.ToString
9. LogMessage → "[END] Create record via API"
Notes:
- OAuth credentials stored as Orchestrator asset, endpoint/body in config dictionary
ContinueOnError="True"prevents HTTP errors from throwing — check StatusCode instead- Response extracted into Out arguments for caller to handle success/failure
- Log messages bracket the operation for traceability in Orchestrator logs
Tasks Activities (Form Tasks)
→ Fully decoupled to dedicated skill:
uipath-tasksAll Tasks code — generators, lint rules, scaffold hooks, and documentation — lives in
uipath-tasks/. Loaded automatically viaplugin_loader.py.Read
uipath-tasks/SKILL.mdanduipath-tasks/references/tasks.md.
Open this reference as its own page
Testing Activities
Assertions, mocking, comparison, and test-data-queue activities from UiPath.Testing.Activities. Namespace prefix: uta: (clr-namespace UiPath.Testing.Activities).
Contents
- When to use
- Assertions
- Mocking
- Test data queues
- File and text comparison
- Synthetic data
- Common pitfalls
When to use
These activities power UiPath's Test Manager / Test Suite workflows. Reach for them when:
- The PDD specifies acceptance tests or regression tests
- You're building a test case
.xaml(file lives underTests/folder in the project) - A workflow needs deterministic synthetic inputs (random names, IDs, dates)
For production automation logic, prefer:
- Data validation →
xaml-data.md(FilterDataTable, compare DataRows directly) - Error handling →
xaml-error-handling.md(TryCatch, Throw) - Conditional branching →
xaml-control-flow.md(If, IfElseIfV2)
Testing activities are about verifying and simulating, not driving the business process.
Assertions
VerifyExpression
Asserts a single boolean expression. Failure stops or continues based on ContinueOnFailure.
{
"gen": "verifyexpression",
"args": {
"expression": "intRecords > 0",
"result_variable": "boolRecordsExist",
"continue_on_failure": "True"
}
}
result_variable receives True/False so downstream activities can branch on the outcome even when ContinueOnFailure="True".
VerifyExpressionWithOperator
Asserts a comparison between two expressions using a named operator (Equal, NotEqual, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual). Clearer diagnostics than VerifyExpression when the assertion fails because the message names both operands.
VerifyRange
Asserts that a numeric expression falls inside [MinValue, MaxValue].
VerifyControlAttribute
Asserts that a UI control's attribute matches an expected value. Combines UIAutomation element targeting with an equality check. Useful inside test cases that interact with real apps.
Mocking
MockActivity
Wraps a child activity and substitutes a deterministic output for testing. At runtime in Test Manager, the wrapped activity does NOT execute — the mock's MockOutput is assigned directly to Result.
Use when:
- Testing a workflow that calls a real API / database / Orchestrator, and you need to run the test without that dependency
- You want to force a specific error path (mock returns the error case)
Do NOT leave MockActivity in production runtime paths — it silently skips the wrapped activity outside Test Manager context.
Test data queues
Test Manager stores structured test inputs in Test Data Queues (distinct from production Orchestrator queues). These activities feed synthetic or curated data rows into a test case.
BulkAddTestDataQueue— push many rows from a DataTableNewAddTestDataQueueItem— push a single row from a dictionaryGetTestDataQueueItem— fetch the next row for the current test iterationGetTestDataQueueItems— fetch a batchDeleteTestDataQueueItems— clear queue between runs
Use these when the test case is data-driven — i.e., "run this test once per row in the queue." Test Manager orchestrates the iteration.
File and text comparison
CompareText
Asserts string equality, optionally ignoring whitespace, case, or specific characters. Richer than a VB = comparison for human-readable diff output when it fails.
ComparePdfDocuments
Diffs two PDF files, optionally excluding regions (by coordinates or by matching a comparison rule). Returns details of each mismatched region. Use when comparing "before/after" PDF artifacts — receipts, invoices, generated reports.
CreateComparisonRule
Builds a reusable comparison rule (ignored regions, tolerance thresholds) for feeding into ComparePdfDocuments. Define once per test suite, reuse across cases.
AttachDocument
Attaches a file to the current test result for later review. Useful when ComparePdfDocuments fails — attach both the expected and actual PDF so a reviewer can diff visually.
Synthetic data
Deterministic random generators for test inputs. Each accepts a Seed for reproducibility — same seed produces the same value every run, so failing tests stay failing until fixed.
RandomString— string of given length / character classRandomNumber— integer in rangeRandomDate— date in range, optional weekday constraintsRandomValue— pick from an enumerated listGivenName/LastName/Address— locale-aware person/address names. Useful for PII-safe test fixtures.
Always seed when the test is expected to be deterministic. An unseeded RandomNumber makes the test non-reproducible — the next run may pass where the previous failed.
Common pitfalls
| Pitfall | Symptom | Fix |
|---|---|---|
MockActivity left in production workflow |
activity is silently skipped | Scope mocks to Tests/ .xaml files only; never InvokeWorkflowFile a mock-bearing test from prod Main |
| Unseeded random values in assertion | flaky tests | Pass a fixed Seed to Random* activities |
ContinueOnFailure="False" inside a loop |
one failure aborts all iterations | Set ContinueOnFailure="True" when iterating, aggregate failures, assert in summary after the loop |
| Confusing Test Data Queue with production queue | test data leaks into prod queue | Test data activities target Test Manager queues; production uses AddQueueItem/GetQueueItem (see xaml-orchestrator.md) |
ComparePdfDocuments with no tolerance / excluded regions |
every run fails on timestamps/dynamic content | Use CreateComparisonRule to ignore date/time regions |
VerifyExpression expression using = instead of == on non-VB context |
unexpected assignment semantics | Expressions are VB; use = for equality. For C#, use == (specify via language setting) |
| Testing activities in a workflow that's never invoked by Test Manager | activities never execute | Test activities only run under Test Manager execution context — put them in Tests/ workflows, not in Main.xaml |
Template selection
No golden templates for testing activities yet. Emission is via the data-driven gen_from_annotation engine using entries in references/annotations/testing.json. Reference harvested shapes under references/studio-ground-truth/UiPath.Testing.Activities/25.10/.
Open this reference as its own page
UI Automation & Selectors
NApplicationCard (browser + desktop), NClick, NTypeInto, NSelectItem, NGetText, NExtractDataGeneric, NGoToUrl, NGetUrl, NCheckState, TargetAnchorable patterns, selector syntax, dynamic selectors, wildcards, fuzzy/regex search, anchor-based targeting, desktop selector frameworks.
Contents
- Use Application/Browser (NApplicationCard)
- Desktop Selector Frameworks
- Click (NClick)
- Type Into (NTypeInto)
- Select Item (NSelectItem)
- Get Text (NGetText)
- Extract Table Data (NExtractDataGeneric)
- Go To URL (NGoToUrl)
- Get URL (NGetUrl)
- Check App State (NCheckState)
- Target Element Patterns
- Selector Reference
- XAML Special Characters
Requires xmlns:uix="http://schemas.uipath.com/workflow/activities/uix" on root Activity.
These are the Modern Design Experience activities (Studio 24.10+, required minimum). They replace classic activities like AttachBrowser, OpenBrowser, Click, TypeInto. Real templates in assets/samples/common-workflows/ and assets/simple-sequence/FormFilling_Main.xaml.
Required namespace imports (in TextExpression.NamespacesForImplementation):
UiPath.UIAutomationNext.Enums
UiPath.UIAutomationCore.Contracts
UiPath.UIAutomation.Models
UiPath.UIAutomation.Activities
UiPath.Shared.Activities
⚠️ The NuGet package is
UiPath.UIAutomation.Activitiesbut the CLR enum namespace isUiPath.UIAutomationNext.Enums. The package was renamed, but the enum types kept the old namespace. All fully-qualified enum values in expressions useUIAutomationNext:[UiPath.UIAutomationNext.Enums.NAppOpenMode.Always],[UiPath.UIAutomationNext.Enums.NClickMode.None], etc. Do NOT "fix" this toUIAutomation.Enums— that namespace does not exist and will cause a compile error. For Extract Table Data, also add:UiPath.UIAutomation.Models.ExtractData
Required assembly references:
UiPath.UIAutomation.Activities
UiPath.UIAutomationCore
Use Application/Browser (NApplicationCard)
The container for all modern UI interactions. Wraps any browser or desktop app actions.
CRITICAL — Browser vs Desktop App:
- Browser apps use
BrowserType+UrlinTargetApp, selector root is<html app='...' /> - Desktop apps use
FilePathinTargetApp, selector root is<wnd app='...' /> - The
FilePathattribute is REQUIRED for desktop apps whenOpenModeisIfNotOpenorAlways— without it UiPath cannot launch the application - ⛔
Urldoes NOT exist as an attribute on NApplicationCard itself — it goes in the<uix:TargetApp Url="...">child element. Same forFilePath,BrowserType,Selector,Title.
Browser example (Chrome/Edge)
→ Use gen_napplicationcard_open() / gen_napplicationcard_attach() / gen_napplicationcard_desktop_open() — generates correct XAML deterministically.
Desktop app example — traditional .exe (WinForms/WPF)
→ Use gen_napplicationcard_open() / gen_napplicationcard_attach() / gen_napplicationcard_desktop_open() — generates correct XAML deterministically.
Desktop app example — UWP / Microsoft Store app
UWP apps use the package AppId as FilePath and applicationframehost.exe in the selector.
→ Use gen_napplicationcard_open() / gen_napplicationcard_attach() / gen_napplicationcard_desktop_open() — generates correct XAML deterministically.
Desktop apps: No BrowserType, no Url. Selector uses <wnd> root (not <html>). No InUiElement/OutUiElement chaining.
Traditional .exe vs UWP:
- Traditional (.exe):
FilePathis the full path to the executable. Selector<wnd app='desktopapp.exe' .../>. WinForms apps often usectrlnamein selector. - UWP / Store apps:
FilePathis the package AppId (e.g.Microsoft.WindowsCalculator_8wekyb3d8bbwe!App). Selector usesapp='applicationframehost.exe'withappid='...'attribute. - UWP apps omit
TargetApp.WorkingDirectory.
TargetApp child elements:
TargetApp.Arguments—InArgument(x:String), command-line args to pass when launching. Always present (empty = no args).TargetApp.WorkingDirectory—InArgument(x:String), working directory for launch. Present for traditional .exe apps, omitted for UWP.
Studio-generated metadata (optional, added by Studio during recording):
ContentHash— hash of UI snapshotIconBase64— base64 PNG of the app iconReference— encoded reference ID for targeting
Key attributes:
OpenMode:Always(launch new),IfNotOpen(reuse or launch),Never(must be already open). Omitting defaults toIfNotOpen. In Launch workflows: useAlways— this opens the browser atTargetApp Url=, so NGoToUrl is NOT needed. NGoToUrl is for mid-session navigation only.CloseMode:Always(close when done),Never(leave open),IfOpenedByAppBrowser(close only if this activity opened it). Omitting defaults toNever. For browser close/logout → seeskill-guide.mdRule 10.AttachMode: ONLY two valid values:SingleWindow(browser typical),ByInstance(desktop typical — attaches to any window of the process). NEVER useByUrl— this value does NOT exist in theNAppAttachModeenum and will crash Studio with "ByUrl is not a valid value for NAppAttachMode". This is the #1 hallucinated enum value for this activity.InteractionMode:Simulate(browser default),DebuggerApi,WindowMessages,HardwareEvents. Child activities useSameAsCardto inheritWindowResize:None(default),Maximize,Minimize,Restore. Set on the NApplicationCard elementHealingAgentBehavior:Job(default for NApplicationCard) — controls AI-based selector healingInUiElement/OutUiElement: pass browser/app reference viaui:UiElementargument. Launch workflows useOutUiElement="[out_uiAppName]"(OutArgument). Action workflows useInUiElement="[io_uiAppName]"+OutUiElement="[io_uiAppName]"(InOutArgument — preserves updated reference). One variable per web app → seeskill-guide.mdRule 11.IsIncognito: Always"True"for browser automation. Private/incognito mode — no cached sessions, cookies, or saved credentials interfere. Omit for desktop apps.- Browser TargetApp:
BrowserType(Edge,Chrome,Firefox),Url(string or[expression]) - Desktop TargetApp:
FilePath(full path to.exeor UWP AppId). REQUIRED whenOpenModeisIfNotOpenorAlwaysVersion attribute — each activity type has its own valid set (Studio crashes on invalid values):
| Activity | Recommended | Also valid | ❌ Crash |
|---|---|---|---|
NApplicationCard |
V2 |
V1 |
|
TargetApp |
V2 |
||
NClick, NTypeInto, NGetText, NCheckState |
V5 |
V1 |
|
NGoToUrl |
V3 |
||
NSelectItem |
V1 |
||
NExtractDataGeneric |
V5 |
||
TargetAnchorable |
V6 |
⚠️ Do NOT use the same Version value across all activities. Each has its own enum. V4 on NApplicationCard causes: V4 is not a valid value for NApplicationCardVersion → Studio crash.
.OCREngine — NEVER include this child element. Studio exports an empty OCREngine ActivityFunc delegate on some templates, but it serves no purpose in generated XAML:
- Browser apps: OCR is meaningless — the DOM provides all text natively via selectors
- Desktop apps: Standard UIA selectors (
automationid,ctrlname,name) cover virtually all cases. OCR is only relevant for Citrix/VDI or legacy apps with no accessibility tree, and those require a configured OCR engine (not an empty delegate)
The empty delegate adds complexity (requires System.Drawing namespace declarations that conflict with System.Data prefixes) and zero functionality. Always omit it.
Child order in XAML: .Body → .TargetApp (no .OCREngine)
Desktop Selector Frameworks
Different Windows UI frameworks produce different selector patterns. Use scripts/inspect-ui-tree.ps1 to detect the framework and generate appropriate selectors.
UWP / WPF / Win32 — <wnd> + <uia> selectors
Standard apps with proper UIA support. The inspection script generates ready-to-use selectors:
ScopeSelectorArgument: <wnd app='applicationframehost.exe' appid='...' />
FullSelectorArgument: <uia automationid='num7Button' cls='Button' />
Key selector attributes: automationid (most stable), cls, name/aaname, role.
WinForms — <ctrl name='...' /> selectors (primary) or <wnd ctrlname='...' /> (with UI Explorer)
WinForms apps expose all elements as ControlType=Pane via standard UIA. UiPath uses a proprietary .NET bridge to read Control.Name and exposes it as both ctrlname and automationid.
Primary approach — <ctrl> selectors: The inspect-ui-tree.ps1 script generates <ctrl name='...' role='...' /> selectors using UIA Name and inferred control role:
ScopeSelectorArgument: <wnd app='desktopapp.exe' />
FullSelectorArgument: <ctrl name='First' role='editable text' />
Alternative — <wnd ctrlname> selectors: When UiPath UI Explorer is available, ctrlname selectors are more stable:
ScopeSelectorArgument: <wnd app='desktopapp.exe' />
FullSelectorArgument: <wnd ctrlname='txtFirstName' />
Role mapping for WinForms controls in <ctrl> selectors:
| WinForms Control | <ctrl> role |
|---|---|
| TextBox (Edit) | editable text |
| Button | push button |
| CheckBox | check box |
| RadioButton | radio button |
| ComboBox | combo box |
| TabItem | tab item |
| Label | text (read-only) |
If multiple windows of the same app exist, add title (with wildcard) to scope — but never cls:
ScopeSelectorArgument: <wnd app='desktopapp.exe' title='Desktop App*' />
⚠️ CRITICAL — WinForms cls values are DYNAMIC. WinForms class names contain a session hash that changes between app launches (e.g., WindowsForms10.Window.8.app.0.378734a). Never use cls in selectors for WinForms apps.
WinForms ClassName patterns (for reference only — do NOT use in selectors):
WindowsForms10.EDIT.app.0.*→ TextBoxWindowsForms10.BUTTON.app.0.*→ Button/CheckBox/RadioButtonWindowsForms10.COMBOBOX.app.0.*→ ComboBoxWindowsForms10.STATIC.app.0.*→ LabelWindowsForms10.Window.8.app.0.*→ Container/GroupBox/Form
See references/ui-inspection-reference.md for complete framework detection table and property mapping.
Click (NClick)
→ Use gen_nclick() — generates correct XAML deterministically.
With verify (wait for element after click):
→ Use gen_nclick() — generates correct XAML deterministically.
Key attributes:
ClickType:Single,DoubleMouseButton:Left,RightKeyModifiers:None,Alt,Ctrl,Shift,Win
Type Into (NTypeInto)
→ Use gen_ntypeinto() — generates correct XAML deterministically.
With dynamic selector (use expression in selector):
FullSelectorArgument="[string.Format("<webctrl aaname='Answer {0}' tag='INPUT' />", intIndex + 1)]"
Key attributes:
EmptyFieldMode:SingleLine(clear before typing — ⚠️ NEVER use"Clear", Studio crash),MultiLine,NoneClickBeforeMode:Single,Double,NoneText: VB.NET expression in brackets, e.g.[variableName]
Select Item (NSelectItem)
Selects a value from a dropdown. Item is the value to select (variable or literal). Items is the optional static list of valid options.
→ Use gen_nselectitem() — generates correct XAML deterministically.
Properties:
Item— VB.NET expression for the value to select (e.g.,[strDepartment]or"Engineering")NSelectItem.Items— optional predefined list (scg:List x:TypeArguments="x:String") of valid dropdown values. Studio populates this from design-time inspection. ⚠️ MUST bescg:Listwithx:Stringelements — NOTInArgument.- ⚠️ NSelectItem does NOT have
InteractionMode— that property only exists on NClick and NTypeInto. NGetText, NCheckState, NSelectItem, NGoToUrl, NGetUrl, NExtractDataGeneric all lack it. Studio crashes withCould not find member 'InteractionMode'. Lint 53.
Get Text (NGetText)
Extracts text content from a UI element. Output stored via TextString property.
→ Use gen_ngettext() — generates correct XAML deterministically.
Properties:
TextString="[varName]"— output variable (VB.NET expression). Omit to discard resultAlternative output pattern (seen in some Studio versions):
NGetText.Textas OutArgument element: → Usegen_ngettext()— generates correct XAML deterministically.ElementType— optional. Must be a validUIElementTypeenum value:Button,CheckBox,Document,DropDown,Group,Image,InputBox,InputBoxPassword,List,ListItem,Menu,MenuItem,None,ProgressBar,RadioButton,Slider,Tab,Table,Text,ToolBar,ToolTip,Tree,TreeItem,Window. ⚠️DataGridis NOT valid — useTable.ComboBoxis NOT valid — useDropDown.Link/Anchor/Hyperlinkare NOT valid — useText. Studio crashes on invalid values.ElementVisibilityArgument="Interactive"— waits for element visibilityWaitForReadyArgument="Interactive"— waits for page/app ready stateScopeIdentifier— must match parent NApplicationCardScopeGuidHealingAgentBehavior="SameAsCard"— inherits from NApplicationCard⚠️ NGetText does NOT have
InteractionMode— only NClick and NTypeInto have it. Adding it causesCould not find member 'InteractionMode'crash. Lint 53.
Extract Table Data (NExtractDataGeneric)
Scrapes structured tabular data from web pages. Handles pagination automatically via .NextLink. Output is a DataTable. This is the most complex modern UI activity — the ExtractDataSettings and ExtractMetadata attributes contain embedded XML that defines the table schema and extraction selectors.
→ Use gen_nextractdata() — generates correct XAML deterministically.
Properties:
x:TypeArguments="sd2:DataTable"— output type. Requiresxmlns:sd2="clr-namespace:System.Data;assembly=System.Data.Common"ExtractedData="[dt_variable]"— output DataTable variable. Use this inline attribute. Do NOT useResultorDataTable— neither property exists.DataTableis the generic type argument (x:TypeArguments="sd2:DataTable"), NOT a property. Studio error:Could not find member 'DataTable'MaximumResults—0= unlimited. Set to a number to cap rowsLimitExtractionTo—None(all pages),CurrentPage(single page only)ContinueOnError—Truerecommended for web scraping (pages may change)- IdRef uses backtick notation:
NExtractDataGeneric`1_1(generic type parameter) ScopeIdentifier— must match parent NApplicationCardScopeGuid
ExtractDataSettings — XML-encoded table schema defining columns. The XML must be entity-encoded as an attribute value. Decoded structure:
<Table Type='Structured' AddCvHeader='true' IsScrollEnabled='false'>
<Column xsi:type='DataColumn' ReferenceName='Column0' Name='ColumnDisplayName'>
<IsValidName>true</IsValidName>
<ValidationErrorMessage />
<IsExtra>false</IsExtra>
<CanExtractSimilar>true</CanExtractSimilar>
<Format xsi:type='TextColumnFormat' />
</Column>
<!-- More columns... -->
<Column xsi:type='DataNextLink' /> <!-- Pagination marker -->
</Table>
Column types: DataColumn (text data), DataNextLink (pagination — always last, no Name/ReferenceName)
ExtractMetadata — XML-encoded selector rules for row detection and per-column data extraction. Decoded:
<extract>
<row exact='1'>
<webctrl tag='li' />
<webctrl tag='article' idx='1' />
</row>
<column exact='1' name='Column0' attr='href'>
<webctrl tag='li' />
<webctrl tag='article' idx='1' />
<webctrl tag='h3' idx='1' />
<webctrl tag='a' idx='1' />
</column>
<column exact='1' name='Column1' attr='fulltext'>
<webctrl tag='li' />
<webctrl tag='article' idx='1' />
<webctrl tag='div' idx='2' />
<webctrl tag='p' idx='1' />
</column>
</extract>
<row>— defines the repeating element pattern (each row in the table)<column name='...' attr='...'>— selector path to extract data for each column.attris the HTML attribute to read:fulltext(visible text),href(link URL),src(image),innertext,aaname, etc.- Column
namemust matchReferenceNamein ExtractDataSettings
Child elements (order matters):
.NextLink— TargetAnchorable pointing to the "Next" page button/link. Omit for single-page extraction.SearchSteps="Selector, Image"— uses image fallback since next buttons change across pages.Target— TargetAnchorable pointing to the table/list container element
TargetAnchorable visual anchoring attributes (seen in Extract Data targets):
ImageBase64— base64-encoded screenshot of the target element for image-based matchingBrowserURL— the URL where the element was recorded (informational, not used for matching)DesignTimeRectangle— bounding box coordinates from design time:"x, y, width, height"
Go To URL (NGoToUrl)
Best practice — URL-first navigation: Always prefer NGoToUrl over clicking links/menus. Faster, more reliable, no selector dependency. See skill-guide.md Rule 3 for the click-then-fetch discovery technique.
⚠️ Never hardcode URLs — all URLs must come from Config.xlsx. See SKILL.md → Production Rules for details. Config keys: WebApp_Url, API_BaseUrl. Dynamic: Config("WebApp_BaseUrl").ToString + "/work-item/" + strWIID.
→ Use gen_ngotourl() — generates correct XAML deterministically.
Get URL (NGetUrl)
→ Use gen_ngeturl() — generates correct XAML deterministically.
Check App State (NCheckState)
Waits for an element to appear or not, then branches. Acts like a UI-aware If/Else.
→ Use gen_ncheckstate() — generates correct XAML deterministically.
Properties:
Exists="{x:Null}"— initial value; at runtime resolves toTrue/Falseto indicate which branch was taken. Can be used as outputScopeIdentifier— must match parent NApplicationCardScopeGuidNCheckState.Target— usesuix:TargetAnchorable(same as NClick/NTypeInto) to identify the element to wait forNCheckState.IfExists— Sequence to execute when element appears. DisplayName is always"Target appears"NCheckState.IfNotExists— Sequence to execute when element is not found. DisplayName is always"Target does not appear"DelayBefore— optional delay in seconds before checking (e.g.,DelayBefore="5")- Order in XAML:
.IfExists, then.IfNotExists, then.Target— this is the order Studio exports - ⛔ NCheckState does NOT have an
Appearsattribute. Branching is via.IfExists/.IfNotExistschild elements.Mode="Appears"exists only onVerifyExecutionOptions(NClick/NTypeInto verify step) — do NOT confuse them. NCheckState also has NOSelectorattribute — the selector goes in.Target→TargetAnchorable.
Target Element Patterns
All modern activities use uix:TargetAnchorable for targeting elements. The generators (gen_nclick(), gen_ntypeinto(), etc.) build this internally via _selector_xml() — pass the raw selector string and the generator handles all TargetAnchorable attributes, escaping, and GUID generation.
TargetAnchorable key attributes (for understanding only — generators produce these):
FullSelectorArgument— strict selector (aaname, tag, id). XML-escaped (</>)FuzzySelectorArgument— relaxed selector with fuzzy matching attributesScopeSelectorArgument— app-level scope selectorSearchSteps—Selector(default),FuzzySelector,Image, or comma-separated fallback chainElementType—Button,InputBox,DropDown,Text,CheckBox,TableVersion— alwaysV6Guid— unique per target element
Core attributes:
FullSelectorArgument: strict selector (aaname, tag, id)FuzzySelectorArgument: relaxed selector with extra matching attributes (class, type,check:innerText,matching:aaname='fuzzy',fuzzylevel:aaname='0.0')ScopeSelectorArgument: app-level scope selectorSearchSteps:Selector(default),FuzzySelector,Image,CV(Computer Vision), or comma-separated fallback chain like"Selector, Image"- ALWAYS default to
SearchSteps="Selector"(strict). Only useFuzzySelectorwhen the user explicitly requests it or when strict selectors are proven unreliable for a specific element. Always populate bothFullSelectorArgumentandFuzzySelectorArgument(Studio expects both), but route through strict by default. - Selectors use
<and>for<and>— they are XML-escaped - ⛔ There is NO bare
Selector=attribute on TargetAnchorable. UseFullSelectorArgument,ScopeSelectorArgument,FuzzySelectorArgument. Also:<uix:Selector>does NOT exist as an element type — selectors are always attributes onTargetAnchorable. AndAnchorSelectoris NOT a property — anchors use a separateTargetAnchorableinside an anchor delegate (see Anchor-Based Targeting below).
Visual/design-time attributes (optional, Studio-generated):
ImageBase64— base64-encoded screenshot for image-based matching fallbackBrowserURL— URL where element was recorded (informational)DesignTimeRectangle— bounding box:"x, y, width, height".PointOffsetchild — click offset from element center:X="0" Y="0"(default center)
Selector Reference
Selector Syntax and Structure
A selector is an XML fragment that identifies a UI element through its attributes and position in the UI hierarchy:
<node_1 attr='value' /><node_2 attr='value' />...<target_node attr='value' />
- First node = root (top-level window/browser)
- Last node = target element
- Intermediate nodes = parent containers in the hierarchy
- Each node:
<tag_type attr_name='attr_value' ... />
Full vs Partial Selectors
Full selector — contains all nodes from root to target. Used by activities OUTSIDE a Use Application/Browser scope:
<wnd app='notepad.exe' />
<wnd cls='Edit' />
Partial selector — omits the root node. Used by activities INSIDE a Use Application/Browser scope (the scope provides the root):
<webctrl aaname='Submit' tag='BUTTON' />
In modern design, activities inside NApplicationCard use partial selectors. The ScopeSelectorArgument on the TargetAnchorable provides the root scope.
Tag Types and Key Attributes
WND (Windows desktop applications)
<wnd app='notepad.exe' />
<wnd cls='Edit' />
Key attributes: app (process name — usually sufficient alone for root node), cls (window class — useful for child elements), title (window title — add only to disambiguate multiple windows), aaname (accessible name), idx (index among siblings), ctrlname/ctrlid (WinForms)
HTML (Browser top-level — root node)
<html app='msedge.exe' title='Dashboard' url='https://app.example.com/dashboard' />
Key attributes: app (browser process), title (page title), url (page URL)
WEBCTRL (Web elements — most common for web automation)
<webctrl aaname='Submit' tag='BUTTON' type='submit' />
<webctrl id='email-input' tag='INPUT' />
<webctrl css-selector='div.modal > form input[name=username]' />
<webctrl tag='TR' tableRow='3' />
<webctrl tag='TD' tableRow='2' tableCol='1' colName='Status' />
Key attributes:
tag— HTML element tag (BUTTON, INPUT, DIV, A, TR, TD, SELECT, etc.)aaname— accessible/visible name (button text, link text, label)id— HTML id attributename— HTML name attributeclass— CSS class(es)parentid— id of parent elementparentclass— class of parent elementinnertext/visibleinnertext— text contenthref— link URL (for A tags)src— source URL (for IMG/IFRAME tags)css-selector— direct CSS selector (no fuzzy/regex support)tableRow/tableCol— row/column index in a table (0-based)colName/rowName— column/row header textidx— index among matching siblings (1-based)isleaf— whether element has no childrenaria-label/aria-labelledby— ARIA accessibility attributes
CTRL (Windows desktop controls — legacy)
<ctrl role='push button' name='OK' automationid='btnOK' />
Key attributes: role, name, automationid, labeledby, text, idx
UIA (UI Automation — modern desktop)
<uia automationid='txtSearch' role='edit' name='Search' />
Key attributes: automationid (most stable), role, name, cls, idx, tableRow/tableCol
JAVA (Java applications)
<java role='push button' name='OK' cls='javax.swing.JButton' />
Key attributes: role, name, virtualname, javastate, cls, accessibleClass, idx
RDP (Remote Desktop)
Same attributes as <wnd> tag. Used for remote automation via RDP sessions.
Selector Tag-Attribute Reference
Complete list of valid attributes per selector tag. Using an attribute on the wrong tag causes silent selector failures.
WND (Windows desktop): app, cls, title, aaname, ctrlname (WinForms), ctrlid (WinForms), idx, tid, pid, aastate
HTML (Browser window): url, htmlwindowname, title, class, app, idx, pid, tid
WEBCTRL (Web element): tag, idx, aaname, name, id, parentid, class, css-selector, innertext, visibleinnertext, isleaf, parentclass, parentname, src, href, tableCol, tableRow, colName, rowName, aria-label, aria-labelledby
CTRL (Windows desktop controls): role, name, automationid, labeledby, aastate, virtualname, text, rowName, idx
UIA (UI Automation — modern desktop): automationid, cls, name, role, enabled, helpText, itemstatus, itemtype, tableRow, tableCol, rowName, colName, idx
JAVA (Java applications): role, name, virtualname, javastate, cls, accessibleClass, tableRow, tableCol, rowName, colName, idx
RDP (Remote Desktop): Same attributes as <wnd>. Used for remote automation.
Attribute-Tag Mismatch Rules
⚠️ Using the wrong attribute on the wrong tag causes silent selector failures:
| Attribute | Valid Tags | ⛔ Invalid Tags |
|---|---|---|
aaname |
<wnd>, <webctrl> |
<ctrl>, <uia>, <java> |
name |
<ctrl>, <uia>, <java>, <webctrl> |
<wnd> (use aaname) |
automationid |
<ctrl>, <uia> |
<wnd> (use ctrlname), <webctrl>, <java> |
ctrlname |
<wnd> (WinForms only) |
all others |
cls |
<wnd>, <uia>, <java> |
<ctrl>, <webctrl> (use class) |
class |
<webctrl>, <html> |
<wnd> (use cls), <ctrl>, <uia> |
id |
<webctrl> |
<wnd>, <ctrl>, <uia> |
Dynamic Selectors (Variables in Selectors)
Use double curly braces {{variableName}} to inject variable values into selectors at runtime:
<wnd app='notepad.exe' title='{{strFileName}} - Notepad' />
<webctrl aaname='{{strButtonName}}' tag='BUTTON' />
<webctrl tag='TR' tableRow='{{intRowIndex}}' />
In XAML, the full selector string with variables would look like:
FullSelectorArgument="<webctrl aaname='{{strMenuOption}}' tag='A' />"
- The variable must be defined as a workflow variable (not an argument)
- Dynamic selectors are resolved at runtime — variable value is substituted before matching
Wildcards
Replace zero or more characters to handle dynamic attribute values:
*— matches zero or more characters?— matches exactly one character
<wnd app='notepad.exe' title='* - Notepad' /> ← any filename
<html title='Dashboard - *' /> ← any suffix
<webctrl aaname='Order_????' tag='A' /> ← 4-char order ID
<wnd title='Invoice_2025*' /> ← any 2025 invoice
Best practice: use wildcards for the changing portion of an attribute, keep the stable portion literal.
Fuzzy Search
Match attributes approximately rather than exactly. Useful when attributes have slight variations across runs:
<html app='firefox.exe' title='WEScho0ls Online Web Tutorials'
matching:title='fuzzy' fuzzylevel:title='0.8' />
<webctrl aaname='Colorpicker' parentid='main' tag='IMG'
matching:aaname='fuzzy' fuzzylevel:aaname='0.4' />
Syntax for any attribute:
matching:attrName='fuzzy'— enable fuzzy matching for that attributefuzzylevel:attrName='0.0-1.0'— similarity threshold (1.0 = exact, 0.0 = match anything)- High value (0.8-0.9): small variations (typos, minor text changes)
- Low value (0.3-0.5): large variations
Text content check (verify element contains specific text):
<webctrl tag='DIV' check:text='Options' matching:aaname='fuzzy' fuzzylevel:aaname='0.8' />
In XAML FuzzySelectorArgument:
FuzzySelectorArgument="<webctrl aaname='Submit Order' tag='BUTTON'
matching:aaname='fuzzy' fuzzylevel:aaname='0.8'
check:innerText='Submit' />"
RegEx Search
Use regular expressions for complex pattern matching in attribute values:
<webctrl aaname='Order_[0-9]{4,6}' tag='A' matching:aaname='regex' />
<html title='Invoice #\d+ - .*' matching:title='regex' />
Syntax: matching:attrName='regex' — attribute value is interpreted as a regular expression.
Non-Greedy Search (idx='*')
Match any window instance. Useful when multiple windows of the same app are open:
<wnd app='notepad.exe' idx='*' />
Setting idx='*' makes the selector match regardless of the window's position/order. Without this, idx='1' would only match the first instance.
Table Element Selectors
For interacting with specific cells/rows in web tables or data grids:
← Specific cell by row/column index (0-based for web tables)
<webctrl tag='TD' tableRow='2' tableCol='3' />
← Cell by column header name
<webctrl tag='TD' tableRow='1' colName='Status' />
← Entire row
<webctrl tag='TR' tableRow='5' />
← Dynamic row (using variable for iteration)
<webctrl tag='TD' tableRow='{{intCurrentRow}}' colName='Action' />
For SAP tables: <sap tableRow='3' tableCol='2' colName='Material' />
Anchor-Based Targeting
Modern design uses anchors — nearby stable elements that help locate the target:
<uix:TargetAnchorable ...>
<!-- Anchor: a label next to the input field -->
<uix:TargetAnchorable.Anchors>
<uix:AnchorElement
SelectorArgument="<webctrl aaname='Email Address' tag='LABEL' />"
AnchorType="Left" />
</uix:TargetAnchorable.Anchors>
</uix:TargetAnchorable>
Anchor types: Left, Right, Top, Bottom — relative position of anchor to target.
Anchors make selectors more resilient: even if the target's own attributes are unstable, a stable nearby label can guide matching.
Selector Best Practices
Scope selectors — keep minimal:
The <wnd> scope selector (in NApplicationCard's TargetApp or TargetAnchorable's ScopeSelectorArgument) should use the fewest attributes needed. When app uniquely identifies the process, use only app — do not add cls, title, or other properties:
- ✓
<wnd app='desktopapp.exe' />— sufficient, resilient - ✗
<wnd app='desktopapp.exe' cls='WindowsForms10.Window' />—clsis fragile (WinForms hashes change per session) - ✗
<wnd app='desktopapp.exe' cls='Window' title='Desktop App v2.1' />—titlebreaks on version updates
Add title only when multiple windows of the same process exist and you need to disambiguate (use wildcards: title='Desktop App*').
Prefer stable attributes:
automationid/id— most stable (set by developers, rarely changes)aaname— visible name (stable if UI text doesn't change)tag+name— reliable combo for web formscss-selector— powerful but couples to page structure
Avoid unstable attributes:
idx— changes based on element load order / sibling count. Only use when no alternative existsclassalone — CSS classes change with styling updates- Dynamic
idvalues (e.g.,id='element_abc123'where suffix is generated) tableRowwith hardcoded values (use variables instead for iteration)
General rules:
- Use the fewest attributes needed to uniquely identify the element
- Use wildcards for the volatile portions of otherwise stable attributes
- Prefer
aanamefor buttons/links (matches visible text the user sees) - Use
css-selectorwhen the DOM structure is stable and you need precision - Add anchors when the target itself lacks unique attributes
- Test selectors across different data/states before production
XAML Special Characters
Always escape these in XAML attribute values:
"→"<→<>→>&→&- newline →

(used for formatting multiline expressions in attributes) - tab →
	(used for indentation in multiline inline arrays)
Square brackets [ ] denote VB.NET/C# expressions in UiPath XAML.
Open this reference as its own page
HTTP, REST, JSON, and XML Activities
HTTP request activities plus JSON/XML serialization and query helpers from UiPath.WebAPI.Activities. Two namespaces appear:
ui:→ most activities (DeserializeJson,DeserializeJsonArray,DeserializeXml,GetNodes,GetXMLNodes,GetXMLNodeAttributes,ExecuteXPath,HttpClient)uwah:→NetHttpRequest(clr-namespaceUiPath.Web.Activities.Http)uwaj:→SerializeJson(clr-namespaceUiPath.Web.Activities.JSON)
Contents
- When to use
- NetHttpRequest (preferred)
- HttpClient (legacy — avoid)
- JSON serialization
- XML serialization and querying
- Common pitfalls
When to use
For REST/SOAP/HTTP APIs:
NetHttpRequest(first choice) — structured response, built-in retry, OAuth1/OAuth2/Windows auth, file upload/download, explicit proxy settings. Do NOT wrap inRetryScope— its retry is built in viaRetryCount/RetryPolicyType.HttpClient(legacy) — only for migrating old workflows. Missing structured retry; weaker response-shape contract. When porting legacy workflows, default to swapping forNetHttpRequest.
For Orchestrator assets/credentials/queues: see xaml-orchestrator.md (those are different activities, not HTTP).
For JSON/XML shaping inside a workflow — post-response or pre-request — use the Serialize/Deserialize family below. LINQ-to-XML / LINQ-to-JSON expressions inside Assign also work for trivial lookups; use the activities when you want the transform on the canvas for visibility.
NetHttpRequest
→ Use gen_net_http_request() — generates correct XAML deterministically.
Modern HTTP request activity. Returns an HttpResponseSummary with status code, headers, and body.
Must have:
Method—GET/POST/PUT/PATCH/DELETERequestUrl— full URL (from Config, never hardcoded)Result—HttpResponseSummaryoutput variable
Retry: RetryCount, RetryPolicyType (Basic / Exponential), InitialDelay, Multiplier, MaxRetryAfterDelay, UseJitter, RetryStatusCodes. Do NOT wrap in RetryScope.
Body:
TextPayload+TextPayloadContentType(defaultapplication/json) for JSON/XML/textBinaryPayloadfor binary uploadsFormData/FormDataPartsfor multipart form uploadsFilePathorResourceFilesfor file attachments
Auth: AuthenticationType: None | Basic | OAuth1 | OAuth2 | WindowsIntegrated. Supply corresponding BasicAuthUsername/BasicAuthSecurePassword, OAuthToken, or UseOsNegotiatedAuthCredentials. Pull credentials from Orchestrator via GetRobotCredential, not hardcoded.
Response handling:
SaveResponseAsFile="True"+OutputFileNamestreams to disk instead of loading in memorySaveRawRequestResponse="True"logs wire traffic (use for debugging, turn off in production)
HttpClient (legacy)
Legacy HTTP activity kept for backward compatibility. Has 5 dictionary child elements (Attachments, Cookies, Headers, Parameters, UrlSegments) that the data-driven generator emits as empty templates by default.
Prefer NetHttpRequest for new work. The only reason to emit HttpClient is when porting an existing workflow where replacing it is out of scope.
If you must emit it, use gen_http_client via annotation fallback:
{
"gen": "httpclient",
"args": {
"endpoint_variable": "strApiUrl",
"method": "GET",
"authentication_type": "Basic",
"username_variable": "cred_User",
"password_variable": "cred_Pass",
"result_variable": "strBody",
"status_code_variable": "intStatus"
}
}
Requires xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System.Private.CoreLib" at the XAML root for the dictionary children.
JSON serialization
SerializeJson
Converts a JObject / JArray / any object graph to a JSON string.
{
"gen": "serializejson",
"args": {
"input_object_variable": "jo_Payload",
"output_variable": "strJson"
}
}
Namespace uwaj: — distinct from ui:.
DeserializeJson
Parses a JSON string into a JObject (default x:TypeArguments="njl:JObject").
{
"gen": "deserialize_json",
"args": {
"json_string_variable": "strResponseBody",
"output_variable": "jo_Response"
}
}
For custom POCO types, override type_argument in the spec.
DeserializeJsonArray
Parses a JSON string into a JArray.
{
"gen": "deserializejsonarray",
"args": {
"json_string_variable": "strItems",
"output_variable": "ja_Items"
}
}
Once you have the JArray, iterate with ForEach (type njl:JToken) to access each element.
XML serialization and querying
DeserializeXml
Parses an XML string into a System.Xml.Linq.XDocument.
{ "gen": "deserializexml", "args": { "xml_string_variable": "strXml", "output_variable": "xd_Doc" } }
GetNodes / GetXMLNodes
Return IEnumerable<XElement> matching an XPath. Both accept either XMLString or ExistingXML (parsed XDocument) — pass exactly one; leave the other unset.
{
"gen": "getnodes",
"args": {
"existing_xml_variable": "xd_Doc",
"output_variable": "lst_Items"
}
}
GetNodes vs GetXMLNodes semantics are subtly different — confirm against Studio docs for your scenario. When in doubt, prefer LINQ-to-XML expressions inside an Assign (xd_Doc.Descendants("item")).
GetXMLNodeAttributes
Returns the IEnumerable<XAttribute> collection of a single XElement.
{
"gen": "getxmlnodeattributes",
"args": {
"existing_xml_node_variable": "elItem",
"output_variable": "attrs"
}
}
ExecuteXPath
Evaluates an XPath expression against an XML string or parsed XDocument. Returns the string value of the match.
{
"gen": "executexpath",
"args": {
"xml_string_variable": "strXml",
"xpath_expression": "//customer[@id='42']/name/text()"
}
}
Pass exactly one of xml_string_variable or existing_xml_variable. Mutual-exclusion is not yet enforced by the generator — caller responsibility.
Common pitfalls
| Pitfall | Symptom | Fix |
|---|---|---|
| Wrapping NetHttpRequest in RetryScope | Double retry, incorrect jitter behavior | Use built-in RetryCount / RetryPolicyType on NetHttpRequest |
| Hardcoding URLs or tokens | lint warning, security review fail | URLs from Config.xlsx; credentials from Orchestrator via GetRobotCredential |
Passing both XMLString and ExistingXML |
Studio error / undefined behavior | Provide exactly one; leave the other unset |
SerializeJson emitting uwaj: without namespace |
XAML fails to compile | scripts/generate_workflow.py adds xmlns:uwaj automatically; if hand-editing, add it to the root |
DeserializeJson with wrong x:TypeArguments |
InvalidCastException at runtime | Match generic to actual JSON shape — JObject for {...}, JArray for [...], JToken when uncertain |
| Using HttpClient for new work | tech debt, harder to migrate later | Use NetHttpRequest from day one |
| AcceptFormat / BodyFormat mismatch on NetHttpRequest | 415 / 406 from API | Set both; default application/json is common but not universal |
| OAuth token stored in variable as plaintext | appears in logs | Use SecureString and GetRobotCredential; disable SaveRawRequestResponse in prod |
Template selection
These activities have no golden templates — emission is via hand-written gen_net_http_request (for NetHttpRequest) and data-driven generators (for everything else in this file). Reference harvested shapes under references/studio-ground-truth/UiPath.WebAPI.Activities/2.4/.
More in this playbook
Browser mate
Use when automating a real, logged-in Chrome WITHOUT disturbing the user's open tabs — e.g. authenticated sessions like ChatGPT, LinkedIn, or any site needing a persistent login. Launches or reuses a dedicated debug Chrome instance per named profile that coexists with the user's main browser; it never quits or kills any browser (unlike real-browser, which closes Chrome Beta's tabs). Trigger on "automate this site without closing my tabs", "use my logged-in session", "open ChatGPT/LinkedIn in automation", or when a browser task must preserve the user's existing windows. macOS, requires the agent-browser CLI.
RPAMIT Matt Townsend + 1Engineer @ MicrosoftManage desktop flows
Manage and run Power Automate Desktop (RPA) flows and machine groups. Use when the user asks about desktop flows, RPA, or machine groups.
RPAMITUipath architecture deepening
Use only when the user explicitly asks to deepen a proven UiPath architecture hotspot into ranked design options and a safe handoff.
