An insurer's claims orchestrator runs as short-lived serverless functions. It delegates fraud reviews to a remote A2A agent, and a review can take several hours. The orchestrator cannot keep a connection open between invocations, and the platform team has banned tight polling loops because of cost. How should the orchestrator receive the review's result?
- A.
Call the task retrieval operation every few seconds from a scheduled function until the task status reports completion
- B.
Register a webhook through the task's push notification configuration so the remote agent calls back on significant updates
- C.
Open a streaming request over server-sent events and keep it attached until the review task reaches a terminal state
- D.
Send the review as a blocking request so that the remote agent returns only after the whole review has finished
Show answer
Answer: B
Push notifications fit very long tasks with clients that cannot hold a connection open.
- A. Polling would technically work, but the stem bans tight polling loops, and polling adds latency and request cost for long tasks.
- B. Correct: the remote agent calls the client's webhook on task updates, so no connection or polling is needed for an hours-long task.
- C. Streaming needs the client to stay attached for the whole task, which a short-lived serverless function cannot do for hours.
- D. A blocking call holds the request open until the task finishes, which fails for the same reason streaming does.