Now inviting automation leaders: publish your playbook as a skill, under your own name. Publish yours →
Automation Skills
All skills/Uipath tasks/External-tasks
Reference · Uipath tasks

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

Same as Form Tasks:

Differences from Form Tasks:

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

⚠️ WRONG property names (common hallucinations):

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

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:

  1. First loop (ui:ForEachRow over the DataTable, or ui:ForEach over a list of inputs): CreateExternalTask per row, append the returned ExternalTaskData to a List(ExternalTaskData). The list variable must be initialized (Default="[New System.Collections.Generic.List(Of UiPath.Persistence.Activities.ExternalTask.ExternalTaskData)()]") or the first InvokeMethod.Add throws Value cannot be null. (Parameter 'TargetObject').
  2. Second loop (ui:ForEach x:TypeArguments="upae:ExternalTaskData" directly under the root Sequence): WaitForExternalTaskAndResume per 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:

Config.xlsx Keys (Typical)

Publish your skill

Copy this prompt into Claude Code, Codex or any agent. It walks you through your first skill in about 20 minutes, with you as the author.

Click to copy.