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
| Property | Type | Required | Example | Description |
|---|---|---|---|---|
| Requests from | choice | Yes | A list | A list (one message per item) or a JSONL file. |
| Items | variable | With a list | {tickets} | The list. |
| Item name | text | No | item | How the message names the current item: {item.text}. |
| Item key | text | No | id | The item field that names its result (letters, digits, -, _; unique). Empty: item-0, item-1… |
| Instructions, Message | prompt | Message with a list | Classify this ticket as bug, billing or other: {item.text} | |
| Model, Effort, Max tokens, JSON schema | No | As in Send message; Max tokens up to 128000 here. | ||
| Requests file | file field | With a file | ref-environment:requests.jsonl | One request per line: {"custom_id": "a1", "params": {"model": ..., "max_tokens": ..., "messages": [...]}}. |
| Store the batch in | variable | Yes | {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 withcustomId,type(succeeded,errored,canceled,expired),text,json(when the answer is JSON),stopReason,error. Results come in any order: match them bycustomId.
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.