Built-in Module
shell
Execute shell commands and scripts in your workflows with configurable timeouts and environment variables.
Configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
| command | string | Conditional* | Single command to execute |
| script | array | Conditional* | Multi-line script as array of strings |
| shell | string | No | Shell to use: bash, sh, zsh (default: bash) |
| working_dir | string | No | Working directory for execution |
| env | object | No | Environment variables |
| timeout | string | No | Timeout (e.g., '5m', '30s') (default: 5m) |
| capture_output | boolean | No | Capture stdout/stderr (default: true) |
* Either command or script is required
Examples
Single Command
json
{
"id": "check_node",
"type": "shell",
"config": {
"command": "node --version",
"shell": "bash"
}
}Multi-line Script
json
{
"id": "build_app",
"type": "shell",
"config": {
"script": [
"echo 'Starting build...'",
"npm ci",
"npm run build",
"echo 'Build complete!'"
],
"working_dir": "./app",
"timeout": "10m"
}
}With Environment Variables
json
{
"id": "deploy",
"type": "shell",
"config": {
"command": "kubectl apply -f deployment.yaml",
"env": {
"KUBECONFIG": "{{env.KUBECONFIG_PATH}}",
"NAMESPACE": "production"
},
"timeout": "2m"
}
}Output
The shell module captures and returns:
stdout- Standard output from commandstderr- Standard error (if any)exit_code- Exit code (0 = success)