The PowerShell Script node runs a PowerShell script as one step of a CloudRadial AutomationAI workflow, dispatched to a PowerShell runner. It reads input from earlier nodes, runs your script, and emits a JSON output object for later nodes to use. This article is for workspace users with the Admin role or higher who build workflows in the Designer.
- Writing the Script
- Reading Input and Emitting Output
- Configuration Fields
- Step Timeouts and Long-Running Work
Writing the Script
Add a PowerShell Script node from the Scripts section of the palette, then open it to edit the script in the Designer's code editor. The script runs on a PowerShell runner you have registered; the node's language determines which runner flavor executes it.
Reading Input and Emitting Output
The runner SDK provides two functions:
Get-NodeInput— reads the input passed to this step. Call it with-Nameto read one value, or with no argument to read the whole input bag.Set-NodeOutput— sets this step's output. Pass a hashtable; it becomes the node's JSON output object.
$userId = Get-NodeInput -Name userId
$all = Get-NodeInput
Set-NodeOutput @{ users = @($u1, $u2); count = 2 }
How a node receives its input — the previous node's whole output by default, or named values when you define explicit bindings — and how other nodes reference this node's output are covered in the article on passing data between nodes with input and output JSON.
Configuration Fields
The PowerShell, Python, and C# Script nodes share the same configuration fields:
Name— the node's display label on the canvasTimeout (seconds)— how long the step may run, from 1 to 1800 seconds (default 1800)Retry count— how many times a failed step is retried, from 0 to 5 (default 0)- Explicit
parametersbindings — a list of name-and-expression pairs the script reads by name withGet-NodeInput -Name
Step Timeouts and Long-Running Work
A step has a default timeout of 5 minutes and a hard cap of 30 minutes. The node's Timeout (seconds) field can extend a step up to the 1800-second (30-minute) cap, after which the step times out and the run is marked as timed-out. If a single step would need more than 30 minutes, split the work across multiple nodes rather than one long step. For reading step logs and recovering from a timed-out run, see the article on troubleshooting a failed or timed-out run.
Comments
0 comments
Please sign in to leave a comment.