Skip to content

RunnableParallel

This component allows you to run multiple automation instructions at the same time using the same starting information. Imagine having several assistants work on the same task simultaneously; this component gathers their individual responses and merges them into one clear summary for you. It is ideal when you need to check different data sources or apply multiple logic rules to a single piece of information quickly.

How it Works

When you connect this component, it takes the information you provide (the Input) and sends a copy of it to every automation block you have linked to it. These blocks—such as AI agents or data processing chains—process the information independently and in parallel.

Once all the blocks have finished their work, the component collects their answers. It then formats these answers into a single text message. Each answer is clearly labeled with the name of the block that produced it, making it easy to see which part of the system generated which piece of information. This approach saves time by not waiting for one task to finish before starting the next, but it requires careful formatting to ensure the final combined message is readable.

Connection & Credentials

This component does not require any external API credentials. It works with other components already available in your Nappai workspace.

Inputs

The following fields are available to configure this component:

  • Input: [The main text or message that will be sent to all connected automation blocks for processing. This field is required.]
  • Input Key: [A technical label used to identify the input data within the processing blocks. You typically do not need to change this unless you are troubleshooting specific integration issues.]
  • Output Key: [A technical label used to identify where the final answer is stored within each block’s response. Changing this only matters if your connected blocks return data in an unusual format.]
  • Agent Executor: [The list of automation blocks (such as AI Agents or Chains) that you want to run in parallel. You must connect at least one block here for this component to work.]

Outputs

The component produces a single text output that combines the results from all connected automation blocks.

Output Data Example (JSON)json

{ “text”: “Agent One: The weather is sunny.\nAgent Two: The temperature is 25°C.\nAgent Three: No warnings detected.” } Note: The output is a single text string where each agent’s response is separated by a newline and labeled with the agent’s name.

Connectivity

This component acts as a central hub for parallel processing.

  • Connect to this Component’s Input: Link the output of a Text Input, Document, or any other data source that provides the common context you want all agents to analyze.
  • Connect to this Component’s Agent Executor: Drag the output port of any Agent, Chain, or Runnable component into this field. You can connect multiple agents here to run them side-by-side.
  • From this Component’s Text Output: Connect the resulting text to a Text Output node to display it, or to another agent if you want to process the combined results further.

Usage Example

Imagine you are building a customer support dashboard. You have a new customer inquiry (the Input). Instead of checking your product database and then checking your shipping policy sequentially, you can connect both the “Product Info Agent” and the “Shipping Policy Agent” to the Agent Executor input of RunnableParallel.

When the customer inquiry is submitted, both agents check their respective data sources at the same time. The RunnableParallel component then combines their findings into one message, allowing you to see the product details and shipping options simultaneously in the final Text output.

Important Notes

🔒 Run Trusted Runnables Only [🔴 High] Because the component executes arbitrary automation logic, only use runnables from trusted sources to avoid accidental code execution or data leakage.

⚠️ Input Key Mismatch Warning [🟡 Medium] If the input_key you set does not match the key your runnables expect, the component will still run but will add a warning to the output message. Check the output for any “Warning: The output key is not…” notes and adjust the key accordingly.

⚠️ Supports Only Runnable Subclasses [🟡 Medium] The component can only execute objects that inherit from LangChain’s Runnable, such as Chains, AgentExecutors, or Agents. Other types of objects will cause an error.

📋 orjson Library Needed [🟡 Medium] The component uses orjson for fast JSON parsing. Ensure the orjson package is installed in your environment; otherwise, the component will fail to run.

📋 LangChain Core Runtime [🟡 Medium] Underlying LangChain components (Runnable, RunnableParallel) must be available. Install the langchain-core package to use this component.

💡 Use Consistent Input and Output Keys [🟢 Low] Set the same input_key and output_key across all runnables to simplify result extraction. The component automatically looks for common keys like “answer” or “output” if the specified keys are missing.

💡 Check Result Message for Warnings [🟢 Low] After execution, review the returned text for any warning lines that indicate key mismatches or unexpected result formats. Adjust your runnables or keys based on these hints.

ℹ️ Simple Result Parsing Only [🟡 Medium] Result extraction assumes a flat dictionary or a single-element list containing a string or JSON. Complex nested structures or multiple list items may be truncated or misinterpreted.

ℹ️ List Outputs Truncated to First Element [🟢 Low] When a runnable returns a list, only the first element is considered for the output text. Any additional items in the list will be ignored.

ℹ️ Aggregated Text Output [🟢 Low] The component returns a single string that concatenates each runnable’s name and its extracted output. It does not return structured data, so downstream components that expect JSON will need to parse this string.

Tips and Best Practices

  • Keep inputs simple: Since all connected agents share the same input, ensure the initial message is clear and contains all necessary context for every agent to function correctly.
  • Monitor for warnings: The component is designed to be forgiving, but if you see warnings in the output text, check your Input Key and Output Key settings to ensure they match the expectations of your connected agents.
  • Use descriptive names: When adding agents to the Agent Executor, give them clear names. Since the final output lists responses by agent name, distinct names make the combined result much easier to read.
  • Limit the number of agents: While parallel execution is fast, connecting too many heavy agents may increase processing time or memory usage. Start with 2-3 critical agents and scale up if needed.

Security Considerations

Always verify the source of any automation logic (Agents or Chains) you connect to this component. Since RunnableParallel executes the logic provided by these components, running untrusted code can pose security risks. Ensure that all connected agents are from verified templates or created by trusted administrators within your Nappai system.