Skip to main content
Slow NDI operations return a Job. You can wait for completion, read the latest state, stream progress, cancel active work, or list past jobs through client.jobs.

Submit and wait

jobs.wait polls until the job is terminal. Its default timeout is 300 seconds. A timeout stops waiting but does not cancel the server-side job.

Choose inline wait or polling

Job-creating methods accept wait_seconds. This asks the server to hold the submission response open for up to 300 seconds:
The method returns a Job either way. Read its status; if it is still queued or running, continue with client.jobs.wait.
wait_seconds is a server-side hold-open window. The timeout passed to jobs.wait is the SDK’s total polling budget. Neither timeout cancels the job.

Retrieve job status

Use jobs.get when you control polling or need the latest state once.
Treat status values as open-ended. Use job.is_terminal or the exported JobStatus members instead of assuming this table can never grow.

Handle failures and timeouts

By default, jobs.wait raises JobFailedError for failed or cancelled jobs and JobTimeoutError when its local wait budget expires. Both exceptions carry the last job state.
Set raise_on_failure=False when you prefer to inspect a failed or cancelled job as a normal return value.

Cancel a job

Only queued or running jobs can be cancelled. Cancelling a terminal job raises ConflictError with code job_not_cancellable.

List and paginate jobs

jobs.list returns one cursor page, newest first. Filter by workspace, kind, status, or creation time.
Use iter_all to traverse every page without managing cursors.

Stream progress

jobs.events yields Server-Sent Events until the job becomes terminal or the server closes the stream.
Events are a latency convenience, not a completion guarantee. Always confirm the final state with jobs.get or jobs.wait. Pass last_event_id= when reconnecting to continue the event sequence.

Inspect or delete a job

For document operations, jobs.request returns the request settings used by a stored job:
jobs.delete(job_id) removes a job from listings and deletes its content: the request input, the result and the job’s artifact files. Billing records remain, and reading the job directly still returns its deleted_at value. From the moment of the delete the job reads with result: null and result_state expired (not_retained under Zero retention), and jobs.request raises result_expired. Removal from storage runs in the background and completes within minutes. Deleting a queued or running job cancels it first. If another retained job reused this job’s Parse result, only the artifact files that job still uses stay, until its own content is deleted. Files in a bring-your-own bucket are never touched.

Result retention

Customer-storage jobs can keep their status and billing while withholding results and request content. Check job.result_error for the current storage refusal. job.result_state reads storage_unavailable for an otherwise available result; expired and cancelled results keep their final state. Restore the validated connection to read a retained result again. See Jobs and artifacts. The job row can outlive its result payload. Check job.result_state before using an older result. Ordinary payloads remain until explicit deletion. When deletion or Zero retention cleanup removes the payload, request reads raise ResultExpiredError. Artifact reads raise NotFoundError once the job is deleted, and ResultExpiredError once a Zero retention job’s delivery window closes.

Methods

Next steps

Parse previews

parse_progress(job_id) returns ParsePreviewSnapshot. parse_progress_events(job_id) returns Iterator[ParsePreviewSnapshot], or AsyncIterator[ParsePreviewSnapshot] on the async client. parse_progress_part(job_id, generation, revision) returns ParsePreviewContent; generation and revision are required strings from the snapshot. Each stream connection lasts up to 55 seconds. Reconnect to receive current state, replacing units by generation/index/revision. Handle preview errors by continuing job polling; use jobs.wait for the final result. jobs.events above streams status, not page content. See Parse streaming. ParsePreviewSnapshot has job_id, status, nullable generation, nullable kind (page/sheet/section/segment), nullable total, units, more, optional nullable first_ready_at and all_ready_at. Each unit has index, revision, content_url. ParsePreviewContent has generation, index, label, markdown, truncated, ready_at. Python timestamps are datetime; TypeScript timestamps are ISO strings. All-pages-ready is followed by document finalization; terminal snapshots contain no units.