Skip to main content

Claude Batch

Send many Claude messages at once, at half the price. Anthropic answers them within 24 hours, usually much sooner: use it for work nobody waits on, such as classifying last month's tickets or summarising a document archive.

A batch is three steps: Submit batch sends the requests, Wait for batch waits until they are answered, then the results are a list and a file.

Configuration​

Configured separately, per Environment, with its own Anthropic API key: the same fields as Claude, including the default model.

Tasks​

All Tasks in this Module are Generic (all Channels).

ClaudeBatchSubmitTask​

PropertyTypeRequiredExampleDescription
Requests fromchoiceYesA listA list (one message per item) or a JSONL file.
ItemsvariableWith a list{tickets}The list.
Item nametextNoitemHow the message names the current item: {item.text}.
Item keytextNoidThe item field that names its result (letters, digits, -, _; unique). Empty: item-0, item-1…
Instructions, MessagepromptMessage with a listClassify this ticket as bug, billing or other: {item.text}
Model, Effort, Max tokens, JSON schemaNoAs in Send message; Max tokens up to 128000 here.
Requests filefile fieldWith a fileref-environment:requests.jsonlOne request per line: {"custom_id": "a1", "params": {"model": ..., "max_tokens": ..., "messages": [...]}}.
Store the batch invariableYes{batch}id, status, processing, succeeded, errored, canceled, expired.

Up to 100,000 requests and 256 MB per batch.

ClaudeWaitForBatchTask​

Waits until the batch has ended, checking it every Check every seconds (default 60), and fails after Give up after hours (default 25; the batch keeps running at Anthropic). The step holds nothing while it waits. When the batch ends:

  • {batchResults.file}: every result as a JSONL file, saved where Save as says.
  • {batchResults.results}: for batches of up to 500 requests, one entry per request with customId, type (succeeded, errored, canceled, expired), text, json (when the answer is JSON), stopReason, error. Results come in any order: match them by customId.

ClaudeGetBatchTask​

Reads a batch's state now, without waiting.

ClaudeBatchResultsTask​

Reads the results of an ended batch, as Wait for batch does.

ClaudeCancelBatchTask​

Cancels a batch: requests not started are dropped and not billed; results already made stay readable.