FastGPTFastGPT

Parallel Run

FastGPT Parallel Run node overview and usage (available in 4.14.11+)

Node Overview

The Parallel Run node takes an array as input and runs the same sub-workflow for every element at the same time, then aggregates the results.

Parallel Run node

It fits batch tasks where each item can be completed independently, such as:

  • Translating a batch of text snippets
  • Scraping multiple web pages and extracting information
  • Calling an external API for many records

Core Features

  1. Runs in parallel, finishes faster

    • Multiple items are processed at the same time
    • Configure Max Concurrency to control how many tasks execute simultaneously and balance speed against resource usage
  2. A single failure does not break the batch

    • A failed task does not interrupt the others
    • Failures are retried automatically; the retry count is configurable
    • Successful and failed results are grouped separately for easier downstream handling
  3. Per-task view in the debug panel

    • After the run finishes, each task's execution can be inspected independently
    • No need to dig through a flat list of child-node responses

Parameters

Inputs

ParameterRequiredDefaultDescription
ArrayYes-The items to process, usually from an upstream node's array output. Elements can be strings, numbers, objects, etc.
Max ConcurrencyYes5How many tasks are allowed to run at the same time. Range: 1 to the upper limit (set by the deployment, default 10)
Retry Times on ErrorYes3How many times to retry a failed task. Range: 0–5. 0 disables retries
Run logicYes-The sub-flow to run, wrapped between the fixed Start and End anchors. You can place any nodes in between

Outputs

OutputTypeDescription
Success ResultsArray<any>Outputs of successful tasks only, ordered by input index. Failed items are filtered out. This is what you usually reference downstream.
Full ResultsArray<object>Has the same length as the input. Each item is { success, message, data }: on success success=true and data is the value; on failure success=false, message holds the error and data is null
Completion StatusstringOverall status: success (all succeeded), partial_success (some failed), failed (all failed). Useful for branching

Notes

  • No nesting: a Parallel Run node cannot contain a Parallel Run, Loop Node, or the deprecated Batch Run node
  • No interactive nodes: Form input, User Select, and other interactive nodes cannot run inside the Run logic — the editor blocks dropping them in
  • Variable and output races: global variable changes from successful tasks are written back to the main flow. If a Variable Update node changes an output on a node outside the parallel container, that output is also written back after the task succeeds. When multiple tasks write the same variable or external node output, the final value depends on task completion order and is not guaranteed to be stable. For deterministic results, return values through the End node and use the Parallel Run aggregate outputs
  • Array length cap: the input array is capped at 100 items by default (adjustable by the deployment — see below)
  • Hide AI output for AI nodes inside the Run logic: in the model settings of AI Chat nodes placed inside the parallel body, enable "Hide AI output" so responses are passed through the End anchor and emitted together by a downstream Assigned Reply node.

Deployment Settings

The following environment variables can be tuned on self-hosted deployments:

Environment variableDefaultDescription
WORKFLOW_MAX_LOOP_TIMES100Maximum length of the input array (shared by Loop Node, Parallel Run, and the deprecated Batch Run)
WORKFLOW_PARALLEL_MAX_CONCURRENCY10Upper bound of the Max Concurrency setting. Must not exceed WORKFLOW_MAX_LOOP_TIMES

Example: Translate a Text Array in Parallel

Validate parallel input and output with two strings before adding AI translation. This verified run returns captureItems = ["alpha", "beta"] unchanged to confirm the array and output references.

Parallel input array and successful results

Steps

  1. Add an array variable captureItems in system configuration and enter ["alpha", "beta"].
  2. Reference that array in Parallel Run, set max concurrency to 2, and retries per task to 0.
  3. Connect Start to End inside the execution logic. Reference the current array item as the End output.
  4. Run the workflow and verify that Success Results is ["alpha", "beta"] and both entries in Full Results succeeded.
  5. To add translation, place AI Chat between Start and End. Reference the current item as the user question, use the prompt “Translate the input text into English,” and enable Hide AI output in model settings. Change End to reference the AI reply; use a downstream Assigned Reply to display the aggregated results.

Execution Flow

Successful details for both array items

The two tasks process alpha and beta and aggregate the results in input order. The two success: true entries shown here belong to the unchanged-value validation run. After adding AI or an external service, configure retries as needed and inspect each item's success flag and error message.

Edit on GitHub

Last updated

On this page

Put your business knowledge to work with AI

Import company documents and build accurate, reliable, traceable AI answers.