If you know a workflow will have to wait for a response from an outside source during its run, but do not know how long that wait will last, you can implement it as a trigger-based long-running workflow. A trigger-based long-running workflow waits for a defined trigger event to occur before resuming.

You implement a workflow as a trigger-based long-running workflow by using the Waiting Event element. When the trigger-based long-running workflow arrives at the Waiting Event element, it will suspend its run and wait in a passive state until it receives a message from the trigger. During the waiting period, the passive workflow does not consume a thread, but rather the long-running workflow element passes the workflow information to the single thread that monitors all long-running workflows in the server.

Create a workflow.

Open the workflow for editing in the workflow editor.

Add some elements to the workflow schema.

Define a trigger event that is encapsulated in a Trigger object.


Drag a Waiting Event element from the Generic menu to the position in the workflow schema at which you want to suspend the workflow's run.


Link the Waiting Event element to the elements that precede and follow it in the workflow schema.

The scriptable task that declares the trigger must immediately precede the Waiting Event element.


Click the Waiting Event element to show its properties tabs in the bottom half of the Schema tab.


Provide a description of the reason for the wait in the Info properties tab.


Click the Attributes properties tab.

The trigger.ref parameter appears in the list of attributes.


Click the trigger.ref parameter's Not set link to bind the parameter to an appropriate Trigger object.

The Waiting Event selection dialog box opens, presenting a list of possible parameters to which to bind.


Select a predefined Trigger object from the proposed list.

This Trigger object represents a trigger event that another workflow or workflow element defines.


Define any exception behavior in the Exceptions properties tab.


Click Save at the bottom of the workflow editor.

You defined a workflow element that suspends a trigger-based long-running workflow, that waits for a specific trigger event before restarting.

You can run a workflow.