Polling for Status
After submitting a job, poll GET /ordo/jobs/:id until the job reaches a terminal state.
Job status machine
pending → running → success
→ failed
→ partialpending— job created, no steps have startedrunning— at least one step is running or completesuccess— all steps completed successfullyfailed— at least one step failed and the job is considered failedpartial— some steps succeeded, some failed (partial completion)
Step status machine
pending → running → success
→ failed
→ skippedskipped means the step could not run because a dependency failed.
Polling example (JavaScript)
js
async function pollJob(id, token, onUpdate) {
const res = await fetch(`/ordo/jobs/${id}`, {
headers: { Authorization: `Bearer ${token}` },
});
const data = await res.json();
// Progress based on completed steps
const done = data.steps.filter(s =>
['success', 'failed', 'skipped'].includes(s.status)
).length;
const pct = data.steps.length > 0 ? done / data.steps.length : 0;
onUpdate({
status: data.job.status, // 'pending' | 'running' | 'success' | 'failed'
progress: pct, // 0.0 – 1.0
steps: data.steps,
});
const terminal = ['success', 'failed', 'partial'];
if (!terminal.includes(data.job.status)) {
setTimeout(() => pollJob(id, token, onUpdate), 3000);
}
}Response structure summary
json
{
"job": {
"id": 3,
"status": "success",
"created_at": "...",
"started_at": "...",
"finished_at": "...",
"error": null
},
"progress": {
"percentage": 1,
"completed_steps": 2,
"total_steps": 2
},
"duration_ms": 135401,
"steps": [
{
"step_id": "reproject",
"step_type": "REPROJECT_LAS",
"status": "success",
"started_at": "...",
"finished_at": "...",
"error": null
}
],
"outputs": [
{
"artifact_name": "step:build_ept.output_ept",
"path": "development/results/piney-dam/ept"
}
]
}Recommended polling interval
Poll every 3–5 seconds. Most steps take tens of seconds to minutes depending on dataset size. Very large EPT builds may take longer.
Error handling
If job.status is failed, check job.error for a top-level message and inspect individual steps for error fields on failed steps.