create batch

This block is part of the anthropic group and was last modified in core v15.0.0.

create batch v15.0.0

Submit many prompts as one asynchronous batch at 50% of the standard price (results within 24h). Wire on_finished/on_item to be called automatically when the batch completes (the system polls in the background), or poll the batch_id yourself with the get batch block.

In pins 3 + flow
  • flow
    flow
  • connection required
    anthropicconnection
  • requests required
    array<object>

    One object per prompt: {prompt (required), system?, model?, max_tokens?, custom_id? (your key to match results)}. custom_id defaults to request-N.

  • poll interval (s)
    number

    Seconds between background poll sweeps when on_finished/on_item are wired. Default 120, minimum 30. • Hidden when unused

Out pins 10 + flow
  • flow
    flow
  • connection
    anthropicconnection
  • success
    condition
  • batch id
    value

    Poll this with the get batch block.

  • status
    value

    in_progress | canceling | ended.

  • counts
    object

    processing, succeeded, errored, canceled, expired.

  • count
    number

    Number of requests submitted.

  • errors
    array<value>

    Error codes when the call fails (success=false): config_error, internal_error, model_not_allowed, transport_error.

  • error detail
    value
  • on finished
    execute_function

    Runs in the background when the batch completes (the system polls for you). Receives the per-result summary; results carries one entry per request.

  • on item
    execute_function

    Runs in the background once per finished request (custom_id, status, text, usage, cost). Optional; use it to process results one by one.

batch
bulk message
async batch
mass prompt
50% off

A typical wiring for create batch: a function trigger starts the flow; with values feeds the requests pin; the function out pin wires to an execute block.

Studio canvas example for the create batch block: typical wiring for create batch.

Version history

Introduced in v15.0.0.


Back to anthropic Return to the main group to view all sub-groups Back to anthropic Return to the group to view all blocks within this group