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 document method returns a Job whether the work finishes inline or keeps running. 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 throws JobFailedError for failed or cancelled jobs and JobTimeoutError when its local wait budget expires. Both errors 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 throws 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 iterAll 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.

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, artifact reads throw ResultExpiredError.
The TypeScript SDK does not currently wrap GET /v1/jobs/{id}/request, DELETE /v1/jobs/{id}, or PATCH /v1/jobs/{id}. Call those REST endpoints directly when you need request inspection, soft deletion, or updates.

Methods

For usage, pass period_start and period_end as YYYY-MM-DD or a Date at UTC midnight; any other Date is sent with a time and refused.

Next steps

Parse previews

parseProgress(job_id: string): Promise<ParsePreviewSnapshot> reads current metadata. parseProgressEvents(job_id: string): AsyncGenerator<ParsePreviewSnapshot> reads one event connection. parseProgressPart(job_id: string, generation: string, revision: string): Promise<ParsePreviewContent> reads one unit. 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.