Skip to main content

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​

Work Planning admitted the next unit; the body is the acknowledgement.

Response Headers
    Idempotency-Replayed

    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.