Skip to main content

conditionalWorkflow

A Workflow Engine function that executes a conditional workflow defined in the Conditional Workflows integration tile. This action evaluates the if, else if, and else clauses and sends the in-scope CEvent object to the targeted standalone (inform) workflow when an if or else if filter condition evaluates to true. If no filter condition evaluates to true, the CEvent object is sent to the workflow targeted by the else clause.

The current workflowContext is sent to the targeted workflow and can be accessed by using standard substitution variables or Workflow Engine actions.

Conditional workflows are useful when branching if/else if/else logic is required and cannot be achieved, or would be more complex to implement, by using individual workflows.

Only standalone workflows can be called. Take care to avoid race conditions where both the conditional workflow target and the calling workflow act on the same CEvent object. It is recommended that a conditional workflow be the last action in a workflow and that any subsequent actions be handled by the targeted workflow (for example, forwarding).

This action always returns false, allowing the Forwarding action to be used to control workflow execution.

This function is available as a feature of the Add-ons v2.7 download and later.

This function is available for alert and Situation workflows.

Back to Workflow Engine Functions Reference.

Arguments

Workflow Engine function conditionalWorkflow takes the following arguments:

Name

Required

Type

Description

name

yes

string

The name of the conditional workflow defined in the "Conditional Workflow" integration tile.

Example

The following example demonstrates typical use of Workflow Engine function conditionalWorkflow.

Given a Situation with the following attributes (some attributes are omitted for clarity):

{
	"total_alerts" : 10,
	"custom_info" : {
		"num_affected_hosts" : 7
	},
	"services" : [ "email", "payroll" ],
	"internal_priority" : 5
}

A conditional workflow can be used to implement logic such as:

  • If one of the impacted services is "email", notify the L2 email team; else, notify the general triage team.

  • If the total number of alerts is greater than 10, add a "critical" flag to the Situation. Else, if the number of affected hosts is greater than 5, add a "multi-host" flag. Else, add a "triage" flag.