Human Task Activities
Version: 1.3.3 · ID: zoan-packages-human-tasks · Author: Zoan Software
The Human Tasks package lets a process ask a person for a decision: approve a refund, validate a piece of data the robot couldn’t read well, choose among several options. The robot creates a task in the Zoan Cloud Tasks inbox, with the files the person needs to decide; the person reviews it, decides (and, if needed, fills in a few fields or a complete form, with tables and attachments) and the process continues with that decision.
How a task works
Section titled “How a task works”- The robot creates the task with Create Human Task: a title, the context, the data the person must see, the attachments and the decision options (Aprobar and Rechazar —approve / reject— by default).
- The task is always addressed to a person (by email) or a role: only they see it in the Zoan Cloud Tasks inbox and get an email with the link. A person with several roles sees the tasks of all their roles.
- Someone claims the task, reviews the data and decides, with an optional comment and the fields you ask for.
- The process receives the decision, the comment and the fields; the files the person attached in their answer are downloaded with Download Human Task File.
A task goes through these statuses:
| Status | Meaning |
|---|---|
pending | Created, waiting for someone to claim it. |
claimed | A person claimed it and is reviewing it. |
completed | Decided. The chosen option is in decision. |
cancelled | Cancelled (by the process or by a person). |
expired | The deadline (dueInHours) passed without a decision. |
Three ways to wait for the decision
Section titled “Three ways to wait for the decision”The robot doesn’t “sleep” indefinitely, so choose the pattern based on how long the decision may take:
- Minutes → wait in the same process. Create the task and use Wait for Human Task: the robot checks the task every few seconds and continues when someone decides. Ideal for a quick approval in the middle of a process.
- Hours or days → resume with another process. Create the task with
onCompleteProcessand end the process. When someone decides (or the task expires, or a person cancels it from Zoan Cloud), Zoan Cloud runs that other process with the decision as inputs, on the same agent and robot session. - Batches → work queue. If there are many decisions (fifty invoices a supervisor approves one after another), link each task to a queue item with
queueName: a single performer processes everything that was decided. The Human decisions in batches guide explains it.
Activities
Section titled “Activities”| Activity | Type | Output | What it does |
|---|---|---|---|
| Create Human Task | human-task-create | object | Creates a task for a person to decide |
| Wait for Human Task | human-task-wait | object | Waits for the task to be decided, cancelled or expire |
| Cancel Human Task | human-task-cancel | object | Cancels a task that’s still open |
| Download Human Task File | human-task-download-file | List<string> | Downloads the files the person attached in their answer |
The task the activities return
Section titled “The task the activities return”Create, Wait and Cancel return the task as a dictionary with the same keys:
| Field | Type | Description |
|---|---|---|
id | string | Task id. |
status | string | One of the statuses above (or timeout in Wait for Human Task). |
title | string | Title. |
decision | string | Chosen option; null until someone decides. |
comment | string | Comment of whoever decided, or the cancellation reason. |
fields | Dictionary | Fields the person filled in (empty until someone decides). |
form | Dictionary | name and version of the form, or null. |
A typical flow
Section titled “A typical flow”Ask for approval of a refund and act on the decision:
Create Human Task title = "Approve refund #0001" data = { "Customer": "Test customer", "Amount": "150.00" } assignRole = "tenant-admin" → output: taskWait for Human Task taskId = task["id"] timeoutMinutes = 30 → output: resultIf condition = result["decision"] == "Aprobar" ├─ then: │ ... record the refund ... └─ else: Log level = info message = "Refund not approved: " + str(result["status"])Next steps
Section titled “Next steps”- Create Human Task — every task option.
- Use a form from a robot — ask for data with a form from the library.
- Human decisions in batches — the pattern with work queues.
- Work queues — how items and their statuses work.