---
search:
  exclude: true
---

# <a id="bitdrift.public.unary.workflows.v1.Step"></a>Step

**Source definition:** [`src/bitdrift/public/unary/workflows/v1/workflow.proto#L142-L185`](<https://github.com/bitdriftlabs/api/blob/main/src/bitdrift/public/unary/workflows/v1/workflow.proto#L142-L185>)

A single step within a flow.

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| match_rule | <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">workflows</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">MatchRule</i>](bitdrift_public_unary_workflows_v1_MatchRule.md "bitdrift.public.unary.workflows.v1.MatchRule")</span> | The step's match rule. This rule must be satisfied to advance to the next step in the flow. |
| exit_conditions | <span class="proto-type proto-type-message">array of [<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">workflows</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">Step</i><i class="proto-type-dot">.</i><i class="proto-type-part">ExitCondition</i>](#bitdrift.public.unary.workflows.v1.Step.ExitCondition "bitdrift.public.unary.workflows.v1.Step.ExitCondition")</span><br><em class="proto-field-annotation">up to 100 items</em> | 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 | <span class="proto-type proto-type-primitive">optional string</span><br><em class="proto-field-annotation">up to 100 chars</em> | 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 | <span class="proto-type proto-type-message">array of [<i class="proto-type-part">bitdrift_public</i><i class="proto-type-dot">.</i><i class="proto-type-part">protobuf</i><i class="proto-type-dot">.</i><i class="proto-type-part">workflow</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">SaveField</i>](bitdrift_public_protobuf_workflow_v1_SaveField.md "bitdrift_public.protobuf.workflow.v1.SaveField")</span><br><em class="proto-field-annotation">up to 100 items</em> | 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. |

</section>
#### 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": ""
    }
  ]
}
```

# <a id="bitdrift.public.unary.workflows.v1.Step.ExitCondition"></a>Step.ExitCondition

**Source definition:** [`src/bitdrift/public/unary/workflows/v1/workflow.proto#L145-L165`](<https://github.com/bitdriftlabs/api/blob/main/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.

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| match_rule | <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">workflows</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">MatchRule</i>](bitdrift_public_unary_workflows_v1_MatchRule.md "bitdrift.public.unary.workflows.v1.MatchRule")</span><span class="proto-field-annotation">(Only one of <em>match_rule</em>, or <em>timeout</em> can be set)</span> | Exits on a match condition. |
| timeout | <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">workflows</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">Step</i><i class="proto-type-dot">.</i><i class="proto-type-part">ExitCondition</i><i class="proto-type-dot">.</i><i class="proto-type-part">TimeoutExit</i>](#bitdrift.public.unary.workflows.v1.Step.ExitCondition.TimeoutExit "bitdrift.public.unary.workflows.v1.Step.ExitCondition.TimeoutExit")</span><span class="proto-field-annotation">(Only one of <em>timeout</em>, or <em>match_rule</em> can be set)</span> | Exits on a timeout condition. |

</section>
#### Example
```json
{
  "match_rule": {
    "generic_match": {
      "base_matcher": {
        "log_field": "field_name",
        "operator": "EQUAL",
        "string_value": "example"
      }
    },
    "match_id": "_i1yUnHjKfmWpCaD5Tazo",
    "sample_rate": 100
  }
}
```

# <a id="bitdrift.public.unary.workflows.v1.Step.ExitCondition.TimeoutExit"></a>Step.ExitCondition.TimeoutExit

**Source definition:** [`src/bitdrift/public/unary/workflows/v1/workflow.proto#L146-L156`](<https://github.com/bitdriftlabs/api/blob/main/src/bitdrift/public/unary/workflows/v1/workflow.proto#L146-L156>)

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| id | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">between 1 and 100 chars</em> | The ID of the timeout which can be referred to by actions. Must be unique within the  workflow. |
| timeout_rule | <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">workflows</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">Rule</i><i class="proto-type-dot">.</i><i class="proto-type-part">RuleTimeout</i>](bitdrift_public_unary_workflows_v1_Rule.md "bitdrift.public.unary.workflows.v1.Rule.RuleTimeout")</span> | The timeout rule. |

</section>
#### Example
```json
{
  "id": "_i1yUnHjKfmWpCaD5Tazo",
  "timeout_rule": {
    "duration": 1,
    "duration_unit": "SECONDS"
  }
}
```

