You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/human_in_the_loop.md
+55-1Lines changed: 55 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@ For more information on UiPath apps, refer to the [UiPath Apps User Guide](https
20
20
-**title** (str): The title of the action to create.
21
21
-**data** (Optional[Dict[str, Any]]): Values that the action will be populated with.
22
22
-**assignee** (Optional[str]): The username or email of the person assigned to handle the escalation.
23
+
-**recipient** (Optional[TaskRecipient]): A structured recipient that assigns the action to a specific user (by email or id) or group (by name or id). Takes precedence over **assignee** when both are set. See [Assigning the action to a user or group](#assigning-the-action-to-a-user-or-group).
23
24
24
25
#### Example:
25
26
@@ -35,6 +36,57 @@ The human's decision (which Approve/Reject button was clicked, stored in `task.a
35
36
36
37
For a practical implementation of the `CreateTask` model, refer to the [ticket-classification sample](https://github.com/UiPath/uipath-langchain-python/tree/main/samples/ticket-classification). This sample demonstrates how to create an action with dynamic input.
37
38
39
+
#### Assigning the action to a user or group
40
+
41
+
`CreateTask` and `CreateEscalation` — together with their wait counterparts [`WaitTask`](#2-waittask) and [`WaitEscalation`](#4-waitescalation) — support two ways to assign the action:
42
+
43
+
-**assignee** (Optional[str]): The simple shortcut — a single username or email.
44
+
-**recipient** (Optional[TaskRecipient]): A structured recipient that can target a **user** (by email or id) or a **group** (by name or id). When both are provided, **`recipient` takes precedence over `assignee`**.
45
+
46
+
`TaskRecipient` is imported from `uipath.platform.action_center.tasks` and has the following fields:
47
+
48
+
-**type** (TaskRecipientType): The kind of recipient (see the table below).
49
+
-**value** (str): The identifier — an email, group name, user id, or group id, matching `type`.
50
+
-**display_name** (Optional[str]): An optional human-readable name. For `USER_ID` and `GROUP_ID` recipients it is resolved automatically from the identity service.
51
+
52
+
| TaskRecipientType | Assigns to |`value` holds |
53
+
| --- | --- | --- |
54
+
|`EMAIL`| a single user, by email | the user's email |
55
+
|`USER_ID`| a single user, by id | the user id |
56
+
|`GROUP_NAME`| a group, by name | the group name |
57
+
|`GROUP_ID`| a group, by id | the group id |
58
+
59
+
#### Example:
60
+
61
+
```python
62
+
from uipath.platform.common import CreateTask
63
+
from uipath.platform.action_center.tasks import TaskRecipient, TaskRecipientType
The same `recipient` field is available on `CreateEscalation`, `WaitTask`, and `WaitEscalation`.
89
+
38
90
---
39
91
40
92
### 2. WaitTask
@@ -45,6 +97,7 @@ The `WaitTask` model is used to wait for a task to be handled. This model is int
45
97
46
98
-**task** (Task): The instance of the task to wait for.
47
99
-**app_folder_path** (Optional[str]): The folder path of the app.
100
+
-**recipient** (Optional[TaskRecipient]): Optionally assign the task to a user or group while waiting. See [Assigning the action to a user or group](#assigning-the-action-to-a-user-or-group).
48
101
49
102
#### Example:
50
103
@@ -62,7 +115,7 @@ Like `CreateTask`, the return value is the task output only. Use [`WaitEscalatio
62
115
63
116
The `CreateEscalation` model creates an Action Center action the same way `CreateTask` does, but when the agent resumes it receives the **full `Task` object** instead of just `task.data`. Use this when the agent needs to branch on the human's decision (the button the reviewer clicked, stored in `task.action`) rather than only on the data fields written back by the app.
64
117
65
-
Accepts the same attributes as [`CreateTask`](#1-createtask).
118
+
Accepts the same attributes as [`CreateTask`](#1-createtask), including `assignee` and `recipient` (see [Assigning the action to a user or group](#assigning-the-action-to-a-user-or-group)).
66
119
67
120
#### Example:
68
121
@@ -98,6 +151,7 @@ The return value is the full `Task` object (including `task.action`, `task.data`
98
151
99
152
-**action** (Task): The instance of the task to wait for.
100
153
-**app_folder_path** (Optional[str]): The folder path of the app.
154
+
-**recipient** (Optional[TaskRecipient]): Optionally assign the task to a user or group while waiting. See [Assigning the action to a user or group](#assigning-the-action-to-a-user-or-group).
0 commit comments