List Batch Operations of a Repo

Fetch the batch operations submitted for a pipe or database, most recent first, with an optional status filter and cursor-based pagination.

Before You Begin

🔗 Use the GraphQL Playground to execute the queries in this guide.

➡️ New to GraphQL? Learn how to navigate the Playground with our Playground Basics Guide.

Why this use case

The batchOperations query lists the batch operations submitted against a single repo (a pipe or a database) through batchUpsert. Because batchUpsert runs asynchronously, use batchOperations to poll the progress of your submissions and to retrieve each batch's current status, item count, and result file.

Availability

batchOperations 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 query will fail validation.


Prerequisites

  1. Authentication: Use a Service Account token (Personal Access Tokens are deprecated). The query rejects any non-service-account caller.
  2. Permissions: Your Service Account must be able to create/update cards in the target pipe or database (the same permission batchUpsert requires).
  3. IDs: See our Get resource IDs page for how to find the repoId (pipe or database ID).

Step 1: Run the query

query ListBatchOperations($repoId: ID!, $status: BatchOperationStatus, $first: Int, $after: String) {
  batchOperations(repoId: $repoId, status: $status, first: $first, after: $after) {
    edges {
      node {
        id
        operationType
        status
        totalCount
        resultFile
        createdAt
        finishedAt
        suppressAutomations
        suppressWebhooks
        requestedBy {
          id
          name
        }
      }
    }
    pageInfo {
      endCursor
      hasNextPage
    }
  }
}

Variables

{
  "repoId": "301234567",
  "status": "processing",
  "first": 20
}
  • repoId (required): the pipe or database whose batch operations are listed.
  • status (optional): restrict the result to a single lifecycle status. Omit it to list every batch of the repo.
  • first / after (optional): standard Relay cursor pagination. Pass the previous page's pageInfo.endCursor as after to fetch the next page.

Step 2: Check the response

{
  "data": {
    "batchOperations": {
      "edges": [
        {
          "node": {
            "id": "8f3b1c9e-2a4d-4c7b-9f10-1d2e3a4b5c6d",
            "operationType": "upsert_records",
            "status": "processing",
            "totalCount": 1500,
            "resultFile": null,
            "createdAt": "2026-07-23T12:00:00Z",
            "finishedAt": null,
            "suppressAutomations": false,
            "suppressWebhooks": false,
            "requestedBy": {
              "id": "1234567",
              "name": "Integration Bot"
            }
          }
        }
      ],
      "pageInfo": {
        "endCursor": "MQ",
        "hasNextPage": false
      }
    }
  }
}

Returned fields

FieldDescription
edges[].node.idPublic identifier of the batch operation (a UUID)
edges[].node.operationTypeThe kind of batch operation (upsert_records)
edges[].node.statusCurrent lifecycle status (see the table below)
edges[].node.totalCountNumber of items in the batch
edges[].node.resultFileResult file produced by the batch; null until the batch produces one
edges[].node.createdAtWhen the batch was submitted
edges[].node.finishedAtWhen the batch finished; null while it is not finished
edges[].node.suppressAutomationsWhether automations were suppressed for this batch
edges[].node.suppressWebhooksWhether webhooks were suppressed for this batch
edges[].node.requestedByThe user who submitted the batch; null if that user no longer exists
pageInfo.endCursorCursor of the last returned batch — pass it as after to fetch the next page
pageInfo.hasNextPageWhether more batches exist beyond this page

Status values

status (both the argument and the returned field) uses the BatchOperationStatus enum:

ValueMeaning
queuedSubmitted, not yet loaded
pendingItems loaded, ready for processing
processingProcessing in progress
completedFinished with no item errors
completed_with_errorsFinished with some item errors
failedFailed

Key Notes

  • Results are ordered by createdAt descending (most recently submitted first).
  • The query is scoped to the given repoId and never returns batches from another repo or organization.
  • A caller that is not a Service Account, or a Service Account without permission on the target repo, receives a PERMISSION_DENIED error. A repo that does not exist returns the same PERMISSION_DENIED message, so the query does not reveal whether a given repo exists.
  • To submit a batch and obtain the IDs listed here, use the batchUpsert mutation.
  • A known batch id can be read with batchOperation instead of paging this list.