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
      • While Loop
        • Configuration
        • Relation Type
        • Execution Result
        • Iteration Context Variables
        • Breaking the Loop
        • 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

目录

While Loop

while component: Conditional loop node. It executes the target node or rule chain repeatedly as long as the specified condition is met.

# Configuration

Field Type Description Default
condition string The loop condition expression using el expression language. E.g., msg.count==nil || msg.count < 5.
do string The Node ID or Sub-Rule Chain ID to execute in each iteration.

# Relation Type

  • Success: After the loop finishes, the message is passed along the Success chain.
  • Failure: If an error occurs during expression evaluation or iteration, the message is passed along the Failure chain.

# Execution Result

Returns the result of the last iteration. The result of the previous iteration is used as input for the next iteration.

# Iteration Context Variables

During iteration, the component sets the following metadata variables:

  • _loopIndex: Current iteration index (starting from 0).

# Breaking the Loop

If the message metadata contains _break with value true during iteration, the loop terminates immediately.

# Configuration Example

{
  "id": "s1",
  "type": "while",
  "name": "While Loop",
  "configuration": {
    "condition": "msg.count==nil || msg.count < 5",
    "do": "s2"
  }
}
1
2
3
4
5
6
7
8
9
Edit this page on GitHub (opens new window)
Last Updated: 2026/01/28, 09:25:09
Break
End Node

← Break End Node→

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

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