2 Check Validation Status
โถStep 2: Check Validation Status
Poll the task status until validation completes and the task reaches "staged" status. Once staged, the shed geometries have been validated and are ready for metrics processing via a PUT request.
โถWhat this step does
It reads the ingestion task by id (GET /ingestions/{{shed_task_id}}) and
checks data.attributes.overall_status. The upload from Step 1 runs
asynchronously, so a read taken too early returns a non-terminal status
(e.g. pending); this step re-sends itself until the status is terminal โ
staged, completed, or failed. The after-response script spaces the
polls (3s apart, up to 30 attempts) and stops once a terminal state is
reached.
โถWhy it's needed
Validation is not instant, so you cannot proceed straight from upload to
processing โ the staged entities Step 3 reviews and the PUT in Step 4
reuses do not exist until this task reaches staged. Polling is the gate
that confirms the geometries passed validation; a failed status here
means the upload was rejected (e.g. non-polygon geometry) and there is
nothing to process.
โถWhy poll rather than assume completion
A single read right after upload will almost always show a non-terminal
status, and acting on it would address sheds that are not yet staged. The
self-re-sending poll loop lets a linear pipeline block until the task is
genuinely ready, treating only staged / completed / failed as
terminal.