Skip to content
View as Markdown

Step

Source definition: src/bitdrift/public/unary/workflows/v1/workflow.proto#L142-L185

A single step within a flow.

Field Type Description
match_rule bitdrift.public.unary.workflows.v1.MatchRule The step's match rule. This rule must be satisfied to advance to the next step in the flow.
exit_conditions array of bitdrift.public.unary.workflows.v1.Step.ExitCondition
up to 100 items
Zero or more exit conditions for the step. If an exit condition is met, the flow resets to the start of the flow.
loop_match_id optional string
up to 100 chars
Describes an optional loop condition that allows looping back to a previous step in the flow. Must point to the match ID in the same step or a step earlier in the flow. Specifying a looping condition is only valid on the last step in the flow unless actions contains a Sankey rule that refers to the match ID of this step as one of the nodes.
save_fields array of bitdrift_public.protobuf.workflow.v1.SaveField
up to 100 items
Fields to save when this step is matched. These fields can be referred to by saved_field_id in a subsequent matcher. The ID of each SaveField must be unique within the flow. This is used for correlation matching in which flow completion is dependent on a particular set of field values being consistent across multiple steps in the flow.

Example

JSON
{
  "exit_conditions": [
    {
      "match_rule": {
        "generic_match": {
          "base_matcher": {
            "log_field": "field_name",
            "operator": "EQUAL",
            "string_value": "example"
          }
        },
        "match_id": "_i1yUnHjKfmWpCaD5Tazo",
        "sample_rate": 100
      }
    }
  ],
  "loop_match_id": "_i1yUnHjKfmWpCaD5Tazo",
  "match_rule": {
    "generic_match": {
      "base_matcher": {
        "log_field": "field_name",
        "operator": "EQUAL",
        "string_value": "example"
      }
    },
    "match_id": "_i1yUnHjKfmWpCaD5Tazo",
    "sample_rate": 100
  },
  "save_fields": [
    {
      "field_name": "",
      "id": "",
      "regex_capture": ""
    }
  ]
}

Step.ExitCondition

Source definition: src/bitdrift/public/unary/workflows/v1/workflow.proto#L145-L165

A step exit condition. When an exit condition is met, flow execution resets to the start of the flow and will wait to match the initial step again.

Field Type Description
match_rule bitdrift.public.unary.workflows.v1.MatchRule(Only one of match_rule, or timeout can be set) Exits on a match condition.
timeout bitdrift.public.unary.workflows.v1.Step.ExitCondition.TimeoutExit(Only one of timeout, or match_rule can be set) Exits on a timeout condition.

Example

JSON
{
  "match_rule": {
    "generic_match": {
      "base_matcher": {
        "log_field": "field_name",
        "operator": "EQUAL",
        "string_value": "example"
      }
    },
    "match_id": "_i1yUnHjKfmWpCaD5Tazo",
    "sample_rate": 100
  }
}

Step.ExitCondition.TimeoutExit

Source definition: src/bitdrift/public/unary/workflows/v1/workflow.proto#L146-L156

Field Type Description
id string
between 1 and 100 chars
The ID of the timeout which can be referred to by actions. Must be unique within the workflow.
timeout_rule bitdrift.public.unary.workflows.v1.Rule.RuleTimeout The timeout rule.

Example

JSON
{
  "id": "_i1yUnHjKfmWpCaD5Tazo",
  "timeout_rule": {
    "duration": 1,
    "duration_unit": "SECONDS"
  }
}