Skip to main content
Matrix42 Self-Service Help Center

Execute Workflows from Compliance Rules


You can execute workflows as a result of the compliance rule (CoRu) trigger. This is a preferred way of executing custom business logic from the CoRu, because it allows defining custom business processes in the Workflow Studio without any coding. As an input, the workflow takes a list of affected objects from the CoRu that can be used to retrieve additional information and process these objects in a sequence.

Workflow Creation

To be executed from the CoRu, a workflow should meet the following criteria:
Integration Context: Compliance Rules
Input Arguments



Argument Type

Default Value






Thee workflow always takes a list of objects, regardless of number of objects that are affected by actions. The idea is to iterate through the list of objects and process each record in a sequence. You can use ObjectActionContext to retrieve additional data for the corresponding object.

ObjectActionContext contains the following properties:


Data Type




Identifier of the configuration item (TypeID). 



Identifier of the corresponding object (Expression-ObjectID). 



Time when event has been fired. 



Identifier of the user who triggers the action.


1. Run the Workflow Studio and create a new workflow from the Compliance Rules - WF Template template.


2. Define th Name, Icon, and Category for the workflow and then click Save.

The Integration Context should be Compliance Rules.







5. In the dialog search for ObjectActionContext that appears, select ObjectActionContext and click OK to confirm the selection.


6. In the Properties toolbox, select Values, and then type ObjectContexts.






The name of the current object in context is item.

8. Double-click the Flowchart activity and define the main part of the workflow. Typically it is required to retrieve additional data for the current object. You can do it by defining a new Variable and assigning it to the corresponding expression based on context object.

To achieve it, perform the following steps:

1. Define Variable with the name CurrentObjectId and Variable Type: Guid.



To: Variable name (CurrentObjectId in our case)
Value: Target value (Item.ID in our case)



For example, use the GetData activity to retrieve additional data based on object identifier (CurrentObjectId in our case) and use the Create Task activity to create a task for the Administrator and provide all the required information about the affected object.


  • Was this article helpful?