next_task
Pick the next task assigned to you that is ready to start and that no other agent is working on, and lease it, in one call. Use this instead of listing tasks and then claiming one: between the list and the claim a second agent can take it, and this avoids that race. Passes over DONE and BLOCKED tasks; tasks with a finish-to-start predecessor that is not DONE yet (any open predecessor counts, and lag is not considered; start-to-start, finish-to-finish and start-to-finish links do not hold a task back); tasks another agent holds a lease on; and tasks you lack permission to lease (the same rule as claim_task: task.edit.any on the project, or task.edit.own on a task you are assigned or created). Containers (tasks with subtasks other than milestones) and milestones are never offered: a container's subtasks are offered on their own, and a milestone is a date, not work. Order: earliest due date first (no due date last), then highest priority, then oldest. With includeUnassigned=true, unassigned tasks in projects you are a member of are offered too, under the same rules, and only after every one of your assigned tasks. Returns claimed=false when nothing passes. Optional projectId narrows to one project. Renew within 3 minutes and call release_task when finished.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | How many candidates to try before giving up, in each queue (your assigned tasks, then unassigned ones when includeUnassigned is true). Default 10, max 25. | |
| projectId | No | Only consider tasks in this project. | |
| includeUnassigned | No | Default false. When true, unassigned tasks in projects you are a member of are offered after all of your assigned tasks. Leasing one does not assign it to you. |