Practical thinking about AI tools and everyday work.

An AI Batch Job Needs a Completion Check Before Its Results Are Used

A person sorting task cards beside a laptop.
AI-generated photographic illustration; not documentary photography.

A batch job can finish with a mixture of successful and unsuccessful requests. If a workflow treats “ended” as “everything is ready,” it can silently omit results or feed errors into the next step.

The Claude Message Batches API documentation provides a concrete example. Its processing status can be in_progress, canceling or ended, while request counts distinguish outcomes such as succeeded, errored, canceled and expired.

Separate the job state from the request outcomes

A terminal job state answers whether processing has stopped. It does not answer whether each requested output exists and is usable. Read the outcome counts, then inspect the individual result records before advancing the workflow.

For an illustrative batch of 30 requests, suppose 27 succeed, two error and one expires. The batch may be finished, but a downstream step expecting 30 successful documents is not ready. The workflow needs an explicit decision about the three unsuccessful requests.

Define a completion rule before submission

Write down what your application requires: all requests successful, a permitted partial result, or a review queue for exceptions. Keep the original job identifier, expected request count and submission time in a durable record.

Poll or receive completion information using the provider’s supported mechanism, with reasonable intervals and documented timeouts. A browser tab closing or a local script ending is not evidence that the remote job finished.

Retry the problem, not the entire success set

After inspecting errors, decide which requests are suitable for retry and preserve the successful results. Some failures need corrected input rather than another identical attempt. Avoid a retry loop that repeatedly creates the same unsuitable job.

Finally, validate the output against its intended use. A successful API response means the request completed under the service’s rules; it does not establish that generated facts, formatting or decisions are correct.

A dependable batch workflow has two gates: processing has ended, and the required outputs have passed the application’s checks. Keeping those gates separate makes failures visible while preserving work that already succeeded.