Uipath tasks
Generates UiPath Tasks workflows — Form Tasks (CreateFormTask, WaitForFormTaskAndResume, GetFormTasks) with form.io schemas and FormData bindings, External Tasks (CreateExternalTask, WaitForExternalTaskAndResume) for system-in-the-loop patterns, and Task Management (CompleteTask, AssignTasks) for programmatic task operations. Self-contained skill with generators, lint rules, and scaffold hooks loaded via uipath-core's plugin system (plugin_loader.py). Use when the user mentions Tasks, form tasks, external tasks, human-in-the-loop approval, task assignment, task completion, recovery workflows, or any Persistence.Activities usage.
By- name:
- uipath-tasks
- description:
- Generates UiPath Tasks workflows — Form Tasks (CreateFormTask, WaitForFormTaskAndResume, GetFormTasks) with form.io schemas and FormData bindings, External Tasks (CreateExternalTask, WaitForExternalTaskAndResume) for system-in-the-loop patterns, and Task Management (CompleteTask, AssignTasks) for programmatic task operations. Self-contained skill with generators, lint rules, and scaffold hooks loaded via uipath-core's plugin system (plugin_loader.py). Use when the user mentions Tasks, form tasks, external tasks, human-in-the-loop approval, task assignment, task completion, recovery workflows, or any Persistence.Activities usage.
UiPath Tasks Skill
Generate Tasks workflows for human-in-the-loop, system-in-the-loop, and task management patterns in UiPath.
Plugin architecture: This skill's
extensions/directory is auto-discovered by uipath-core'splugin_loader.py. Generators, lint rules, scaffold hooks, namespaces, and known activities are registered at import time — no manual wiring needed. Core'sgenerate_workflow.py,validate_xaml, andscaffold_project.pyquery the plugin registries at runtime.
Plugin API contract (v2)
This skill is the canonical example for out-of-tree plugin authors. The contract:
REQUIRED_API_VERSION = 2must be declared at the top ofextensions/__init__.py. Plugins on v1 (or with no declaration) fail to load with a clearAPI version mismatcherror and any partial registrations are rolled back.- Registration entry points added in v2:
register_version_profile(package, profile_version, profile_dict)andregister_band_profile_mapping(band, package, profile_version)— used by lint 122 (version-band drift). Callregister_band_profile_mappingonce per(band, package)pair. Registering after the lint module is already imported automatically invalidates the lint caches, so the new entries take effect on the next lint pass without any reload. - Atomic commit: every
register_*call made during a plugin's load (including from submodules imported from__init__.py) is captured in the registry snapshot. If__init__.pyraises before completing, all registrations from that plugin are reverted. The registry is never observed in a partially-loaded state by other plugins or by core. - Out of scope for rollback: non-registry side effects (file writes, env vars, threads spawned at import time, monkey-patches). Confine those to lazy paths invoked after a successful load.
- Test that load succeeded:
assert plugin_loader.get_load_failures() == []afterload_plugins(). A plugin that raised during load surfaces in that list with its filename and exception.
Worked example: see uipath-tasks/extensions/__init__.py:34 (the REQUIRED_API_VERSION = 2 declaration) and :310-312 (the Persistence/1.4 profile + band-25/26 mapping calls).
Extensions (Plugin System)
uipath-tasks/
├── SKILL.md
├── references/
│ ├── tasks.md ← Form Tasks + form.io + Action Types Comparison
│ ├── external-tasks.md ← External Tasks (system-in-the-loop)
│ └── task-management.md ← GetFormTasks, CompleteTask, AssignTasks
└── extensions/
├── __init__.py ← Registers all AC components with plugin_loader
├── generators.py ← 7 generators (form, external, task management)
├── lint_rules.py ← AC-10, AC-11, AC-12, AC-26
├── scaffold_hooks.py ← enable_persistence_support
└── battle_test_grading.py ← 8 battle test scenario graders
What gets registered:
- 7 generators:
create_form_task,wait_for_form_task,create_external_task,wait_for_external_task,get_form_tasks,complete_task,assign_tasks - 4 lint rules: AC-10 (Form Create/Wait mismatch), AC-11 (FormData key mismatch), AC-12 (External Create/Wait mismatch), AC-26 (persistence in sub-workflow)
- 1 scaffold hook: auto-enables
supportsPersistencewhen Persistence.Activities is in deps - 3 namespaces:
upaf(FormTask),upae(ExternalTask),upat(Tasks) - 7 known activities:
CreateFormTask,WaitForFormTaskAndResume,CreateExternalTask,WaitForExternalTaskAndResume,GetFormTasks,CompleteTask,AssignTasks
When To Read Which Reference
| Task | Read |
|---|---|
| Create a form task workflow | references/tasks.md → Create Form Task + FormData Bindings |
| Design a form.io form schema | references/tasks.md → Form.io Component Reference |
| Wait for human approval / resume | references/tasks.md → Wait for Form Task and Resume |
| Any PDD with "for each X" / "multiple X" / "batch of X" / N rows (default for N-item approvals, not advanced) | references/tasks.md → Shadow Task Pattern |
| Compare action types (Form vs External) | references/tasks.md → Action Types Comparison |
| Create an external task (system-in-the-loop) | references/external-tasks.md → Create External Task |
| Wait for external system resolution | references/external-tasks.md → Wait for External Task and Resume |
| Retrieve existing tasks (recovery workflow) | references/task-management.md → Get Form Tasks |
| Complete a task programmatically | references/task-management.md → Complete Task |
| Assign a task to a user/group | references/task-management.md → Assign Tasks |
| Escalation / reassignment patterns | references/task-management.md → Escalation Pattern |
| Task lifecycle states | references/task-management.md → Task Lifecycle States |
| Persistence constraints | references/tasks.md → Prerequisites (Main.xaml constraint) |
| Lint issues on AC workflows | references/tasks.md → Validation & Lint Rules + external-tasks.md → Validation |
| Scaffold a project with persistence | Scaffold hook in extensions/scaffold_hooks.py — auto-runs via core's scaffold_project.py |
| Validate AC workflow XAML | Lint rules in extensions/lint_rules.py — auto-run via core's validate_xaml --lint |
| Resolve NuGet versions | Use uipath-core's resolve_nuget.py for UiPath.Persistence.Activities + UiPath.FormActivityLibrary |
Ground Rules
- AC-1: Always use generators. Never write Tasks XAML by hand. Use generators via JSON specs or Python API (auto-loaded from
extensions/generators.py). - AC-2: Persistence activities MUST stay in Main.xaml.
WaitForFormTaskAndResume,WaitForExternalTaskAndResume, and all Wait*AndResume activities are persistence points — they serialize workflow state to Orchestrator. They ONLY work in the entry-point file. AC-26 enforces this. - AC-3: Both NuGet packages are required for Form Tasks.
UiPath.Persistence.Activities(runtime) ANDUiPath.FormActivityLibrary(form designer UI). External Tasks and Task Management only needUiPath.Persistence.Activities. - AC-4:
supportsPersistence: truemust be in project.jsonruntimeOptionswhen using Wait*AndResume activities. Scaffold sets this automatically. - AC-5: FormData keys must match form.io component keys. (Form Tasks only.) AC-11 validates key presence.
- AC-6: Always include a submit button as the last form.io component. (Form Tasks only.)
- AC-7: Wrap Create*Task in RetryScope. Orchestrator API calls can transiently fail.
- AC-8: External tasks have NO form. Don't use FormLayout/FormData on CreateExternalTask — use TaskData dict.
- AC-9: Task Management activities are NOT persistence points. GetFormTasks, CompleteTask, AssignTasks can be used in sub-workflows.
- AC-Shadow: Shadow Task Pattern is the default shape for N-item approvals. When the PDD / workflow processes N items from a collection (DataTable rows, list, etc.) and each needs a human task, emit one
ui:ForEachRow/ui:ForEachthat only callsCreateFormTaskand appends the returnedFormTaskDatato aList(Of FormTaskData), followed by a secondui:ForEach(at the root-Sequence level) that runsWaitForFormTaskAndResume+ decision handling per task. TheList(FormTaskData)variable MUST be initialized — setDefault="[New System.Collections.Generic.List(Of UiPath.Persistence.Activities.FormTask.FormTaskData)()]"on the variable declaration (or pass"default": "[...]"in the JSON spec). A null List throwsValue cannot be null. (Parameter 'TargetObject')on the firstInvokeMethod.Add. Never emit inlineCreate → Waitper item, and never unroll the loop into hardcodedIf Rows.Count >= N/Rows(0..N-1)blocks. The inline form ties up the robot for the sum of all wait times instead of the max; the unrolled form additionally bypasses AC-27. Seereferences/form-tasks.md→ Shadow Task Pattern (default for N-item batches). Loop-nested case enforced by AC-27; unrolled case enforced by AC-34.
Capabilities
- CreateFormTask — Form task with form.io schema, FormData bindings (In/Out/InOut), storage bucket, task catalog, priority levels
- WaitForFormTaskAndResume — Long-running persistence, task action capture, updated FormTaskData output
- Form.io schema design — textfield, textarea, number, select, checkbox, datagrid (DataTable binding), htmlelement (Mustache templates), columns, button
- FormData direction bindings — In (read-only), Out (user-entered), InOut (editable pre-populated, DataTable ↔ datagrid)
- Shadow task pattern — Non-blocking multi-task orchestration
- CreateExternalTask — System-in-the-loop task for external systems (JIRA, Salesforce, ServiceNow)
- WaitForExternalTaskAndResume — Suspend until external system completes task via API
- GetFormTasks — Retrieve existing tasks from Orchestrator (recovery workflows, cross-process)
- CompleteTask — Programmatic task completion (escalation, timeout, batch operations)
- AssignTasks — Assign tasks to user or group (SingleUser, AllUsersInGroup)
- Validation — AC-10, AC-11, AC-12, AC-26
Reference Files
| File | Coverage |
|---|---|
references/tasks.md |
Form Tasks — prerequisites, CreateFormTask, FormData, form.io, WaitForFormTask, patterns, lint, Config keys |
references/external-tasks.md |
External Tasks — CreateExternalTask, WaitForExternalTask, TaskData dict, external system completion |
references/task-management.md |
Task Management — GetFormTasks, CompleteTask, AssignTasks, recovery pattern, escalation pattern, lifecycle |
Quick Generator Reference
| Generator | Activity | Prefix | Key Args |
|---|---|---|---|
gen_create_form_task() |
CreateFormTask | upaf: |
task_title_expr, task_output_variable, form_layout_json, form_data= |
gen_wait_for_form_task() |
WaitForFormTaskAndResume | upaf: |
task_input_variable |
gen_create_external_task() |
CreateExternalTask | upae: |
task_title_expr, task_output_variable, task_data= |
gen_wait_for_external_task() |
WaitForExternalTaskAndResume | upae: |
task_input_variable |
gen_get_form_tasks() |
GetFormTasks | upaf: |
output_variable, filter_expr= |
gen_complete_task() |
CompleteTask | upat: |
task_id_expr, action_expr= |
gen_assign_tasks() |
AssignTasks | upat: |
task_id_expr, user_name_or_email= |
JSON spec "gen" values: create_form_task, wait_for_form_task, create_external_task, wait_for_external_task, get_form_tasks, complete_task, assign_tasks
Common Hallucinations
| Wrong | Right | Impact |
|---|---|---|
TaskObject= |
TaskOutput= (Create) / TaskInput= (Wait) |
Studio crash — property doesn't exist |
EnableDynamicForms="False" |
EnableDynamicForms="True" |
Form designer button does nothing |
| Persistence activity in sub-workflow | Move to Main.xaml | Runtime error — bookmark context unavailable |
Missing UiPath.FormActivityLibrary |
Add explicitly alongside Persistence.Activities | "Install FormActivityLibrary" error in Studio |
"supportsPersistence": false |
Set to true in project.json runtimeOptions |
WaitFor*AndResume fails at runtime |
FormLayout= on CreateExternalTask |
Use TaskData dict instead |
Property doesn't exist on external tasks |
FormData on CreateExternalTask |
Use TaskData dict instead |
Property doesn't exist on external tasks |
Open this reference as its own page
External Task Activities
CreateExternalTask, WaitForExternalTaskAndResume — system-in-the-loop tasks resolved by external systems (JIRA, Salesforce, ServiceNow, custom APIs).
Contents
- Prerequisites
- Create External Task
- Wait for External Task and Resume
- External Task Pattern
- TaskData Dictionary
- Validation & Lint Rules
Prerequisites
Same as Form Tasks:
UiPath.Persistence.ActivitiesNuGet package"supportsPersistence": truein project.jsonruntimeOptionsWaitForExternalTaskAndResumeMUST be in Main.xaml only (persistence point)
Differences from Form Tasks:
UiPath.FormActivityLibraryis NOT required (no form UI)- No form.io schema — external tasks have no visual form in Tasks
- Tasks appear in Tasks as "External" type with no user-facing UI
- Completion happens via Orchestrator API from an external system
Requires namespace:
xmlns:upae="clr-namespace:UiPath.Persistence.Activities.ExternalTask;assembly=UiPath.Persistence.Activities"
Variable for task object: <Variable x:TypeArguments="upae:ExternalTaskData" Name="edtTaskData" />
Create External Task
Creates an Tasks task that will be completed by an external system via the Orchestrator Tasks API.
→ Use gen_create_external_task() from this skill's extensions/generators.py (auto-loaded via plugin system).
Generator JSON Spec
{
"gen": "create_external_task",
"args": {
"task_title_expr": "String.Format(\"JIRA_{0}\", strTicketId)",
"task_output_variable": "edtTaskData",
"task_priority": "High",
"external_tag_expr": "strJiraTicketUrl",
"task_catalog_expr": "in_Config(\"ActionCatalogName\").ToString",
"task_data": {
"ticketId": "strTicketId",
"severity": "strSeverity"
}
}
}
Key Properties
TaskTitle— VB.NET expression for human-readable task nameTaskOutput—upae:ExternalTaskDatavariable that receives the created taskTaskPriority:Low,Medium,High,CriticalTaskCatalog— Action Catalog name (optional, from config)ExternalTag— Tag for the external system reference (e.g., JIRA ticket URL)Labels— Optional labels for categorizationTaskData— Dictionary of key-value pairs sent to the external system
⚠️ WRONG property names (common hallucinations):
TaskObjectdoes NOT exist — useTaskOutputFormLayout/FormDatado NOT exist on external tasks — useTaskDatadict
Generator Python API
gen_create_external_task(
task_title_expr, # VB expression for task title (no brackets)
task_output_variable, # Variable receiving ExternalTaskData (no brackets)
id_ref, # Unique IdRef suffix (injected by dispatcher)
task_data=None, # Dict: {"key": "variable_name"} — optional
task_catalog_expr="", # VB expression for catalog name
task_priority="Medium", # Low | Medium | High | Critical
external_tag_expr="", # VB expression for external tag
display_name="Create External Task",
indent=" "
)
Wait for External Task and Resume
Suspends the workflow until the external system completes the task via the Orchestrator Tasks API (POST /tasks/GenericTasks/CompleteTask).
→ Use gen_wait_for_external_task() from this skill's extensions/generators.py.
Generator JSON Spec
{
"gen": "wait_for_external_task",
"args": {
"task_input_variable": "edtTaskData",
"task_action_variable": "strTaskAction",
"task_output_variable": "edtUpdatedTask"
}
}
Key Properties
TaskInput—upae:ExternalTaskDatavariable fromCreateExternalTask.TaskOutputTaskAction— (optional) receives the action string from the external systemTaskOutput— (optional) receives updatedExternalTaskDatawith completion data- This is a long-running activity — the robot is freed while waiting
Generator Python API
gen_wait_for_external_task(
task_input_variable, # ExternalTaskData from CreateExternalTask.TaskOutput (no brackets)
id_ref, # Unique IdRef suffix (injected by dispatcher)
task_action_variable="", # Optional — receives action string
task_output_variable="", # Optional — receives updated ExternalTaskData
display_name="Wait for External Task and Resume",
indent=" "
)
External Task Pattern
1. Prepare external system data (ticket ID, severity, context)
2. LogMessage → "Creating external task for JIRA..."
3. RetryScope → CreateExternalTask
TaskTitle = String.Format("JIRA_{0}", strTicketId)
TaskData = {ticketId: strTicketId, severity: strSeverity}
ExternalTag = strJiraTicketUrl
→ [edtTaskData]
4. (Optional) Send notification to external system with task ID
e.g., POST to JIRA webhook with edtTaskData.Id
5. WaitForExternalTaskAndResume → [edtTaskData]
(robot released — external system completes via API)
6. Process completion data from edtUpdatedTask
How External Systems Complete Tasks
The external system calls the Orchestrator API:
POST /odata/Tasks/UiPath.Server.Configuration.OData.CompleteTask
{
"taskId": <task_id>,
"action": "Completed",
"comment": "Resolved in JIRA"
}
The task ID is available from ExternalTaskData.Id after creation.
TaskData Dictionary
Unlike Form Tasks (which use FormData with In/Out/InOut bindings), External Tasks use a simple Dictionary(Of String, Argument):
"task_data": {
"ticketId": "strTicketId",
"severity": "strSeverity",
"description": "strDescription"
}
Each entry becomes an InArgument in the dictionary. The external system receives these key-value pairs and can include response data when completing the task.
Anti-pattern: persistence inside a loop/retry scope
WaitForExternalTaskAndResume cannot be nested inside ui:ForEachRow, ui:RetryScope, TryCatch, Parallel, ParallelForEach, Pick, While, or DoWhile, or inside a ui:ForEach whose x:TypeArguments isn't upae:ExternalTaskData. These scopes hold per-iteration or per-branch state that cannot serialize mid-flight when a bookmark suspends the workflow. Studio rejects it with: "Cannot place activity under scope '<name>', as the activity requires persistence and the scope does not offer support for it."
Carve-out: a ui:ForEach x:TypeArguments="upae:ExternalTaskData" (or upaf:FormTaskData) is allowed to contain the Wait — the List<T> + Int32 iteration state serializes cleanly. That's the second loop of the Shadow Task Pattern below.
When iterating over a batch (e.g., one external ticket per input row), use the same Shadow Task Pattern described in form-tasks.md:
- First loop (
ui:ForEachRowover the DataTable, orui:ForEachover a list of inputs):CreateExternalTaskper row, append the returnedExternalTaskDatato aList(ExternalTaskData). The list variable must be initialized (Default="[New System.Collections.Generic.List(Of UiPath.Persistence.Activities.ExternalTask.ExternalTaskData)()]") or the firstInvokeMethod.AddthrowsValue cannot be null. (Parameter 'TargetObject'). - Second loop (
ui:ForEach x:TypeArguments="upae:ExternalTaskData"directly under the rootSequence):WaitForExternalTaskAndResumeper item.
Enforced by AC-27 (lint_persistence_in_unsupported_scope).
Validation & Lint Rules
| Lint | Severity | What it checks |
|---|---|---|
| AC-12 | Warning | CreateExternalTask count should match WaitForExternalTaskAndResume count |
| AC-26 | Error | WaitForExternalTaskAndResume must be in Main.xaml only |
| AC-27 | Error | WaitForExternalTaskAndResume must not be nested in ForEach/ForEachRow/RetryScope/TryCatch/Parallel/Pick/While/DoWhile |
| AC-28 | Warning | CreateExternalTask needs FolderPath set (runtime error code 1101 otherwise) |
| AC-31 | Warning | edtTask.Data("key") is late-bound — use typed Title property or OutArgument variable |
See form-tasks.md for the full Orchestrator-folder and typed-output discussion — same rules apply to external tasks (swap fdt/upaf: for edt/upae:).
Additional checks within AC-12:
TaskOutput="{x:Null}"— warns that task data won't be captured
Config.xlsx Keys (Typical)
ActionCatalogName— Action Catalog name in OrchestratorExternalSystemWebhookUrl— URL to notify the external system of new tasks
Open this reference as its own page
Tasks Activities (Form Tasks)
CreateFormTask, WaitForFormTaskAndResume — human-in-the-loop form approval via UiPath Tasks.
Action Types Comparison
| Type | Namespace Prefix | UI in Tasks | Data Type | Use Case | Reference |
|---|---|---|---|---|---|
| Form Task | upaf: |
form.io form | FormTaskData |
Human fills form, reviews data | This file |
| External Task | upae: |
None (no UI) | ExternalTaskData |
External system resolves via API | external-tasks.md |
| App Task | (future) | UiPath App | AppTaskData |
Rich app UI, actionable notifications | (not yet implemented) |
Task Management activities (CompleteTask, AssignTasks, GetFormTasks) work with any task type. See task-management.md.
Contents
- Action Types Comparison
- Prerequisites
- Create Form Task
- FormData Bindings
- Form.io Component Reference
- Wait for Form Task and Resume
- Typical Tasks Pattern
- Shadow Task Pattern
Prerequisites
Required NuGet packages (add ALL to project.json via resolve_nuget.py):
UiPath.Persistence.Activities— runtime activities (CreateFormTask, WaitForFormTaskAndResume)UiPath.FormActivityLibrary(2.0.7+) — form designer UI in Studio. Without this, Studio shows "Install UiPath.FormActivityLibrary (2.0.7 or above) to enable form designer" and the form designer button does nothing. Note:UiPath.Form.Activitiesdoes NOT transitively installFormActivityLibrary— you must add it explicitly.
project.json requirement: "supportsPersistence": true must be set in runtimeOptions for WaitForFormTaskAndResume (long-running activity that persists state). The scaffold script sets this automatically when UiPath.Persistence.Activities is in deps. If adding to an existing project manually, ensure this flag is true.
⚠️ Main.xaml constraint: All wait-and-resume activities (WaitForFormTaskAndResume, CreateFormTask+wait pairs) are persistence points — the workflow suspends, serializes to the database, and later resumes. These MUST be in Main.xaml (the entry-point file), never in invoked sub-workflows. The persistence bookmark context is only available in the entry-point. Move data prep, UI, and API logic into sub-workflows; keep orchestration + persistence activities in Main.
Requires namespace:
xmlns:upaf="clr-namespace:UiPath.Persistence.Activities.FormTask;assembly=UiPath.Persistence.Activities"
Variable for task object: <Variable x:TypeArguments="upaf:FormTaskData" Name="taskObj" />
Create Form Task
Creates an Tasks task with a form.io-based form layout that a human user can fill in.
→ Use gen_create_form_task() from this skill's extensions/generators.py (auto-loaded via uipath-core's plugin system) — generates correct XAML deterministically.
Generator JSON Spec
{
"gen": "create_form_task",
"args": {
"task_title_expr": "String.Format("DataReview_{0}_{1}", FileName, DateTime.now.ToString("ddMMyyyyhhmmss"))",
"task_output_variable": "taskObj",
"form_layout_json": "{\"components\":[...]}",
"task_catalog_expr": "in_Config("ActionCatalogName").ToString",
"task_priority": "Medium",
"bucket_name_expr": "in_Config("DUStorageBucket").ToString",
"form_data": {
"in_dt_records": ["InOut", "sd:DataTable", "dt_recordsForReview"],
"file_url": ["In", "x:String", "StorageBucketUrl"],
"businessPartnerName": ["In", "x:String", "strBusinessPartnerName"],
"fileName": ["In", "x:String", "FileName"]
}
}
}
Key Properties
FormLayout— JSON string containing form.io schema (see Form.io Component Reference below)FormLayoutGuid/BulkFormLayoutGuid— GUIDs identifying the form layout in OrchestratorTaskCatalog— Action Catalog name from Orchestrator (typically from config dictionary)TaskTitle— VB.NET expression for human-readable task nameTaskPriority:Low,Medium,High,CriticalTaskOutput—upaf:FormTaskDatavariable that receives the created task objectBucketName— storage bucket for attached files (optional)GenerateInputFields="True"— auto-generate input fields from FormDataEnableBulkEdit— feature flag for bulk editing (usually False)EnableDynamicForms="True"— MUST be True to enable the form designer in Studio. When False, the "Open Form Designer" button does nothing even with FormActivityLibrary installed.EnableV2— V2 form engine (usually False)
⚠️ WRONG property name (common hallucination): TaskObject does NOT exist. Use TaskOutput on CreateFormTask and TaskInput on WaitForFormTaskAndResume.
Generator Python API
from extensions.generators import gen_create_form_task # auto-loaded via plugin system
gen_create_form_task(
task_title_expr, # VB.NET expression for task title
task_output_variable, # Variable receiving FormTaskData (no brackets)
form_layout_json, # form.io JSON schema string
id_ref, # Unique IdRef suffix
form_data=None, # Dict: {"fieldKey": ["direction", "type", "variable"]}
task_catalog_expr="", # VB.NET expression for Action Catalog name
task_priority="Medium", # Low | Medium | High | Critical
bucket_name_expr="", # VB.NET expression for storage bucket name
display_name="Create Form Task",
indent=" " # String of spaces (default: 4 spaces)
)
FormData Bindings
The form_data dict in gen_create_form_task() maps form field keys to workflow variables. Each entry is "fieldKey": ["direction", "type", "variable"]:
"In"— workflow → form (read-only, pre-populated)"Out"— form → workflow (user-entered data returned after submission)"InOut"— two-way binding (pre-populated AND user-editable, common for DataTable ↔ datagrid)
The generator handles the {} XAML escape prefix on FormLayout (required because JSON starts with { which the XAML parser would interpret as a markup extension).
Form.io Component Reference
Component Types
textfield — single-line text input
textarea — multi-line text input
number — numeric input
select — dropdown
checkbox — boolean checkbox
datagrid — editable table (maps to DataTable via InOutArgument)
htmlelement — static HTML content (e.g., links, labels)
columns — layout: side-by-side columns
button — submit/action button
Basic Component Structure
{
"label": "Field Label",
"key": "fieldKey", // Must match FormData key
"type": "textfield",
"input": true,
"disabled": true, // Read-only when true
"tableView": true,
"validate": {"required": true} // Optional validation
}
⚠️ Always include a submit button as the last component:
{"type": "button", "label": "Submit", "key": "submit", "action": "submit", "input": true, "tableView": false}
Datagrid (Editable Table → DataTable)
{
"label": "Records",
"key": "in_dt_records", // Must match InOutArgument key
"type": "datagrid",
"input": true,
"disableAddingRemovingRows": true,
"reorder": false,
"hideLabel": true,
"components": [
{"label": "Raw Input", "key": "rawInput", "type": "textarea", "disabled": true},
{"label": "City", "key": "ville", "type": "textfield", "validate": {"required": true}}
]
}
HTML Element with Dynamic Data Binding
{
"label": "HTML",
"key": "file_url",
"type": "htmlelement",
"input": false,
"content": "<a href=\"{{data.file_url}}\">{{data.fileName}}</a>"
}
{{data.fieldKey}}— Mustache template syntax referencing other form field values
Wait for Form Task and Resume
Suspends the workflow (releases the robot) until a human user submits the form in Tasks. The workflow resumes automatically after submission.
→ Use gen_wait_for_form_task() from this skill's extensions/generators.py (auto-loaded via uipath-core's plugin system) — generates correct XAML deterministically.
Generator JSON Spec
{
"gen": "wait_for_form_task",
"args": {
"task_input_variable": "taskObj",
"task_action_variable": "strTaskAction",
"task_output_variable": "taskObjUpdated"
}
}
Key Properties
task_input_variable— theupaf:FormTaskDatavariable fromgen_create_form_task()'stask_output_variabletask_action_variable— (optional) receives the action taken by user (e.g., "submit", "reject")task_output_variable— (optional) receives updated FormTaskData after submission- This is a long-running activity — the robot is freed while waiting. Workflow state is persisted to Orchestrator.
Generator Python API
from extensions.generators import gen_wait_for_form_task # auto-loaded via plugin system
gen_wait_for_form_task(
task_input_variable, # FormTaskData variable from CreateFormTask.TaskOutput (no brackets)
id_ref, # Unique IdRef suffix
task_action_variable="", # Optional — receives action string
task_output_variable="", # Optional — receives updated FormTaskData
display_name="Wait for Form Task and Resume",
indent=" " # String of spaces (default: 4 spaces)
)
Typical Tasks Pattern
1. Check if task is needed (If condition)
2. LogMessage → "Creating AC task..."
3. RetryScope → CreateFormTask (resilience against transient failures)
TaskCatalog = config("ActionCatalogName")
TaskTitle = String.Format("TaskType_{0}_{1}", docName, timestamp)
FormData binds workflow variables to form fields
→ [taskObj]
4. WaitForFormTaskAndResume → [taskObj]
(robot released — human completes form in Tasks)
5. Process user input from InOutArgument/OutArgument variables
Shadow Task Pattern (default for N-item batches)
This is the default shape any time the workflow creates a task per item in a collection — DataTable rows, a list of documents, N invoices, N records, etc. Not an advanced pattern. Any PDD that reads "for each X, create an approval task" maps to this pattern directly.
Two antipatterns to avoid
- Inline Create → Wait per item at flat Sequence level. Each
CreateFormTaskis immediately followed by itsWaitForFormTaskAndResumein the same Sequence. Approvals run strictly sequentially; the robot is tied up for the sum of all human wait times instead of the max. Enforced by AC-34. - Unrolled loop by row-index. Hardcoded
If dt.Rows.Count >= Nblocks that readdt.Rows(0)..Rows(N-1)into the same scalarFormTaskDatavariable, each block containing an inline Create → Wait. Same performance failure as (1), and additionally bypasses AC-27 because there's no loop scope. Enforced by AC-34 via theRows(\d+)row-index signal + the reused-TaskOutput-variable signal.
❌ Unrolled-by-index (the pattern AC-34 catches):
<If Condition="[dt.Rows.Count >= 1]">
<Sequence>
<upaf:CreateFormTask TaskOutput="[fdtTask]" ... /> <!-- dt.Rows(0) -->
<upaf:WaitForFormTaskAndResume TaskInput="[fdtTask]" ... />
</Sequence>
</If>
<If Condition="[dt.Rows.Count >= 2]">
<Sequence>
<upaf:CreateFormTask TaskOutput="[fdtTask]" ... /> <!-- dt.Rows(1), same variable -->
<upaf:WaitForFormTaskAndResume TaskInput="[fdtTask]" ... />
</Sequence>
</If>
<!-- repeat for Rows(2..N-1) -->
Historical note — two-task shadow pattern
A related, distinct pattern from production workflows uses one shadow task + one main task for a single workflow entity (not N items):
1. Create "shadow" task first (a lightweight form for preliminary data)
2. Create main review task (with full form + datagrid of records)
3. WaitForFormTaskAndResume → main task
4. After main task completes, WaitForFormTaskAndResume → shadow task
(shadow task was already submitted by user earlier — bot just catches up)
This avoids blocking: the shadow task doesn't delay creation of the main task. AC-34 is tuned to stay silent on this case (only 2 flat Creates, no row-index unroll, distinct TaskOutput variables).
Anti-pattern: persistence inside a loop/retry scope
WaitForFormTaskAndResume cannot be nested inside ui:ForEachRow, ui:RetryScope, TryCatch, Parallel, ParallelForEach, Pick, While, or DoWhile, or inside a ui:ForEach whose x:TypeArguments isn't a persistable task-data type. These scopes hold per-iteration or per-branch state that cannot serialize mid-flight when a bookmark suspends the workflow. Studio rejects it at validation time with: "Cannot place activity under scope '<name>', as the activity requires persistence and the scope does not offer support for it."
The one carve-out: a ui:ForEach x:TypeArguments="upaf:FormTaskData" (or upae:ExternalTaskData) is allowed to contain Wait*AndResume. Studio accepts it because the iteration state is just List<FormTaskData> + Int32 index — both fully persistable. This is exactly the ✅ Shadow Task Pattern's second loop below. AC-27 has a targeted carve-out for these two item types; any other ui:ForEach<T> (e.g. x:String, sd:DataRow, x:Int32) still fails.
❌ Wrong — wait nested inside ui:ForEachRow:
<ui:ForEachRow DisplayName="For Each Invoice">
<ui:ForEachRow.Body>
<ActivityAction x:TypeArguments="sd:DataRow">
<Sequence>
<upaf:CreateFormTask TaskOutput="[fdtInvoiceTask]" ... />
<upaf:WaitForFormTaskAndResume TaskInput="[fdtInvoiceTask]" ... /> <!-- fails validation -->
</Sequence>
</ActivityAction>
</ui:ForEachRow.Body>
</ui:ForEachRow>
✅ Right — Shadow Task Pattern: collect tasks in the loop, wait outside:
The List(FormTaskData) variable MUST be initialized before the create loop runs. A bare <Variable x:TypeArguments="scg:List(upaf:FormTaskData)" Name="lstInvoiceTasks" /> leaves the variable Nothing, and the first InvokeMethod.Add throws Value cannot be null. (Parameter 'TargetObject') at runtime. Set the Default attribute on the variable declaration:
<Variable x:TypeArguments="scg:List(upaf:FormTaskData)" Name="lstInvoiceTasks"
Default="[New System.Collections.Generic.List(Of UiPath.Persistence.Activities.FormTask.FormTaskData)()]" />
Use the fully qualified VB type name inside Default="[...]" — XAML namespace prefixes like upaf: are for the XAML type system and don't resolve inside a VB expression. For JSON spec authors using generate_workflow.py, pass it via the variable's default key.
<ui:ForEachRow DisplayName="For Each Invoice">
<ui:ForEachRow.Body>
<ActivityAction x:TypeArguments="sd:DataRow">
<Sequence>
<upaf:CreateFormTask TaskOutput="[fdtInvoiceTask]" ... />
<InvokeMethod MethodName="Add">
<InvokeMethod.TargetObject>
<InArgument x:TypeArguments="scg:List(upaf:FormTaskData)">[lstInvoiceTasks]</InArgument>
</InvokeMethod.TargetObject>
<InvokeMethod.Parameters>
<InArgument x:TypeArguments="upaf:FormTaskData">[fdtInvoiceTask]</InArgument>
</InvokeMethod.Parameters>
</InvokeMethod>
</Sequence>
</ActivityAction>
</ui:ForEachRow.Body>
</ui:ForEachRow>
<ui:ForEach x:TypeArguments="upaf:FormTaskData" Values="[lstInvoiceTasks]">
<ui:ForEach.Body>
<ActivityAction x:TypeArguments="upaf:FormTaskData">
<Sequence>
<upaf:WaitForFormTaskAndResume TaskInput="[item]" ... />
<!-- handle decision here -->
</Sequence>
</ActivityAction>
</ui:ForEach.Body>
</ui:ForEach>
Enforced by AC-27 (lint_persistence_in_unsupported_scope).
InvokeMethod notes
InvokeMethod lives in the default activities namespace (http://schemas.microsoft.com/netfx/2009/xaml/activities), not under ui:. Using <ui:InvokeMethod> fails Studio validation with "Could not find type 'InvokeMethod' in namespace 'http://schemas.uipath.com/workflow/activities'" (AC-29). Also set TargetObject via element form, because the attribute-form TargetObject="[expr]" doesn't always dispatch through the InArgument converter (AC-30).
Using an external form file (DynamicFormPath)
When the form is large or shared across workflows, keep it in a .json file under the project and set:
EnableDynamicForms="True"DynamicFormPath="Forms\MyForm.json"(relative to project root)
Generating both sides at once
gen_create_form_task accepts two optional kwargs that write the external file for you:
dynamic_form_path— project-relative path, emitted verbatim as theDynamicFormPathattribute.project_root— absolute path to the project directory. When set together withdynamic_form_path, the form schema is converted to the UiPath external-file shape ({"components":[...]}→{"id":"<guid>","form":[...]}) and written to<project_root>/<dynamic_form_path>. Parent directories are created automatically.
gen_create_form_task(
task_title_expr='"Review Invoice"',
task_output_variable="fdtTask",
form_layout_json='{"components":[...]}', # standard form.io shape
id_ref="CreateFormTask_1",
dynamic_form_path="Forms/InvoiceApproval.json",
project_root=r"C:\…\InvoiceApprovalProcess",
)
The helper form_layout_to_external_file(form_layout_json, form_id=None) exposes the shape conversion standalone — useful when you're writing the file yourself or migrating an existing workflow from inline FormLayout to a sibling file.
Lints that enforce this pattern
- AC-32 (
lint_dynamic_form_path_missing_file) — fires whenDynamicFormPathis set but the referenced file is missing, unreadable, or uses the wrong root key (components/bare array instead ofform) or lacks the requiredid. Catches the runtime errors listed below before they hit Studio or Action Center. - AC-33 (
lint_inline_form_layout_should_extract) — warns when inlineFormLayoutexceeds 500 chars of raw JSON whileDynamicFormPath="{x:Null}". Recommends extraction so the form designer can edit it and diffs stay clean.
The file schema is NOT standard form.io. UiPath expects:
{
"id": "<any-guid-or-slug>",
"form": [
{ "label": "Supplier", "key": "supplier", "type": "textfield", "input": true, "disabled": true, "tableView": true },
{ "label": "Action", "key": "action", "type": "select", "input": true,
"data": { "values": [ { "label": "Approve", "value": "approve" }, { "label": "Reject", "value": "reject" } ] },
"validate": { "required": true } },
{ "type": "button", "label": "Submit", "key": "submit", "action": "submit", "input": true }
]
}
Critical differences from standard form.io:
- Root key is
form, notcomponents. - Root
idis required (any string). - No
display,name,titlewrapper fields needed.
Wrong shapes produce misleading runtime errors (all observed):
{"components":[...]}→Cannot deserialize the current JSON object into List<FormIOComponent> ... Path 'components'.[...](bare array) →JArray does not contain a definition for 'id'.{"display":"form","components":[...]}→Form File has invalid format.
Reading task output
After WaitForFormTaskAndResume completes, prefer typed properties and your OutArgument variables over .Data("key") access.
FormTaskData.Data is a weakly-typed dictionary. Calling fdtTask.Data("invoiceNumber") returns Object, which fails under Option Strict On with "BC30574: Option Strict On disallows late binding" (AC-31).
<!-- ❌ Wrong -->
<ui:LogMessage Message="[String.Format("Invoice {0} approved", fdtTask.Data("invoiceNumber").ToString())]" />
<!-- ✅ Right — use the typed Title property (already formatted via CreateFormTask.TaskTitle) -->
<ui:LogMessage Message="[String.Format("{0} approved", fdtTask.Title)]" />
<!-- ✅ Right — use the OutArgument variable you bound in CreateFormTask.FormData -->
<ui:LogMessage Message="[String.Format("Invoice {0} approved", strInvoiceNum)]" />
FormData OutArgument bindings (<OutArgument x:Key="fieldKey">[strMyVar]</OutArgument> inside <upaf:CreateFormTask.FormData>) set typed variables at resume time — that's the strongly-typed path.
Orchestrator folder (FolderPath)
CreateFormTask (and CreateExternalTask) needs to know which Orchestrator folder to create the task in. Without it, runtime fails with "A folder is required for this action. Error code: 1101" (AC-28).
Set the FolderPath attribute on CreateFormTask to an Orchestrator folder name (e.g. "Shared", or a Config.xlsx key). Studio injects this automatically when you set the value via the Properties panel.
WaitForFormTaskAndResume does not declare a FolderPath property — the wait operates on the FormTaskData returned by CreateFormTask, which already carries the folder context. Adding FolderPath to the wait activity makes Studio demote it to UnresolvedActivity and crash the FlowchartDesigner.
Validation & Lint Rules
These lint rules live in uipath-core's validate_xaml and apply to Tasks workflows:
| Lint | Severity | What it checks |
|---|---|---|
| AC-10 | Warning | CreateFormTask count must match WaitForFormTaskAndResume count |
| AC-26 | Error | Persistence activities (WaitForFormTaskAndResume) must be in Main.xaml only |
| AC-27 | Error | Persistence activities must not be nested in ForEach/ForEachRow/RetryScope/TryCatch/Parallel/Pick/While/DoWhile |
| AC-28 | Warning | CreateFormTask needs FolderPath set (runtime error code 1101 otherwise) |
| AC-29 | Error | <ui:InvokeMethod> doesn't exist — use default namespace <InvokeMethod> |
| AC-30 | Warning | <InvokeMethod TargetObject="[expr]"> attribute form; use element form with typed InArgument |
| AC-31 | Warning | fdtTask.Data("key") is late-bound — use typed Title property or OutArgument variable |
| AC-34 | Error/Warning | Unrolled / sequential per-item Create → Wait — use Shadow Task Pattern (ForEach over collection + List(FormTaskData) + second ForEach) |
Additional checks within lint 10:
TaskOutput="{x:Null}"— warns that task data won't be capturedEnableDynamicForms="False"— warns that form designer won't work
Config.xlsx Keys (Typical)
Tasks workflows commonly need these keys in Config.xlsx (Settings sheet):
ActionCatalogName— Action Catalog name in OrchestratorDUStorageBucket— Document Understanding storage bucket (if using file attachments)
Open this reference as its own page
Task Management Activities
GetFormTasks, CompleteTask, AssignTasks — programmatic task retrieval, completion, and assignment for Tasks workflows.
Contents
- Prerequisites
- Get Form Tasks
- Complete Task
- Assign Tasks
- Recovery Workflow Pattern
- Escalation Pattern
- Task Lifecycle States
Prerequisites
Required NuGet package:
UiPath.Persistence.Activities
Note: These activities are NOT persistence points — they make API calls to Orchestrator and return immediately. They can be used in sub-workflows (no Main.xaml constraint). supportsPersistence is only required if the same workflow also uses Wait*AndResume activities.
Requires namespaces:
xmlns:upaf="clr-namespace:UiPath.Persistence.Activities.FormTask;assembly=UiPath.Persistence.Activities"
xmlns:upat="clr-namespace:UiPath.Persistence.Activities.Tasks;assembly=UiPath.Persistence.Activities"
Get Form Tasks
Retrieves existing form tasks from Orchestrator using OData query parameters. Used for recovery workflows (retrieve tasks created by another process), status monitoring, and cross-process orchestration.
→ Use gen_get_form_tasks() from this skill's extensions/generators.py.
Generator JSON Spec
{
"gen": "get_form_tasks",
"args": {
"output_variable": "lstFormTasks",
"filter_expr": "Status eq 'Pending'",
"task_catalog_name_expr": "in_Config(\"ActionCatalogName\").ToString",
"top_expr": "100",
"order_by_expr": "CreationTime desc"
}
}
Key Properties
TaskObjects— output variable receivingList(FormTaskData)Filter— OData filter expression (e.g.,"Status eq 'Pending'","Title eq 'Review_Invoice'")TaskCatalogName— filter by Action Catalog (optional)Top— limit number of results (OData$top)Skip— skip results for pagination (OData$skip)OrderBy— sort order (OData$orderby)Expand/Select/Reference— advanced OData parameters (usually{x:Null})
Generator Python API
gen_get_form_tasks(
output_variable, # Variable receiving List(FormTaskData) (no brackets)
id_ref, # Unique IdRef suffix (injected)
filter_expr="", # OData filter string
task_catalog_name_expr="", # VB expression for catalog name
top_expr="", # OData $top
skip_expr="", # OData $skip
order_by_expr="", # OData $orderby
display_name="Get Form Tasks",
indent=" "
)
OData Filter Examples
Status eq 'Pending' — pending tasks only
Status eq 'Unassigned' — unassigned tasks
Title eq 'Review_Invoice_001' — specific task by title
CreationTime gt 2024-01-01T00:00:00Z — tasks created after date
Status eq 'Pending' and Title startswith 'JIRA' — combined filters
Variable type: <Variable x:TypeArguments="scg:List(upaf:FormTaskData)" Name="lstFormTasks" />
Complete Task
Programmatically completes an Tasks task. Works with any task type (form, external, app). Used for timeout handlers, automated escalation, and bulk operations.
→ Use gen_complete_task() from this skill's extensions/generators.py.
Generator JSON Spec
{
"gen": "complete_task",
"args": {
"task_id_expr": "lstFormTasks(0).Id.Value",
"action_expr": "Approved",
"display_name": "Complete Task"
}
}
Key Properties
TaskId— VB expression evaluating to the task ID (Long)Action— completion action string (e.g.,"Completed","Approved","Rejected")Data— optional additional data (usually{x:Null})
Generator Python API
gen_complete_task(
task_id_expr, # VB expression for task ID (no brackets)
id_ref, # Unique IdRef suffix (injected)
action_expr="Completed", # Completion action string
display_name="Complete Task",
indent=" "
)
Task ID Access Patterns
' From GetFormTasks result:
lstFormTasks(0).Id.Value
' From CreateFormTask output:
fdtTaskData.Id.Value
' From a stored variable:
longTaskId
Assign Tasks
Assigns an Tasks task to a specific user or group.
→ Use gen_assign_tasks() from this skill's extensions/generators.py.
Generator JSON Spec
{
"gen": "assign_tasks",
"args": {
"task_id_expr": "fdtTaskData.Id.Value",
"user_name_or_email": "manager@company.com",
"assignment_criteria": "SingleUser",
"display_name": "Assign to Manager"
}
}
Key Properties
TaskId— VB expression for task IDUserNameOrEmail— email or username of the assignee (for SingleUser)TaskAssignmentType—"Assign"(always Assign for new assignments)EnableMultipleAssignments— whether multiple users can be assigned (default False)AssignmentCriteria— child element specifying assignment strategy
Assignment Criteria Options
| Criteria ID | Description | When to use |
|---|---|---|
SingleUser |
Assign to a specific user by email | Most common — direct assignment |
AllUsersInGroup |
Assign to all users in a group | Group-based routing, any member can pick up |
Generator Python API
gen_assign_tasks(
task_id_expr, # VB expression for task ID (no brackets)
id_ref, # Unique IdRef suffix (injected)
user_name_or_email="", # Email/username (for SingleUser)
group_expr="", # VB expression for group name (for AllUsersInGroup)
assignment_criteria="SingleUser", # "SingleUser" or "AllUsersInGroup"
display_name="Assign Tasks",
indent=" "
)
Recovery Workflow Pattern
When a process crashes after creating a form task but before waiting for it, the task is orphaned in Orchestrator. A recovery workflow retrieves and resumes processing:
1. GetFormTasks — Filter="Status eq 'Pending' and Title startswith 'Review_'"
→ [lstFormTasks]
2. ForEach task in lstFormTasks:
a. GetTaskData (or access task properties directly)
b. Process the task data
c. CompleteTask — Action="Recovered"
3. LogMessage — "Recovered {lstFormTasks.Count} orphaned tasks"
Key point: GetFormTasks can be in a sub-workflow. Only WaitFor*AndResume activities must be in Main.xaml.
Escalation Pattern
When a task exceeds its SLA or needs reassignment:
1. CreateFormTask → [fdtTaskData]
2. WaitForFormTaskAndResume → [fdtTaskData]
3. If user action = "Escalate":
a. AssignTasks — forward to senior reviewer
TaskId = fdtTaskData.Id.Value
UserNameOrEmail = "senior.reviewer@company.com"
b. WaitForFormTaskAndResume → [fdtTaskData] (wait again for senior)
4. Process final decision
Task Lifecycle States
Unassigned ──→ Pending ──→ Completed
│ │
│ ├── (user submits form)
│ ├── (external system calls API)
│ └── (CompleteTask activity)
│
└── (AssignTasks activity or auto-assignment)
| State | Description |
|---|---|
Unassigned |
Task created but not yet assigned to a user |
Pending |
Task assigned to user, waiting for completion |
Completed |
Task completed (irreversible) |
Note: Task completion is irreversible. Once completed, a task cannot be reopened.
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.
