Built-in Module

shell

Execute shell commands and scripts in your workflows with configurable timeouts and environment variables.

Configuration

ParameterTypeRequiredDescription
commandstringConditional*Single command to execute
scriptarrayConditional*Multi-line script as array of strings
shellstringNoShell to use: bash, sh, zsh (default: bash)
working_dirstringNoWorking directory for execution
envobjectNoEnvironment variables
timeoutstringNoTimeout (e.g., '5m', '30s') (default: 5m)
capture_outputbooleanNoCapture 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 command
  • stderr - Standard error (if any)
  • exit_code - Exit code (0 = success)