While we're waiting for the ability to do nested workflows, here are a couple of (powershell based) commands to invoke WFA workflows via REST from a WFA 2.2RC1+ command (WFA 2.2 is required since this leverages the new workflow parameter feature). This allows nesting of workflows, parallel execution of sub-workflows, etc.
There are 2 commands:
- Invoke WFA Workflow.
Arguments:
- UUID: Workflow UUID (obtain from http://<WFA_IP>/rest/workflows/)
- FriendlyName: Friendly Name of the workflow
- Comment: Comment to place into job
- Variable: Workflow property name (or 'prefix#') to place job identifier into. A trailing # will be replaced with a number to allow multiple jobs to be run
- Credential: WFA Credential or Username/password to use (defaults to WFA-loopback cached credential)
- Arg0-Arg29: Sub-Workflow argument names
- Value0-Value29: Sub-Workflow argument values
- Wait for WFA Workflow
Arguments:
- Variable: Workflow property name (or 'prefix#') containing jobID
- MaxJobs: Wait until less than this number of jobs are running
- AbortOnJobFailure: Fail the command if any sub-workflows fail
- Credential: WFA Credential or Username/password to use (defaults to WFA-loopback cached credentials)
To avoid WFA credentials being visible in the WFA logs, add an "OTHER" credential for "WFA-loopback" with the username/password of a WFA user.
Update: April 17, 2014:
- Increased number of sub-workflow arguments to 30
Update: September 24, 2014
- Allow use of workflow name in the UUID parameter
- Tim