Agent commands. Your AI agent uses this node in workflows. You don’t configure it directly.
Parameters
Output
Using stdin for data
Correct - data via stdin:stdin type handling
Validation and error handling
Your agent handles this. pflow validates commands when the workflow is created, not at runtime. If structured data ends up in a command string, the error message tells your agent exactly what to move to
stdin and why.stdin instead:
Technical details
Technical details
When a workflow is created, pflow checks if command templates contain dict or list variables. If found, you’ll see an error like:This validation happens at workflow creation time (compile-time), not during execution, so you get immediate feedback.Why this matters: Shell parsers expect text, and JSON data contains special characters (
{, }, ", spaces) that have meaning to the shell. Even with careful quoting, it’s fragile. The stdin approach is safer and more reliable.Security
Blocked patterns
These commands are rejected immediately with an error:rm -rf /and variants (recursive system deletion)dd if=/dev/zero of=/dev/sda(device operations):(){:|:&};:(fork bombs)chmod -R 777 /(dangerous permissions)sudo rm -rf /(privileged dangerous commands)
Warning patterns
These trigger warnings but execute unlessPFLOW_SHELL_STRICT=true:
sudo,su -shutdown,reboot,haltsystemctl poweroff
Smart error handling
Some commands return non-zero exit codes for valid “not found” results. The shell node treats these as success:Examples
Basic command
Process JSON with jq
With environment variables
Working directory
Ignoring errors
External script file
For multi-line scripts, reference an external file. The file content is read and used as the command. Path is relative to the workflow file.Error handling
The node returns
error action on non-zero exit (unless ignore_errors is true or it’s an auto-handled pattern like grep).
Recommended tools
pflow’s template variables handle most data access - you can use${api.response.items[0].name} to access nested fields and array elements directly without shell commands.
Shell is needed when you need to:
- Iterate over arrays -
jq '.items[].name'(templates can’t do wildcards) - Filter or transform -
jq 'select(.active)',sort,uniq - Compute values -
wc -l, arithmetic
grep, awk, cut, sort, head, tail, curl.
For JSON processing, install jq:

