Resubmit only the items left in failed status for an existing batch operation, re-running them through the same asynchronous pipeline.
Before You Begin
🔗 Use the GraphQL Playground to execute the mutation in this guide.
➡️ New to GraphQL? Learn how to navigate the Playground with our Playground Basics Guide.
Why this use case
A batchUpsert submission runs asynchronously and can finish with some items in failed status: an item whose match value could not identify a single record, or an item in a chunk that exhausted its processing retries. When a batch finishes as completed_with_errors (or failed), the reprocessBatchOperation mutation resubmits only those failed items, re-running them through the same pipeline without touching the items that already succeeded.
Availability
reprocessBatchOperation is a Service Account only operation and is served behind the batch operations feature flag. The field is present in the schema only for organizations where the feature is enabled; if your organization does not have it enabled, the field will not appear and the mutation will fail validation.
Prerequisites
- Authentication: Use a Service Account token (Personal Access Tokens are deprecated). The mutation rejects any non-service-account caller.
- Permissions: Your Service Account must be able to create/update cards in the target pipe or database (the same permission
batchUpsertrequires). - IDs: The batch operation's
id(a UUID) returned bybatchUpsertor listed by thebatchOperationsquery. See List Batch Operations of a Repo to find it.
Step 1: Run the mutation
mutation ReprocessBatchOperation($input: ReprocessBatchOperationInput!) {
reprocessBatchOperation(input: $input) {
batchOperation {
id
status
totalCount
finishedAt
}
}
}
Variables
{
"input": {
"id": "8f3b1c9e-2a4d-4c7b-9f10-1d2e3a4b5c6d"
}
}
id(required): the public identifier (UUID) of the batch operation whose failed items you want to reprocess.
Step 2: Check the response
{
"data": {
"reprocessBatchOperation": {
"batchOperation": {
"id": "8f3b1c9e-2a4d-4c7b-9f10-1d2e3a4b5c6d",
"status": "pending",
"totalCount": 1500,
"finishedAt": null
}
}
}
}
Returned fields
| Field | Description |
|---|---|
batchOperation.id | Public identifier of the batch operation (a UUID) |
batchOperation.status | Lifecycle status after resubmission; returns to pending while the failed items are re-run |
batchOperation.totalCount | Number of items in the batch (unchanged by reprocessing) |
batchOperation.finishedAt | Cleared to null while the batch is being reprocessed; set again when it finishes |
Poll the batch with the batchOperations query to follow the reprocessing to completion, exactly as you would after the original submission.
Key Notes
- Only failed items are re-run. Items already in
succeeded(orskipped) status are never touched and are never processed a second time. - Idempotent where it matters. Reprocessing a batch that finished carrying no failed items is a no-op: the batch is returned unchanged and nothing is resubmitted, so a client that retries the call is safe.
- Reprocessable states. Reprocessing applies to a batch that has finished carrying failed items (
completed_with_errorsorfailed). For any other status the mutation returns anINVALID_INPUTerror naming the current one: a batch that isqueued,pending, orprocessinghas nothing settled to retry, and acompletedbatch has no failed item to re-run. The same error answers a second call made while a first reprocessing is still running, since that batch is back inpending— only one dispatch happens, and the second caller is told so instead of receiving a payload that looks like a resubmission. - Scope. The mutation is scoped to your organization and the batch's repo. A batch UUID that does not belong to your organization returns a
RESOURCE_NOT_FOUNDerror, so the mutation does not reveal whether a given batch exists elsewhere. - Permissions. A caller that is not a Service Account, or a Service Account without permission on the batch's repo, receives a
PERMISSION_DENIEDerror. - Some failures repeat on purpose. Failures caused by a field marked unique are deterministic and will fail again unless you fix the submission and send a new batch: a row that repeats a value another row of the same submission already used for that field (only the first row is applied; the later ones fail), and a row whose value is already held by another record. Reprocessing them changes nothing, since the condition that caused the failure is still there.
- To submit a new batch, use the
batchUpsertmutation; to list batches and their statuses, use thebatchOperationsquery.

