> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chamelio.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# flows.tasks.completed

> Fired when all steps of a workflow task have been completed successfully.

## Event

```
flows.tasks.completed
```

This event fires when a task reaches its final step and is marked as completed. All documents, signatures, and outputs are finalized at this point.

## Payload Example

```json theme={null}
{
  "event": "flows.tasks.completed",
  "event_id": "evt_01HXYZ9900112233",
  "organization_id": "org_abc123",
  "timestamp": "2025-06-07T14:00:00Z",
  "data": {
    "task_id": "task_def456",
    "workflow_id": "wf_contract_review",
    "workflow_name": "Contract Review",
    "initiated_by": "john.doe@example.com",
    "completed_at": "2025-06-07T14:00:00Z",
    "duration_hours": 29.5,
    "variables": {
      "contract_name": "Vendor Agreement Q3",
      "counterparty": "Acme Corp"
    },
    "outputs": {
      "signed_document_id": "file_signed_xyz789"
    }
  }
}
```

## Payload Fields

### Envelope

| Field             | Type   | Description                                     |
| ----------------- | ------ | ----------------------------------------------- |
| `event`           | string | Always `flows.tasks.completed`                  |
| `event_id`        | string | Unique delivery ID — use to deduplicate retries |
| `organization_id` | string | ID of the organization                          |
| `timestamp`       | string | ISO 8601 UTC timestamp of the event             |
| `data`            | object | Event-specific payload (see below)              |

### Data Object

| Field            | Type   | Description                                                   |
| ---------------- | ------ | ------------------------------------------------------------- |
| `task_id`        | string | Unique identifier of the completed task                       |
| `workflow_id`    | string | ID of the parent workflow                                     |
| `workflow_name`  | string | Human-readable workflow name                                  |
| `initiated_by`   | string | Email of the user who initiated the task                      |
| `completed_at`   | string | ISO 8601 UTC timestamp of task completion                     |
| `duration_hours` | number | Total time from task creation to completion, in hours         |
| `variables`      | object | Input variables provided at task initiation                   |
| `outputs`        | object | Key outputs generated by the task (e.g., signed document IDs) |

## Notes

<Tip>
  Use this event to trigger post-completion actions in your systems — such as archiving signed documents, updating a CRM record, or notifying stakeholders.
</Tip>
