2 Poll Source Status
โถStep 2: Poll Source Status
Re-read the discovery task until it reaches a terminal state. While the grounded
sweep is still running the task sits in pending or processing; when it
finishes it flips to completed (results ready) or failed (with an error
message).
โถWhat this step does
It reports how far the background discovery has progressed. The handler folds
the upstream task and its sub-tasks into one normalised status, so you poll a
single field: pending โ processing โ completed | failed. On failure,
attributes.error carries the reason.
โถWhy it's needed
The results endpoint has nothing to return until the sweep has finished โ
fetching it mid-flight returns a 409 (still running). This step is the gate
that confirms the candidates have actually been discovered before Step 3 reads
them. A typical run takes anywhere from tens of seconds to a few minutes
depending on scope, so poll every few seconds until the status is terminal.
โถWhen you can skip it
You always need at least one read here, because discovery is asynchronous by
design. In a scripted client, loop this call on an interval until
attributes.status is completed (then go to Step 3) or failed (then inspect
attributes.error).
โถVisualization
Renders a status panel colour-coded by lifecycle state โ amber while
processing, green on completed, red on failed (with the error) โ so the
poll loop is readable without inspecting the JSON.
โถNext Step
โ Step 3: Get Discovery Results (GET /discovery/source/:id/results)