RuleGo RuleGo
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • StreamSQL
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • StreamSQL
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文

广告采用随机轮播方式显示 ❤️成为赞助商
  • Quick Start

  • Rule Chain

  • Standard Components

    • Standard Components Overview
    • common

      • Node Reference
      • groupAction
      • iterator
      • for
      • fork
      • join
        • Configuration
        • Relation Type
        • Execution Result
        • Configuration Example
      • Switch
      • Inclusive
      • Break
      • End Node
    • filter

    • action

    • transform

    • external

    • flow

  • Extension Components

  • Custom Components

  • Components marketplace

  • Visualization

  • AOP

  • Trigger

  • Advanced Topic

  • RuleGo-Server

  • FAQ

  • Endpoint Module

  • Support

  • StreamSQL

目录

join

join component: Join node. Gather and merge the results of multiple asynchronous node executions. Example: Retrieve data from different databases or call APIs, then merge.

# Configuration

Field Type Required Description Default
timeout int No Execution timeout in seconds, 0: no timeout 0
mergeToMap bool No Whether to merge the results into a map. false: result is []WrapperMsg list; true: result merged into Map (JSON merges fields, others use nodeId as key) false

# Relation Type

  • Success: Send the message to the Success chain.
  • Failure: If execution times out or node execution fails, send to the Failure chain.

# Execution Result

  • metadata: Merge the metadata after each node is processed, and override if the same key exists.
  • data: Determine merge strategy based on mergeToMap configuration:
    • mergeToMap=false (default): Encapsulate messages processed by all nodes into a WrapperMsg array.
    • mergeToMap=true: Merge data from all nodes into a single Map.
      • If the node output is in JSON format, merge its fields into the result Map.
      • If the node output is not in JSON format, merge it into the result Map using the node ID as the key and the message content as the value.

Example of merged result when mergeToMap=true:

Assuming there are three nodes:

  • Node A (id=nodeA) output: {"temperature": 25}
  • Node B (id=nodeB) output: {"humidity": 60}
  • Node C (id=nodeC) output: running (Non-JSON)

Merged data result:

{
  "temperature": 25,
  "humidity": 60,
  "nodeC": "running"
}
1
2
3
4
5

WrapperMsg Structure (Valid only when mergeToMap=false):

Field Type Description Default
msg types.RuleMsg without merging metadata Message conforms None
err string ""
nodeId string The last processing node ""

# Configuration Example

{
  "ruleChain": {
    "id": "frcYgBtVbDaV",
    "name": "Test Merge Node",
    "debugMode": true,
    "root": true,
    "additionalInfo": {
      "createTime": "2024/09/24 16:56:52",
      "description": "",
      "layoutX": "280",
      "layoutY": "280",
      "updateTime": "2024/09/24 21:50:38",
      "username": "admin"
    }
  },
  "metadata": {
    "endpoints": [],
    "nodes": [
      {
        "id": "node_a",
        "additionalInfo": {
          "description": "",
          "layoutX": 490,
          "layoutY": 280
        },
        "type": "jsTransform",
        "name": "A",
        "debugMode": false,
        "configuration": {
          "jsScript": "msg.a=\"aa\"\nreturn {'msg':msg,'metadata':metadata,'msgType':msgType};"
        }
      },
      {
        "id": "node_b",
        "additionalInfo": {
          "description": "",
          "layoutX": 730,
          "layoutY": 210
        },
        "type": "jsTransform",
        "name": "B",
        "debugMode": false,
        "configuration": {
          "jsScript": "msg.b=\"bb\"\nreturn {'msg':msg,'metadata':metadata,'msgType':msgType};"
        }
      },
      {
        "id": "node_c",
        "additionalInfo": {
          "description": "",
          "layoutX": 730,
          "layoutY": 340
        },
        "type": "jsTransform",
        "name": "C",
        "debugMode": false,
        "configuration": {
          "jsScript": "msg.c=\"cc\"\nreturn {'msg':msg,'metadata':metadata,'msgType':msgType};"
        }
      },
      {
        "id": "node_d",
        "additionalInfo": {
          "description": "",
          "layoutX": 1010,
          "layoutY": 260
        },
        "type": "join",
        "name": "D",
        "debugMode": false,
        "configuration": {
          "timeout": 1
        }
      }
    ],
    "connections": [
      {
        "fromId": "node_a",
        "toId": "node_b",
        "type": "Success"
      },
      {
        "fromId": "node_a",
        "toId": "node_c",
        "type": "Success"
      },
      {
        "fromId": "node_b",
        "toId": "node_d",
        "type": "Success"
      },
      {
        "fromId": "node_c",
        "toId": "node_d",
        "type": "Success"
      }
    ]
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Edit this page on GitHub (opens new window)
Last Updated: 2025/12/10, 11:02:18
fork
Switch

← fork Switch→

Theme by Vdoing | Copyright © 2023-2025 RuleGo Team | Apache 2.0 License

  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式