Workflow Monitor
Available from version 7.2
Example Project
This example project implements basic workflow monitoring. The examples provided below for the functions and events in the Workflow Monitor built-in service refer to this example.
Description
A simple workflow is started when the project is loaded. Delays have been applied to the workflow steps as below:
Two callouts are used to display workflow monitoring information:
-
The Workflow Monitor callout is displayed when the workflow starts. It displays the name of the last step that was started and the name of the workflow in progress.
-
The Workflow Error callout is displayed if a specified time has elapsed since the last time the workflow progressed from one step to another, indicating that something might have gone wrong.
Video Explanation
The video below provides a detailed explanation of the example project.
Download and Run the Project
-
Download the project files here.
-
Unzip the files.
-
Open the project in Automation Studio.
-
Click Start Project. The workflow will start and the Workflow Monitor callout will be displayed.
Functions

When this function is executed, the Real-Time Client starts keeping track of all workflow steps that are executed so that a list of executed workflow steps can be returned by the Get Recorded Workflow Steps function.
This feature utilizes system resources so should not be used unnecessarily. Use Deactivate Recording Workflow Steps to cancel this function.
This function deletes all records of workflow steps that have been executed. The function Get Recorded Workflow Steps only returns steps executed after the last time that this function was exectured.
Parameters
None
Returns
Nothing
Example
The event handler below is triggered when the project first loads.
The event handler:
-
Shows a callout.
-
Activates recording of workflow steps, to facilitate debugging if a workflow fails.
-
Starts a workflow.

This function cancels Activate Recording Workflow steps.
This function deletes all records of workflow steps that have been executed.
Parameters
None
Returns
Nothing
Example
The onClick event handler for the Stop Workflows button on a callout is shown below.
The event handler:
-
Stops all running workflows.
-
Deactivates recording of executed workflow steps, as there is no longer any need to collect that information.

Ends all workflows that are currently running.
Parameters
None
Returns
Nothing
Example
In the example project, the End All Running Workflows function is used within the callout event handler for the Stop All Workflows button on the Workflow Error callout. When the button is clicked, the workflow is stopped.

Returns the names of all steps already executed in the workflow identified by the specified step. The steps are listed in the order in which they were executed, from earliest to latest. This function is typically used to get the list of steps already executed in the workflow of the step returned as a parameter of the Current Step Changed event.
Note: Recording of executed workflow steps must be enabled using Activate Recording Workflow Steps.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
step |
step |
The workflow step |
Returns
(list of text) Returns the names of the workflow steps already executed.
Example
This event handler is triggered whenever a workflow step changes:
The event handler writes the list of all workflow steps that have been executed to the text list Executed_Workflow_Steps.

Returns the name of a specified step. This function is typically used to get the name of the step returned as a parameter of the Current Step Changed event.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
step |
step |
The workflow step |
Returns
(text) Returns the name of the specified workflow step.
Example
In the example project, the Get Name of Step function is used within the EH-Workflow_Monitor event handler. The event handler is triggered whenever a workflow progresses to another step. The selected action shown below uses this function to get the name of the step that has just started and writes that to the relevant label in the Workflow Monitor callout. (The step that has just started is returned as a parameter of the Current Step Changed event.)

Returns the name of the workflow of a specified workflow step. This function is typically used to get the name of the workflow of the step returned as a parameter of the Current Step Changed event.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
step |
step |
The workflow step |
Returns
(text) Returns the name of the workflow of the specified step.
Example
In the example project, the Get Workflow Name of Step function is used within the EH-Workflow_Monitor event handler. The event handler is triggered whenever a workflow progresses to another step. The selected action shown below uses this function to get the name of the workflow of the step that has just started and writes that to the relevant label in the Workflow Monitor callout. (The step that has just started is returned as a parameter of the Current Step Changed event.)

Returns the workflow of a specified workflow step. This function is typically used to get the workflow of the step returned as a parameter of the Current Step Changed event.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
step |
step |
The workflow step |
Returns
(workflow) Returns the workflow of the specified step.

Starts the specified workflow step if the workflow in which that step is located is itself currently active. If the step's workflow is not active, this function will not have any effect.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
step |
step |
The workflow step |
Returns
Nothing
Example
If Workflow - 2 is active when Step 2 of Workflow - 1 (shown below) is processed, Workflow -2 will immediately shift to process Step 3 in that workflow. (If Workflow - 2 is not active, the function shown will have no effect.)
Properties

A list of type step.
This allows you to keep track of steps in your workflows.
Example
When the Current Step completes execution, the next step in the workflow, New Step, is added to List of Steps.
Events

Triggered when a new workflow progresses from one step to another.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
New Step |
step |
The workflow step that is now being processed |
Example
In the example project, the EH-Workflow_Monitor event handler is triggered by the Current Step Changed event. Whenever a workflow progresses to another step the event handler is triggered and the values in the Workflow Monitor callout are updated.
The actual step that has just been started is returned by the event's New Step parameter. That parameter is used to populate the parameters of the Get Name of Step and Get Workflow Name of Step functions.