Skip to main content

Batch Processing

Claude can orchestrate complex workflows by chaining multiple tools in a single request. Batch processing allows you to approve or reject groups of tools efficiently while X21 manages dependencies and execution order.

How Batch Requests Work

  • During a single prompt, Claude may propose several tools (e.g., read_values, write_values, write_format).
  • The Deno backend queues them as a batch under the current requestId. Each tool remains pending until a decision is made.
  • The UI groups these requests, allowing you to inspect their arguments side by side before approving.

Approving Batches

  • Use Approve All to send a combined tool:permission:response with multiple toolResponses. The backend processes them sequentially:
    1. Executes each tool.
    2. Records revert data.
    3. Updates conversation history.
  • If any tool throws ToolExecutionError, it is flagged as failed and the batch continues. Claude receives an error summary so it can retry or adjust.

Auto-Approve Strategies

  • Enable Auto-approve for low-risk tools (reads, metadata calls) while manually reviewing writes or structural changes.
  • Configure toolsNotRequiringApproval in the UI to extend the safe list–for example, allow read_format and read_values to run automatically.
  • The backend respects individual tool decisions even within a batch, so you can auto-approve the easy parts and manually handle the rest.

Performance Considerations

  • Batching reduces round trips between Claude and Excel, especially for operations that share context (e.g., read -> transform -> write sequences).
  • Langfuse spans capture execution time for each tool, making it easy to identify slow steps in large batches.
  • When dealing with thousands of cells, prefer writing larger ranges in a single write_values call rather than many small ones.

Common Batch Scenarios

  • Data cleaning pipelines – Read source table, remove empty rows, write cleaned data, update formats, all in one approval cycle.
  • Reporting refreshes – Pull values, recompute formulas, refresh charts, and summarise results in a narrative reply.
  • What-if planning – Apply a set of adjustments (e.g., increase totals by percentage) and provide a revert button if the scenario should be discarded.
Batch processing keeps the workflow fluid while still giving you checkpoints to ensure each step matches your intent.