# Send a task and collect its result

Deliver a correlated task to a connected peer and read the result by task ID.

MAO gives each delivered task a stable ID and tracks its progress. Connect the sender and recipient before sending the task.

## Send and finish a task

1. From the sender’s terminal, run `mao ask <agent> <prompt>` to send a task and wait for its result.
2. For manual delivery, run `mao send <peer> <prompt>`.
3. On the recipient, run `mao next` to claim the task.
4. Return the task ID and result with `mao result <task-id> <content>`.
5. On the sender, run `mao wait <task-id>` to read a pending result.

> **Note:** Task states include pending, delivered, completed, and failed.

> **Limit:** Prompts and results are limited to 1 MiB. After a crash, unfinished work can be delivered again, so recipients should tolerate duplicate tasks.

Source: https://trymao.dev/docs/connections-orchestration-mao-cli/task-delivery
