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
      • Switch
      • Inclusive
      • Break
        • Configuration
        • How It Works
        • Relation Type
        • Execution Result
        • Configuration Example
      • 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

目录

Break

The break component is used to interrupt iteration inside a for node. When the message passes through this node, it writes an interrupt flag into the message metadata. The for node detects this flag and immediately stops iteration.

# Configuration

This component has no configuration fields.

# How It Works

It sets metadata['_break']='1' and the for node checks this flag after each iteration. Once detected, the for node clears the flag and stops iterating.

# Relation Type

  • Success: Always forwards to Success so the upstream for node can continue its control flow (including break detection).
  • Failure: None.

# Execution Result

Does not modify msg or msgType; only writes the interrupt flag _break=1 in metadata.

# Configuration Example

The following example interrupts iteration when a condition is met:

{
  "ruleChain": { "id": "break-01", "name": "Break in For Loop", "debugMode": true, "root": true },
  "metadata": {
    "nodes": [
      { "id": "n_for", "type": "for", "name": "iterate", "configuration": { "range": "msg.items", "do": "n_check", "mode": 1 } },
      { "id": "n_check", "type": "switch", "name": "cond", "configuration": { "cases": [ { "case": "msg.value>50", "then": "Stop" } ] } },
      { "id": "n_break", "type": "break", "name": "break" }
    ],
    "connections": [
      { "fromId": "n_check", "toId": "n_break", "type": "Stop" },
      { "fromId": "n_for", "toId": "n_check", "type": "Success" }
    ]
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Edit this page on GitHub (opens new window)
Last Updated: 2025/11/27, 10:15:33
Inclusive
End Node

← Inclusive End Node→

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

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