Run Script

Action terminal

action.script

Execute a shell script with full access to the incoming payload. All payload variables are exposed as environment variables prefixed with PAYLOAD_. For example, a payload key fileName becomes $PAYLOAD_fileName in your script.

The script runs in the selected shell interpreter. Standard output is captured as the output variable and the process exit code is available for downstream branching.

Destructive action

This node executes arbitrary shell scripts with the user's privileges. Watchflows surfaces an inline warning when the script body contains canonical destructive patterns (rm, dd, sudo, mkfs, shutdown, fork bomb), but the heuristic is informational only — it does not block execution. Workflows containing a Script node prompt for confirmation on every arm if the configured script triggers the heuristic.

Ports

DirectionNameData TypeDescription
InputInputAnyIncoming payload exposed as environment variables
OutputOutputStringScript stdout
OutputExit CodeNumberProcess exit code (0 = success)

Configuration

FieldTypeDefaultDescription
shellDropdown/bin/bashShell interpreter: /bin/bash, /bin/zsh, or /usr/bin/python3
scriptCode EditorThe script to execute. Access payload via $PAYLOAD_* env vars.

Output Variables

VariableTypeDescription
outputStringScript stdout output
exitCodeNumberProcess exit code

Example

Run a shell script when a webhook fires and show the result as a notification: