External-tasks
Part of Uipath tasks. Install the skill and your agent reads this page when it needs the depth.
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