Skip to main content
Jobs report a top-level status and a list of batches. Each batch has a phase so you can track progress incrementally.

Status enums

  • queued: The job was accepted and will start shortly.
  • running: Processing is in progress.
  • completed: All batches are finished and delivery details are available.

Batches and phases

Each job has one or more batches. For each batch:
  • uid: unique identifier
  • phase: one of queued, running, or completed
  • started_at, finished_at: optional timestamps
Track progress by counting how many batches are completed vs total.
  • TypeScript
  • Python
import { DataIngestionClient, DataIngestionConfig, JobStatus } from "@trelent/data-ingestion";

const client = new DataIngestionClient();

async function getProgress(jobId: string) {
  const status = await client.getJobStatus(jobId, { includeMarkdown: false });
  const total = status.batches.length;
  const completedBatches = status.batches.filter(b => b.phase === "completed").length;
  const isDone = status.status === JobStatus.Completed;
  return { 
    isDone,
    completedBatches, 
    total, 
    percent: total ? Math.round((completedBatches / total) * 100) : 0 
  };
}

Reading delivery details

When status is completed, delivery provides either S3 pointers or signed URLs keyed by the original input identifier.