For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
BlogLog InRequest Demo
HomeProductDevelopersSelf-HostingChangelog
HomeProductDevelopersSelf-HostingChangelog
  • Getting Started
    • Overview
  • Workflows SDK
    • Introduction
    • Installation
    • Core Concepts
    • Defining Control Flow
    • Configuration
    • Custom Docker Images
      • Displayable Nodes
        • Agent Node
        • Inline Prompt Node
        • Inline Subworkflow Node
        • Prompt Deployment Node
        • Search Node
        • Subworkflow Deployment Node
        • API Node
        • Code Execution Node
        • Templating Node
        • Guardrail Node
        • Map Node
        • Conditional Node
        • Merge Node
        • Error Node
        • Final Output Node
      • Datasets
      • CLI
  • Client SDK
    • Introduction
    • Authentication
    • API Versioning
LogoLogo
BlogLog InRequest Demo
Workflows SDKAPI ReferenceDisplayable Nodes

Merge Node

Basic Example
1from vellum.workflows.nodes import BaseNode
2
3class QuickNode(BaseNode):
4 class Outputs(BaseNode.Outputs):
5 prefix = "Hello"
6
7class SlowNode(BaseNode):
8 class Outputs(BaseNode.Outputs):
9 suffix: str
10 def run(self) -> Outputs:
11 time.sleep(5)
12 return self.Outputs(suffix="World")
13
14class MergeNode(BaseNode):
15 prefix = QuickNode.Outputs.prefix
16 suffix = SlowNode.Outputs.suffix
17 class Outputs(BaseNode.Outputs):
18 message: str
19 class Trigger(BaseNode.Trigger):
20 merge_strategy = MergeStrategy.AWAIT_ALL
21 def run(self) -> Outputs:
22 return self.Outputs(message=f"{self.prefix} {self.suffix}")
Was this page helpful?
Previous

Error Node

Next
Built with

vellum.workflows.nodes.MergeNode

Used to merge the control flow of multiple nodes into a single node. This node exists primarily for backwards compatibility with Vellum’s Merge Node functionality.

For most cases, you should extend from BaseNode.Trigger directly instead of using MergeNode. Read more on Triggers

Attributes

This node doesn’t have any specific attributes as it’s a simple control flow node.

Outputs

This node passes through any outputs from its parent nodes without modification.