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
- By default, no commands can be run; a whitelist needs to be set.
- 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")
- 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
2
3
4
5
6
7
8
9
Edit this page on GitHub (opens new window)
Last Updated: 2024/10/23, 10:13:01