# How do I reconcile and retry Claude Message Batches safely?

Exam: CCAR-F — Claude Certified Architect - Foundations (CCAR-F)
Knowledge domain: Prompt Engineering & Structured Output
Updated: 2026-11-25T09:22:59.273276+00:00
HTML: https://learningpathx.com/faq/CCAR-F/ccarf-reconcile-claude-message-batches.html

## Also asked as

- How do I match Claude batch results to requests when the output is out of order?
- What should I do with succeeded, errored, canceled, and expired Claude batch records?

Give each Messages request a stable `custom_id` unique within its batch. Record the mapping to the input and source version, submit the validated records, and poll the batch ID until `processing_status` is `ended`. Retrieve the JSONL results and join each record on `custom_id`, because output order can differ from input order.

Review every result type before writing downstream.

* `succeeded` supplies a Messages response. Check its stop reason, shape, and meaning before committing the result.
* `errored` requires checking the error. Fix an invalid request before resubmitting it, and use a bounded retry for eligible transient failures.
* `canceled` and `expired` require an explicit requeue decision. A canceled batch can still contain records that completed before cancellation.

Check for missing or unexpected IDs and store each record’s final disposition. Preserve the application’s separate idempotency key and check the target’s outcome before retrying a write. Message Batches suit independent high-volume work with flexible latency. Use a synchronous workflow when a consumer needs an immediate response. Current limits and eligibility depend on the Claude API configuration.

[Claude API Message Batches](https://platform.claude.com/docs/en/build-with-claude/batch-processing) · [Claude API stop reasons](https://platform.claude.com/docs/en/build-with-claude/handling-stop-reasons)

Source: [Structured Outputs, Validation, Retry, and Batch Patterns](https://learningpathx.com/news/structured-outputs-validation-retry-and-batch-patterns.html)
