Batches

Create a batch (Phase 1)

Changed on

Phase 1 of 2-phase batch API. Creates a batch record and optionally blocks the parent run for batchTriggerAndWait. After creating a batch, stream items via POST /api/v3/batches/{batchId}/items.

post/api/v3/batches

Request

  • Base URL: https://api.trigger.dev
  • URL: https://api.trigger.dev/api/v3/batches
  • Auth: HTTP bearer

Request body

runCountinteger required

Expected number of items in the batch. Must be a positive integer, up to the server's maximum batch size (1,000 by default; self-hosted instances can configure it). Requests above the maximum return a 400.

taskIdentifiersstring[]

Distinct task identifiers of the items in the batch. Used to authorize tokens scoped to specific tasks. If omitted, only credentials with broad task access are accepted.

parentRunIdstring

Parent run ID (friendly ID) for batchTriggerAndWait.

resumeParentOnCompletionboolean

Whether to resume parent on completion. Set to true for batchTriggerAndWait.

idempotencyKeystring

Idempotency key for the batch. If provided and a batch with this key already exists, the existing batch will be returned.

Response

Batch successfully created

idstring required

The batch ID (friendly ID). Use this to stream items via POST /api/v3/batches/{batchId}/items.

runCountinteger required

The expected run count.

isCachedboolean required

Whether this response came from a cached/idempotent batch.

idempotencyKeystring

The idempotency key if provided.

Changes

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      added the new optional request property

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      endpoint added