Skip to main content
工作流应用

Batch Processing Node

The Batch Processing node iterates over each element in an array and executes processing logic in parallel. It divides the array elements into batches according to a specified parallel count, processes each element concurrently within the batch workflow, and finally aggregates all individual results into a single array output.

Usage Example

Consider a workflow that introduces multiple cities in bulk. This workflow receives an array of city names, passes each name in parallel to a large language model (LLM) via the Batch Processing node, and prompts the LLM to generate a one-sentence description for each city. Finally, all generated descriptions are aggregated into an output array.

Adding the Node

Method 1: Add Using the + Button

  • Hover your mouse over any node on the canvas (e.g., the Start node); a + button automatically appears on its right side.
  • Click the + button and select Logic → Batch Processing from the pop-up node list. The node is automatically added to the canvas and connected to the upstream node.
  • After adding the Batch Processing node, the canvas automatically generates a dedicated Batch Body sub-canvas containing fixed Parallel Start and Parallel End nodes.

Method 2: Drag from the Node Library

  • In the left-side node library, locate and select Logic → Batch Processing.
  • Drag the node onto the canvas at your desired location, then drag a connection line from the edge of an upstream node to the Batch Processing node.
  • Upon addition, the canvas automatically generates the Batch Body sub-canvas with fixed Parallel Start and Parallel End nodes.

Core Configuration

The Batch Processing node accepts one or more arrays as input. It sequentially extracts each element by index, passes it into the Batch Body sub-canvas for processing, and finally collects all iteration results into an array output. Unlike the Loop node—which processes elements serially—the Batch Processing node supports concurrent execution across multiple elements, significantly improving throughput for bulk tasks.

Batch Settings

The Batch Settings section includes two parameters: Maximum Batch Count and Parallel Execution Count.
Parameter NameTypeDefaultDescription
Maximum Batch CountNumber30Prevents excessively long runtime or excessive resource consumption when processing very large arrays. When the array length far exceeds actual needs, this limit ensures only the first N elements are processed; remaining elements are skipped.
Parallel Execution CountNumber5Controls how many tasks run simultaneously. Increasing this value improves processing speed but also raises instantaneous resource demand (e.g., LLM concurrency, API call frequency). Set it appropriately based on downstream node concurrency capacity.

Batch Array

The Batch Array defines the array-type data to be processed in bulk. It supports direct input or referencing outputs from upstream nodes. Multiple arrays can be added. Nodes inside the Batch Body can access the current batched array element using predefined variables:
Variable NameTypeDescription
itemSame as array item typeThe current array element being processed. Displayed as item (in variable name) format.
indexNumberZero-based index of the current array element.

Batch Body

The Batch Body is a dedicated sub-canvas belonging to the Batch Processing node. It contains fixed Parallel Start and Parallel End nodes and is used to orchestrate the core logic of bulk processing. Node connections inside the Batch Body follow the same rules as the main workflow canvas, but with the following restrictions:
  • No nested batching: You cannot add another Batch Processing node or Loop node inside the Batch Body.
  • No cross-boundary dragging: Nodes outside the Batch Body cannot be dragged into it, and nodes inside cannot be moved outside.
  • No Output nodes allowed: You cannot add a Workflow Output node inside the Batch Body.

Common Use Cases

Connection PatternDescription
Script Node → Batch Processing NodeWhen upstream data is in plain text format, use a Script Node first to convert it into an array, then pass it to the Batch Processing node for parallel processing.
Batch Processing Node (inside Batch Body) → LLM NodeCall an LLM node inside the Batch Body to process each element—ideal for bulk content generation, summarization, etc.

Frequently Asked Questions

What’s the difference between the Batch Processing node and the Loop node?

  • Execution mode:
    The Batch Processing node executes tasks in parallel, enabling simultaneous processing of multiple elements. The Loop node executes tasks sequentially, processing one element per iteration.
  • Use cases:
    The Batch Processing node is typically used to process a full dataset in one go—optimized for high-throughput bulk operations. The Loop node is better suited for repeated execution of a specific action or task until a defined condition is met.
  • Processing behavior:
    The Batch Processing node only accepts array inputs; its iteration count defaults to the array length and terminates automatically upon completion. The Loop node supports flexible termination conditions—including fixed iteration counts, array lengths, or custom logical conditions.

How do I view detailed input/output for each batch iteration?

After running the workflow, open the Test Results panel and click on any node inside the Batch Body (e.g., an LLM node). Use the pagination controls to navigate through each batch iteration’s detailed input and output—click the left/right arrows to switch between different batch rounds.