Skip to main content

Conditions

A condition step splits a workflow into paths. It compares a field on the event to a value and sends the event down the first branch that matches. If no branch matches, the event leaves through the no_match edge.

BranchesDirect link to Branches​

A condition holds an ordered list of branches. Each branch has:

PartMeaning
HandleThe branch's identifier. An edge uses it to leave the condition
LabelA readable name for the path
FieldThe event field to read, such as severity, eventType, sourceKind, or providerId
OperatorHow to compare the field with the value
ValueA string, number, boolean, or list of strings

A condition needs at least one branch. Guard checks branches in order and takes the first match, so put the most specific branch first.

The field is a top-level name on the event. The fields that Guard Cloud sets are listed under Enrichment. In the studio's inspector, the field menu offers severity, eventType, sourceKind, and providerId, and the inspector edits the first branch. Additional branches in an imported or saved workflow are kept.

OperatorsDirect link to Operators​

OperatorMatches when
eqThe field equals the value
neqThe field does not equal the value
gt, gte, lt, lteThe field and the value are both numbers and the comparison holds
containsThe field is a string that contains the value, or a list that includes the value
inThe value is a list and the field equals one of its items

Comparison operators that use order only work on numbers, such as riskScore. A text field such as severity compares with eq, neq, or in. For example, to match both high and critical, use severity in ["high", "critical"].

If the field is missing from the event, eq, the numeric operators, contains, and in do not match, and neq does match. A field of a different type than the value does not match eq or the numeric operators.

Connect the branchesDirect link to Connect the branches​

Each branch needs an edge out of the condition:

  • A match edge leaves through a branch handle. When the condition declares handles, every match edge must name one of them. The studio rejects a match edge with no handle or an unknown handle.
  • A no_match edge is the path when no branch matches. It can only start at a condition.
  • A condition cannot have two edges with the same type and handle.

Always connect the no_match path. Send it to a terminal with the outcome no_op or suppressed so the run records why nothing was delivered.

In a test run, branches that were not taken appear as skipped with the message that the branch was not taken. See Test runs and live delivery for how conditions relate to live delivery.

ExampleDirect link to Example​

Send critical events to PagerDuty, other high-severity events to Slack, and record everything else:

  1. A condition with a branch critical where severity eq critical, and a branch high where severity eq high.
  2. A match edge from critical to a PagerDuty action, and a match edge from high to a Slack action.
  3. A no_match edge to a terminal with the outcome no_op.
  4. A failure edge from each action to a terminal with the outcome failure.

NextDirect link to Next​