Invoke-KFWorkflow

Syntax

Invoke-KFWorkflow
  [-WorkflowID] <workflow-id-as-string>
  [-ItemID] <item-id> ($null)
  [-Data <object> ($null)]
  [-WithAnswer[:$false]]
  [-AnswerTimeout <milliseconds> (Int.MaxValue)]
  [-ThrowErrors[:$true]]

Support

>= kenaflow 2.0.0

Return

Nothing.

Description

This cmdlet enables the workflow developer to trigger another workflow.

Please read article Trigger.

If -WithAnswer is not specified this will only trigger the workflow to start. It does not wait for the start.

If -WithAnswer is specified this will trigger the workflow and wait for it to finish.

You can pass data to the called workflow. Therefore use -Data. Be sure to specify a serializable object!

In case of a call -WithAnswer you can specify -AnswerTimeout to tell the calling workflow how long it should wait for the called workflows answer. In case of timeout $null is returned.

In case you trigger a SharePoint list workflow or SharePoint state machine workflow you have to use -ItemId to tell the called workflow what list item should be processed. If no list item id is specified the called workflow will do nothing.

Parameters

[-WorkflowID] <workflow-id-as-string>

The id of the workflow that should run by the trigger.

[-ItemID] <item-id> ($null)

ID of the SharePoint list item that should be processed by the triggered workflow.

[-Data <object> ($null)]

Data to be transfered to the called workflow.

[-WithAnswer[:$false]]

Tells the cmdlet to wait for an answer.

[-AnswerTimeout <milliseconds> (Int.MaxValue)]

The timeout in milliseconds.

[-ThrowErrors[:$true]]

This is a default parameter for all kenaflow cmdlets. If set to $true (default!) the engine will pass exception within the cmdlet to the script for further handling.

Example

Invoke-KFWorkflow \`
  -WorkflowId "8808aecd-f7e5-444c-a625-0d1506c2e99c" \` 
  -WithAnswer -AnswerTimeout 10000