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

  • Extension Components

  • Custom Components

  • Components marketplace

  • Visualization

  • AOP

  • Trigger

    • Trigger
      • Introduction
  • Advanced Topic

  • RuleGo-Server

  • FAQ

  • Endpoint Module

  • Support

目录

Trigger

# Introduction

RuleGo triggers the execution of rule chains in two ways: automatically and manually.

  • The automatic trigger is called: Endpoint (Input Endpoint). You can add endpoint configurations to the rule chain DSL file, dynamically set input endpoints, and trigger the execution of the rule chain through external trigger sources. For example, set up access points such as accepting HTTP requests, MQTT\kafka subscriptions, scheduling, etc.

At present, this version cannot set endpoint reuse in the rule chain DSL. For HTTP endpoints, if the port is occupied, they cannot be used again. Solution: Endpoint and rule chain run separately. [Endpoint DSL] (/en/pages/390ad7/)

Example:

Accept /api/v1/test API requests, then hand them over to the rule chain node for processing:

{
  "ruleChain": {
    "id": "withHttpEndpoint",
    "name": "Built-in Http Input Endpoint Rule Chain"
  },

  "metadata": {
    "endpoints":[
      {
        "id": "e1",
        "type": "http",
        "name": "http server",
        "configuration": {
          "server": ":9090"
        },
        "routers": [
          {
            "id":"r1",
            "params": [
              "POST"
            ],
            "from": {
              "path": "/api/v1/test",
              "configuration": {
              }
            },
            "to": {
              "wait": true,
              "processors": ["responseToBody"]
            }
          }
        ]

      }
    ],
    "nodes": [
      {
        "type": "jsFilter",
        "name": "Filter",
        "debugMode": true,
        "configuration": {
          "jsScript": "return msg.temperature>10;"
        }
      }
    ],
    "connections": [

    ]
  }
}
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

Trigger the rule chain logic every 1 second:

{
  "ruleChain": {
    "id": "withScheduleEndpoint",
    "name": "Built-in Scheduled Input Endpoint Rule Chain"
  },

  "metadata": {
    "endpoints":[
      {
        "id": "e2",
        "type": "schedule",
        "name": "schedule",
        "processors": ["testPrint"],
        "routers": [
          {
            "from": {
              "path": "*/1 * * * * *"
            }
          }
        ]
      }
    ],
    "nodes": [
      {
        "id":"s1",
        "type": "jsFilter",
        "name": "Filter",
        "debugMode": true,
        "configuration": {
          "jsScript": "return msg.temperature>10;"
        }
      }
    ],
    "connections": [

    ]
  }
}
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
  • For manual triggering of the rule chain, refer to: Execute Rule Chain
Edit this page on GitHub (opens new window)
Last Updated: 2025/03/31, 01:52:11
RuleChain Validator Aspect
Config

← RuleChain Validator Aspect Config→

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

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