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
      • iterator
      • for
      • exec
        • Configuration
        • Relation Type
        • Execution Result
        • Configuration Example
      • join
    • transform

    • external

    • flow

  • Extension Components

  • Custom Components

  • Components marketplace

  • Visualization

  • AOP

  • Trigger

  • Advanced Topic

  • RuleGo-Server

  • FAQ

  • Endpoint Module

  • Support

目录

exec

exec component: A component for executing local commands. It is used for automation, offline analysis, large model scheduling, CI/CD, and other scenarios.

# Configuration

Field Type Description Default Value
cmd string Command, can use ${metaKeyName} to replace variables in metadata None
args []string List of command arguments None
log bool Whether to print standard output, true: command standard output will trigger OnDebug function false
replaceData bool Whether to pass the standard output to the next node false

TIP

  1. By default, no commands can be run; a whitelist needs to be set.
  2. Only commands on the whitelist are allowed to execute, set the whitelist with key=execNodeWhitelist, separated by commas. Example: config.Properties.PutValue(KeyExecNodeWhitelist,"cd,ls,go")
  3. The previous node is allowed to set the command execution directory through metadata key=workDir, e.g., Metadata.PutValue("workDir","./data")

# Relation Type

  • Success: If the script executes successfully, send the message to the Success chain.
  • Failure: If the script execution fails, send the message to the Failure chain.

# Execution Result

If replaceData=true, the script execution result replaces msg.Data and flows to the next node. Otherwise, msg.Data remains unchanged.

# Configuration Example

  {
  "id": "s1",
  "type": "exec",
  "name": "Execute Local Command",
  "configuration": {
    "cmd": "ls",
    "args": ["."]
  }
 }
1
2
3
4
5
6
7
8
9
Edit this page on GitHub (opens new window)
Last Updated: 2025/04/02, 01:29:50
for
join

← for join→

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

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