Reference · Tools

Claude Batch

Process multiple Claude messages as a batch job.

Action AI v1

Claude Batch sends multiple independent Claude message requests to Anthropic's Message Batches API in a single submission, processing them asynchronously at half the cost of standard API calls. It supports creating a batch, polling its status, and cancelling an in-flight job — making it practical to build things like nightly content classification pipelines or bulk document summarization workflows without paying full per-request pricing.

Node type
Action
Parameters
7
Outputs
Output, Error
Credentials
Anthropic

Claude Batch

Process multiple Claude messages as a batch job.

Overview

Claude Batch uses the Anthropic Message Batches API to process multiple Claude message requests asynchronously. Supports three operations: create (collect input items into a batch of message requests), check (poll batch status), and cancel (cancel a processing batch). For the create operation, all input items are submitted as a single batch. Optionally polls for completion with configurable intervals and timeouts. Batch processing offers a 50% cost discount over standard API calls.

Category: AI
Tool Name: claude_batch
Version: 1

Appearance: Icon: anthropic | Color: #d4a574

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires Anthropic credentials. See the Credentials Guide for setup instructions.

Operations

OperationValueDescription
Create BatchcreateCollect upstream items into a single batch. Each input item becomes one batch request
Check StatuscheckCheck the status of an existing batch
Cancel BatchcancelCancel a processing batch

Parameters

Create Batch (create)

ParameterTypeRequiredDefaultDescription
Model (default)stringNoClaude SonnetDefault Claude model applied to EVERY batch request. Each upstream item can override this by including an item.model field. Always uses the latest version (auto-updated) — the field is prefilled with the current Claude Sonnet model ID.
System Prompt (default)stringNoDefault system instructions applied to EVERY batch request. Each upstream item can override this by including an item.systemPrompt field. Supports expressions.

Check Status (check)

ParameterTypeRequiredDefaultDescription
Batch IDstringNoThe batch ID to check or cancel. Falls back to item.json.batchId if empty. Supports expressions.

Cancel Batch (cancel)

ParameterTypeRequiredDefaultDescription
Batch IDstringNoThe batch ID to check or cancel. Falls back to item.json.batchId if empty. Supports expressions.

All Operations

ParameterTypeRequiredDefaultDescription
OptionscollectionNo{}Generation, polling and output settings.
— Max TokensnumberNo4096Maximum number of tokens per response in the batch.
— Poll Interval (ms)numberNo30000How often to poll for completion status in milliseconds.
— Max Poll Duration (ms)numberNo600000Maximum total time to spend polling for completion in milliseconds.
— Wait for CompletionbooleanNofalseIf true, poll until the batch completes (or fails/expires) before returning.
— Response Field NamestringNobatchField name in the output JSON where the batch result will be placed.
Include InputbooleanNofalseWhether to include the original input item fields in the output.
Max ConcurrencynumberNo5Maximum number of items to process concurrently (for check/cancel operations).

Per-item fields for Create Batch

Create Batch is the one operation that reads the incoming items rather than a parameter: every item becomes one request in the batch. The node-level Model (default) and System Prompt (default) apply to any item that does not specify its own, so a single batch can mix simple and elaborate requests.

Item fieldTypeWhat it does
message (also prompt, text)stringSingle-turn user message for this request
messagesarrayFull multi-turn override — replaces the entire message array for this request. Used instead of message when both are present
systemPromptstringPer-item system prompt, overriding the node default for this request only
modelstringPer-item model, overriding the node default for this request only
attachmentFileIdstringAnthropic file_id (from Claude File Upload or Claude Code Execution) to attach to the user message
attachmentTypestringHow Claude should interpret the attached file — document (the default) or image. Ignored when attachmentFileId is empty
maxTokensnumberPer-item token cap, overriding Max Tokens for this request only
temperaturenumberPer-item sampling temperature for this request only

Build these fields upstream with an Edit Fields, Code or merge node. Anything you leave unset falls back to the node-level default, so there is no need to set every field on every item.

Output Data

Create Batch submits one batch for the whole node run and then emits one output item per input item, each carrying the same batch metadata. Check Status and Cancel Batch process items individually. Binary data on the input item is forwarded unchanged, and with Include Input on the original item fields are merged in alongside the result.

{
  "batch": { "id": "msgbatch_01...", "processing_status": "in_progress" },
  "batchId": "msgbatch_01...",
  "status": "in_progress",
  "requestCount": 500,
  "resultsUrl": "https://api.anthropic.com/v1/messages/batches/msgbatch_01.../results",
  "requestCounts": { "processing": 480, "succeeded": 20, "errored": 0, "canceled": 0, "expired": 0 }
}
  • The field named by Response Field Name (batch by default) holds the batch object exactly as Anthropic returned it.
  • batchId and status are lifted to the top level for convenience. batchId is what a downstream Check Status or Cancel Batch node reads automatically when its own Batch ID is left empty.
  • requestCount is returned by Create Batch only, and is the number of requests that went into the batch.
  • resultsUrl and requestCounts appear once Anthropic has published them — typically after the batch has ended. requestCounts is where you see how many individual requests succeeded or errored; a batch can end successfully with errored requests inside it.
  • With Wait for Completion on, the node polls until the batch reports ended (or the Max Poll Duration elapses), so the values above are the final ones. With it off, the node returns as soon as the batch is accepted.
  • If no input item carried a usable message, Create Batch submits nothing and emits items with a null batch, batchId: null and status: "empty".

Reference the result downstream by expression, e.g. {{ $json.batchId }}.

Usage Examples

  • Submit 500 prompts as a single Claude batch for 50% cost savings
  • Check the status of a running Claude batch job
  • Cancel a processing Claude batch
  • Create a batch of Claude messages with a system prompt
  • Submit batch with polling to wait for completion

Example Configuration

Create a batch and continue immediately:

{
  "type": "claude_batch",
  "parameters": {
    "operation": "create",
    "systemPrompt": "You are a concise summarization assistant. Return only the summary.",
    "options": {
      "maxTokens": 1024,
      "waitForCompletion": false,
      "responseFieldName": "batch"
    }
  }
}

Create a batch and block until every request has been processed:

{
  "type": "claude_batch",
  "parameters": {
    "operation": "create",
    "systemPrompt": "Classify the sentiment of the provided text as positive, negative, or neutral.",
    "includeInput": true,
    "options": {
      "maxTokens": 256,
      "waitForCompletion": true,
      "pollIntervalMs": 20000,
      "maxPollDurationMs": 900000,
      "responseFieldName": "sentimentResult"
    }
  }
}

Check a batch created earlier, taking the ID from the incoming item:

{
  "type": "claude_batch",
  "parameters": {
    "operation": "check",
    "batchId": "",
    "options": {
      "waitForCompletion": true,
      "pollIntervalMs": 30000,
      "maxPollDurationMs": 600000,
      "responseFieldName": "batch"
    }
  }
}

Cancel a batch by ID:

{
  "type": "claude_batch",
  "parameters": {
    "operation": "cancel",
    "batchId": "{{ $json.batchId }}",
    "options": {
      "responseFieldName": "cancelResult"
    }
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Claude Batch submits multiple Claude message requests to the Anthropic Message Batches API asynchronously, supporting create, check, and cancel operations at a 50% cost discount over standard API calls. Use it when processing large volumes of independent prompts where real-time responses are unnecessary and minimizing inference cost is a priority. It outputs per-request response data to the main channel upon batch completion, or routes submission and processing failures to the error channel.

Frequently asked questions

When should I use Claude Batch instead of the regular Claude node?

Use Claude Batch when you have a large set of independent prompts and don't need responses in real time. The 50% cost discount only applies through the Message Batches API, so if your workflow can tolerate asynchronous processing — bulk classification, offline summarization, dataset annotation — Claude Batch is the cost-efficient choice. If you need an immediate response inline in your workflow, use the standard Claude node instead.

What credentials does this node require?

Claude Batch uses Anthropic credentials (the `anthropic` credential type in BusyBot). You'll need an Anthropic API key with access to the Message Batches API configured before the node will authenticate successfully.

What do the Output and Error channels actually carry?

When a batch completes, the Output channel receives per-request response data — one result for each input item submitted. The Error channel handles two distinct failure cases: problems during batch submission (create failures) and processing-level failures that occur while the batch is running. Routing errors to the Error channel lets you handle submission issues and runtime failures separately in your workflow.

What are the three operations and when do I use each one?

The create operation collects your input items and submits them to Anthropic as a single batch job. The check operation polls the batch for its current status, useful if you want to build your own polling loop rather than relying on the node's built-in polling. The cancel operation terminates a batch that is still processing — for example, if you submitted the wrong prompts or need to stop a long-running job early.

Does the node wait for the batch to finish, or do I have to poll manually?

The create operation can optionally poll for completion on your behalf, with configurable intervals and timeouts. If you enable that, the node blocks until the batch finishes and then emits results to the Output channel. If you prefer to handle timing yourself — for instance, to fan out or do other work in parallel — you can use the check operation in a separate workflow step to poll the batch status on your own schedule.

Build with the Claude Batch node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Anthropic credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.