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)
  • 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)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文

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

  • Rule Chain

  • Standard Components

    • Standard Components Overview
    • filter

    • action

      • log
      • functions
      • delay
      • groupAction
        • Configuration
        • Relation Type
        • Configuration example
      • iterator
      • for
      • exec
      • join
    • transform

    • external

    • flow

  • Extension Components

  • Custom Components

  • Components marketplace

  • Visualization

  • AOP

  • Trigger

  • Advanced Topic

  • RuleGo-Server

  • FAQ

  • Endpoint Module

  • Support

目录

groupAction

groupAction component: node group. It groups multiple nodes into a group, executes all nodes asynchronously, waits for all nodes to finish execution, merges the results of all nodes, and sends them to the next node. Similar to sub-rule chain

If the number of nodes that match Config.MatchNum is of the type specified by Config.MatchRelationType, then send the data to the Success chain, otherwise send it to the Failure chain.

# Configuration

Field Type Required Description Default
matchRelationType string No Match the relationship type of the nodes in the group Success
matchNum int No Match the number of nodes that meet the condition 0
nodeIds string Yes List of node IDs in the group, multiple IDs separated by , -
timeout int No Execution timeout, in seconds, default: 0 means no timeout 0

matchNum: number of nodes that match the condition

  • Default 0, which means that all nodes in the group are of the type specified by matchRelationType, and will be sent to the Success chain, otherwise they will be sent to the Failure chain.
  • matchNum>0, which means that any match to matchNum nodes are of the type specified by matchRelationType, and will be sent to the Success chain, otherwise they will be sent to the Failure chain.
  • matchNum>=len(nodeIds), which is equivalent to matchNum=0

# Relation Type

  • Success: Send the message to the Success chain

  • Failure: nodeIds is empty, execution timeout or node execution failure, send to the Failure chain

  • metadata: Merge the metadata of each end node after processing, overwrite if the same key.

  • data: Wrap the messages of each end node after processing into a WrapperMsg array. WrapperMsg:

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

# Configuration example

//Note: The rule chain is triggered from the third node. firstNodeIndex=2
{
  "ruleChain": {
    "id": "rule01",
    "name": "Test rule chain",
    "root": true
  },
  "metadata": {
    "firstNodeIndex": 2,
    "nodes": [
      {
        "id": "s1",
        "type": "functions",
        "name": "Component 1",
        "debugMode": true,
        "configuration": {
          "functionName": "groupActionTest1"
        }
      },
      {
        "id": "s2",
        "type": "functions",
        "name": "Component 2",
        "debugMode": true,
        "configuration": {
          "functionName": "groupActionTest2"
        }
      },
      {
        "id": "group1",
        "type": "groupAction",
        "name": "Action group",
        "debugMode": true,
        "configuration": {
          "matchRelationType": "Success",
          "nodeIds": "s1,s2"
        }
      },
      {
        "id": "s3",
        "type": "log",
        "name": "Log",
        "debugMode": false,
        "configuration": {
          "jsScript": "return msg;"
        }
      }
    ],
    "connections": [
      {
        "fromId": "group1",
        "toId": "s3",
        "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
Edit this page on GitHub (opens new window)
Last Updated: 2025/04/02, 01:29:50
delay
iterator

← delay iterator→

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

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