Ask the Work Planning agent (over A2A) to admit the next unit for a path
POST/paths/:pathId/work-requests
The PULL side of the execution/planning seam (ADR-0058): execution, whose claimable queue for a process path is draining, delegates "admit the next priority-ordered unit" to the wes-work-planning A2A agent. Planning keeps every release decision (release policy, WIP invariant); execution keeps the judgement of when to ask. The authoritative fact still arrives as the WorkReleased CloudEvent on Kafka through the existing consumer — the 200 body is only the delegation acknowledgement. Each call asks for exactly one unit, so the route is behind the idempotency middleware (ADR-0058, ADR-0060): a retry of ONE logical pull (same Idempotency-Key, same path) replays the stored answer with Idempotency-Replayed: true, while a legitimate second pull sends a new key. Answers 503 when this deployment has no WORK_PLANNING_A2A_URL configured, and 502 when the planning agent is unreachable or answers off-contract.
Request
Responses
- 200
- 400
- 404
- 409
- 502
- 503
Work Planning admitted the next unit; the body is the acknowledgement.
Response Headers
Present, with the value true, ONLY when this answer is the stored replay of an earlier request that used the same Idempotency-Key (the handler did not run again). The first execution never carries it.
The Idempotency-Key header is missing (idempotency-key-required) or not 1-128 printable ASCII characters (idempotency-key-invalid) on a POST, or the request body could not be read or contains a NUL character (malformed-request-body), or the request body is malformed JSON, a required field is missing or empty, or a field value is invalid (e.g. a task type outside the TaskType enum).
Work Planning does not know this process path.
Work Planning rejected the pull with a business rule (empty pool or WIP limit reached); nothing was released. The same Idempotency-Key reused with a different method, path or body is also a 409, problem type idempotency-key-reused.
The planning agent was unreachable or answered off-contract.
Work-planning delegation is not configured on this deployment.