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

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

No fields

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

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

<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">up to 100 chars; server generated</em> | The server-generated ID for this rule action. This can be used to query  for sessions that arrive at this rule action. |
| applied_daily_limit | <span class="proto-type proto-type-primitive">uint32</span><br><em class="proto-field-annotation">server generated</em> | The effective daily capture limit currently applied to this rule. |
| match_id | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">up to 100 chars</em> | The match ID of the step that triggers session capture. |

</section>
<p class="h4">Example</p>
```json
{
  "applied_daily_limit": 25,
  "id": "fkQ1PfAZhdYvJexzY6DYuoYCZTEaWO0Y7spxwjr7akc",
  "match_id": "_i1yUnHjKfmWpCaD5Tazo"
}
```

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

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

A metrics action defines one or more time series that are computed from workflow matches and
 emitted with the metadata needed to combine them into a chart server-side.

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| time_series | <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">Rule</i><i class="proto-type-dot">.</i><i class="proto-type-part">RuleMetricChartConfiguration</i><i class="proto-type-dot">.</i><i class="proto-type-part">TimeSeries</i>](#bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries "bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries")</span><br><em class="proto-field-annotation">up to 100 items</em> | The time series that should be generated for this chart. |

</section>
<p class="h4">Example</p>
```json
{
  "time_series": [
    {
      "aggregated_id": "count/fkQ1PfAZhdYvJexzY6DYuoYCZTEaWO0Y7spxwjr7akc",
      "rate": {
        "denominator": {
          "match_id": "_i1yUnHjKfmWpCaD5Tazo",
          "name": "field_name"
        },
        "denominator_id": "fkQ1PfAZhdYvJexzY6DYuoYCZTEaWO0Y7spxwjr7akc",
        "group_by": {
          "values": [
            {
              "log_body": false
            }
          ]
        },
        "numerator": {
          "match_id": "_i1yUnHjKfmWpCaD5Tazo",
          "name": "field_name"
        },
        "numerator_id": "fkQ1PfAZhdYvJexzY6DYuoYCZTEaWO0Y7spxwjr7akc"
      },
      "track_unique": {
        "device_id": true
      }
    }
  ]
}
```

# <a id="bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.DataReference"></a>Rule.RuleMetricChartConfiguration.DataReference

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

A reference to the match ID and field extraction that provides the value for a single time series.

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| match_id | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">up to 100 chars</em> | The match ID that provides the value for this data reference. If extraction type is  `measured_time`, this must point to a Measure Time rule. |
| name | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">up to 100 chars</em><span class="proto-field-annotation">only one of <em>name</em>, or <em>measured_time</em> can be set</span> | The name of the field to extract the value from. |
| measured_time | <span class="proto-type proto-type-primitive">bool</span><span class="proto-field-annotation">only one of <em>measured_time</em>, or <em>name</em> can be set</span> | Extract the measured time from a completed Measure Time rule. This can only be set if  the match_id points to a Measure Time rule. |

</section>
<p class="h4">Example</p>
```json
{
  "match_id": "_i1yUnHjKfmWpCaD5Tazo",
  "name": "field_name"
}
```

# <a id="bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries"></a>Rule.RuleMetricChartConfiguration.TimeSeries

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

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| rate | <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">RuleMetricChartConfiguration</i><i class="proto-type-dot">.</i><i class="proto-type-part">TimeSeries</i><i class="proto-type-dot">.</i><i class="proto-type-part">Rate</i>](#bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries.Rate "bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries.Rate")</span><span class="proto-field-annotation">only one of <em>rate</em>, or <em>histogram</em>, <em>count</em>, <em>average_count</em> can be set</span> | Emits a numerator and denominator and renders their ratio as a percentage-based time  series. |
| histogram | <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">RuleMetricChartConfiguration</i><i class="proto-type-dot">.</i><i class="proto-type-part">TimeSeries</i><i class="proto-type-dot">.</i><i class="proto-type-part">Histogram</i>](#bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries.Histogram "bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries.Histogram")</span><span class="proto-field-annotation">only one of <em>histogram</em>, or <em>rate</em>, <em>count</em>, <em>average_count</em> can be set</span> | Records numeric samples and renders percentile lines such as P50, P90, and P99. |
| count | <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">RuleMetricChartConfiguration</i><i class="proto-type-dot">.</i><i class="proto-type-part">TimeSeries</i><i class="proto-type-dot">.</i><i class="proto-type-part">Count</i>](#bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries.Count "bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries.Count")</span><span class="proto-field-annotation">only one of <em>count</em>, or <em>rate</em>, <em>histogram</em>, <em>average_count</em> can be set</span> | Emits counts for matching events or extracted values. |
| average_count | <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">RuleMetricChartConfiguration</i><i class="proto-type-dot">.</i><i class="proto-type-part">TimeSeries</i><i class="proto-type-dot">.</i><i class="proto-type-part">AverageCount</i>](#bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries.AverageCount "bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries.AverageCount")</span><span class="proto-field-annotation">only one of <em>average_count</em>, or <em>rate</em>, <em>histogram</em>, <em>count</em> can be set</span> | Emits an average based on a numerator series and an implicit denominator count. |
| aggregated_id | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">up to 100 chars; server generated</em> | This is the normalized ID for the time series. It is the ID that ends up being used in  chart data requests, attaching alerts, etc. |
| track_unique | <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">RuleMetricChartConfiguration</i><i class="proto-type-dot">.</i><i class="proto-type-part">TimeSeries</i><i class="proto-type-dot">.</i><i class="proto-type-part">TrackUnique</i>](#bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries.TrackUnique "bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries.TrackUnique")</span> | Whether to track unique contributions to each aggregation interval for this time series. |

</section>
<p class="h4">Example</p>
```json
{
  "aggregated_id": "count/fkQ1PfAZhdYvJexzY6DYuoYCZTEaWO0Y7spxwjr7akc",
  "rate": {
    "denominator": {
      "match_id": "_i1yUnHjKfmWpCaD5Tazo",
      "name": "field_name"
    },
    "denominator_id": "fkQ1PfAZhdYvJexzY6DYuoYCZTEaWO0Y7spxwjr7akc",
    "group_by": {
      "values": [
        {
          "log_body": false
        }
      ]
    },
    "numerator": {
      "match_id": "_i1yUnHjKfmWpCaD5Tazo",
      "name": "field_name"
    },
    "numerator_id": "fkQ1PfAZhdYvJexzY6DYuoYCZTEaWO0Y7spxwjr7akc"
  },
  "track_unique": {
    "device_id": true
  }
}
```

# <a id="bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries.Rate"></a>Rule.RuleMetricChartConfiguration.TimeSeries.Rate

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

A rate metric that is going to be generated for this time series. This
 is done by emitting simple counters for each of the extracted values
 and computing the ratio server-side.

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| numerator | <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">RuleMetricChartConfiguration</i><i class="proto-type-dot">.</i><i class="proto-type-part">DataReference</i>](#bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.DataReference "bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.DataReference")</span> | The data reference to use for the rate numerator. |
| denominator | <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">RuleMetricChartConfiguration</i><i class="proto-type-dot">.</i><i class="proto-type-part">DataReference</i>](#bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.DataReference "bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.DataReference")</span> | The data reference to use for the rate denominator. |
| numerator_id | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">up to 100 chars; server generated</em> | The server-generated ID for this rate metric. This can be used to  query for the metric. |
| denominator_id | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">up to 100 chars; server generated</em> | The server-generated ID for the denominator metric. This can be used  to query for the metric. |
| group_by | <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">GroupBy</i>](bitdrift_public_unary_workflows_v1_GroupBy.md "bitdrift.public.unary.workflows.v1.GroupBy")</span> | An optional group by configuration for the time series. The chart  will select a limited number of time series based on a top K lookup  of the most relevant time series. If the group by is not set, the  generated chart will show the time series as a single line. |

</section>
<p class="h4">Example</p>
```json
{
  "denominator": {
    "match_id": "_i1yUnHjKfmWpCaD5Tazo",
    "name": "field_name"
  },
  "denominator_id": "fkQ1PfAZhdYvJexzY6DYuoYCZTEaWO0Y7spxwjr7akc",
  "group_by": {
    "values": [
      {
        "log_body": false
      }
    ]
  },
  "numerator": {
    "match_id": "_i1yUnHjKfmWpCaD5Tazo",
    "name": "field_name"
  },
  "numerator_id": "fkQ1PfAZhdYvJexzY6DYuoYCZTEaWO0Y7spxwjr7akc"
}
```

# <a id="bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries.Histogram"></a>Rule.RuleMetricChartConfiguration.TimeSeries.Histogram

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

A histogram metric that is going to be generated for this time series.
 This is done by emitting histogram values for each value of the
 extracted value, aggregated server-side.

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| value | <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">RuleMetricChartConfiguration</i><i class="proto-type-dot">.</i><i class="proto-type-part">DataReference</i>](#bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.DataReference "bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.DataReference")</span> | The data reference whose values will be recorded in the histogram. |
| group_by | <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">GroupBy</i>](bitdrift_public_unary_workflows_v1_GroupBy.md "bitdrift.public.unary.workflows.v1.GroupBy")</span> | An optional group by configuration for the time series. The chart  will select a limited number of time series based on a top K lookup  of the most relevant time series. If the group by is not set, the  generated chart will show the time series with one line per (P50,  P90, P99) percentile. |
| id | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">up to 100 chars; server generated</em> | The server-generated ID for this histogram metric. This can be used  to query for the metric. |

</section>
<p class="h4">Example</p>
```json
{
  "group_by": {
    "values": [
      {
        "log_body": false
      }
    ]
  },
  "id": "fkQ1PfAZhdYvJexzY6DYuoYCZTEaWO0Y7spxwjr7akc",
  "value": {
    "match_id": "_i1yUnHjKfmWpCaD5Tazo",
    "name": "field_name"
  }
}
```

# <a id="bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries.Count"></a>Rule.RuleMetricChartConfiguration.TimeSeries.Count

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

A count metric that is going to be generated for this time series. This
 is done by emitting a counter with the extracted value.

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| value | <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">RuleMetricChartConfiguration</i><i class="proto-type-dot">.</i><i class="proto-type-part">DataReference</i>](#bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.DataReference "bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.DataReference")</span> | The data reference whose values will be emitted into the counter. |
| group_by | <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">GroupBy</i>](bitdrift_public_unary_workflows_v1_GroupBy.md "bitdrift.public.unary.workflows.v1.GroupBy")</span> | An optional group by configuration for the time series. The chart  will select a limited number of time series based on a top K lookup  of the most relevant time series. If the group by is not set, the  generated chart will show the time series as a single line. |
| id | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">up to 100 chars; server generated</em> | The server-generated ID for this count metric. This can be used to  query for the metric. |

</section>
<p class="h4">Example</p>
```json
{
  "group_by": {
    "values": [
      {
        "log_body": false
      }
    ]
  },
  "id": "fkQ1PfAZhdYvJexzY6DYuoYCZTEaWO0Y7spxwjr7akc",
  "value": {
    "match_id": "_i1yUnHjKfmWpCaD5Tazo",
    "name": "field_name"
  }
}
```

# <a id="bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries.AverageCount"></a>Rule.RuleMetricChartConfiguration.TimeSeries.AverageCount

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

This time series type will produce an average counter, by emitting a synthetic denominator
 counter increment every time the numerator counter is extracted and incremented. In
 practice this is identical to rate, but the display will not be % based and the denominator
 is implicit.

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| numerator | <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">RuleMetricChartConfiguration</i><i class="proto-type-dot">.</i><i class="proto-type-part">DataReference</i>](#bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.DataReference "bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.DataReference")</span> | The data reference to use for the average count numerator. |
| numerator_id | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">up to 100 chars; server generated</em> | The server-generated ID for this rate metric. This can be used to  query for the metric. |
| denominator_id | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">up to 100 chars; server generated</em> | The server-generated ID for the denominator metric. This can be used  to query for the metric. |
| group_by | <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">GroupBy</i>](bitdrift_public_unary_workflows_v1_GroupBy.md "bitdrift.public.unary.workflows.v1.GroupBy")</span> | An optional group by configuration for the time series. The chart  will select a limited number of time series based on a top K lookup  of the most relevant time series. If the group by is not set, the  generated chart will show the time series as a single line. |

</section>
<p class="h4">Example</p>
```json
{
  "denominator_id": "fkQ1PfAZhdYvJexzY6DYuoYCZTEaWO0Y7spxwjr7akc",
  "group_by": {
    "values": [
      {
        "log_body": false
      }
    ]
  },
  "numerator": {
    "match_id": "_i1yUnHjKfmWpCaD5Tazo",
    "name": "field_name"
  },
  "numerator_id": "fkQ1PfAZhdYvJexzY6DYuoYCZTEaWO0Y7spxwjr7akc"
}
```

# <a id="bitdrift.public.unary.workflows.v1.Rule.RuleMetricChartConfiguration.TimeSeries.TrackUnique"></a>Rule.RuleMetricChartConfiguration.TimeSeries.TrackUnique

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

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| device_id | <span class="proto-type proto-type-primitive">bool</span> | This is computed entirely server-side and thus does not require any client emission. |

</section>
<p class="h4">Example</p>
```json
{
  "device_id": true
}
```

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

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

A Sankey diagram action combines multiple steps in a single flow user journey into a single
 diagram that shows which paths are taken through the flow.

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| nodes | <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">Rule</i><i class="proto-type-dot">.</i><i class="proto-type-part">RuleSankeyDiagramConfiguration</i><i class="proto-type-dot">.</i><i class="proto-type-part">Node</i>](#bitdrift.public.unary.workflows.v1.Rule.RuleSankeyDiagramConfiguration.Node "bitdrift.public.unary.workflows.v1.Rule.RuleSankeyDiagramConfiguration.Node")</span><br><em class="proto-field-annotation">up to 100 items</em> | The list of nodes. Since workflows can have loops and each node corresponds to a matcher  within a workflow, it's possible for a given matcher and its corresponding node to be visited  multiple times. For each visit, a new value is extracted.   Additional details related to each node of the diagram. This data is not modified  by the server during workflow updates, allowing the frontend to store  information that remains stable between updates.   All target nodes must be within the same flow. The loop section is the portion of the flow  covered by a loop back-edge; nodes in that section are treated as extracted dynamic values,  while nodes before or after it are fixed labels. |
| id | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">up to 100 chars; server generated</em> | The server-generated ID for this rule action. This uniquely identifies the Sankey diagram  in a way which is consistent between workflows that define the same Sankey diagram. |

</section>
<p class="h4">Example</p>
```json
{
  "id": "fkQ1PfAZhdYvJexzY6DYuoYCZTEaWO0Y7spxwjr7akc",
  "nodes": [
    {
      "extract_field": "field_name",
      "id": "_i1yUnHjKfmWpCaD5Tazo"
    }
  ]
}
```

# <a id="bitdrift.public.unary.workflows.v1.Rule.RuleSankeyDiagramConfiguration.Node"></a>Rule.RuleSankeyDiagramConfiguration.Node

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

Each node corresponds to a match rule in the flow and supplies the value recorded when that
 node is visited.

<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> | ID of the corresponding match rule. It must resolve to a known match ID, and all node IDs  in a single Sankey diagram must belong to the same flow. |
| fixed | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">up to 255 chars</em><span class="proto-field-annotation">only one of <em>fixed</em>, or <em>extract_field</em> can be set</span> | The fixed value. |
| extract_field | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">up to 100 chars</em><span class="proto-field-annotation">only one of <em>extract_field</em>, or <em>fixed</em> can be set</span> | The name of the field whose value should be extracted. |

</section>
<p class="h4">Example</p>
```json
{
  "extract_field": "field_name",
  "id": "_i1yUnHjKfmWpCaD5Tazo"
}
```

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

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

A funnel action combines data from multiple steps in a single flow into one chart that shows
 drop-off between steps. Each funnel step corresponds to a match rule in the flow, identified by
 its match ID.

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| ids | <span class="proto-type proto-type-primitive">array of string</span><br><em class="proto-field-annotation">up to 100 items; server generated</em> | The server-generated metric IDs for this funnel. There is one ID per referenced match ID, in  the same order as `match_ids`. |
| match_ids | <span class="proto-type proto-type-primitive">array of string</span><br><em class="proto-field-annotation">up to 100 items</em> | The match IDs in the workflow that correspond to the steps of the funnel. All match IDs must  be from the same flow. |

</section>
<p class="h4">Example</p>
```json
{
  "ids": [
    "fkQ1PfAZhdYvJexzY6DYuoYCZTEaWO0Y7spxwjr7akc"
  ],
  "match_ids": [
    "_i1yUnHjKfmWpCaD5Tazo"
  ]
}
```

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

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

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| name | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">up to 255 chars</em> | A unique identifier for this action that will be included in the generated message body. |
| start_match_id | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">up to 100 chars</em> | The match ID where the measurement starts. It must be in the same flow as `end_match_id`. |
| end_match_id | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">up to 100 chars</em> | The match ID where the measurement ends. It must be in the same flow as `start_match_id`. |
| correlation_field_name | <span class="proto-type proto-type-primitive">optional string</span><br><em class="proto-field-annotation">up to 100 chars</em> | Correlates the start and end matches using a shared field value. This is useful when the  start and end can be racy and we might otherwise measure time between unrelated events. For  example:    - Download started, id=A   - Download started, id=B   - Download completed, id=A   - Download completed, id=B   Without this we'd be measuring the time between B started and A completed. |
| additional_extracted_fields | <span class="proto-type proto-type-primitive">array of string</span><br><em class="proto-field-annotation">up to 100 items</em> | Additional fields to extract from the end match when the time measurement completes. |
| measure_time_condition | <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">RuleMeasureTime</i><i class="proto-type-dot">.</i><i class="proto-type-part">MeasureTimeCondition</i>](#bitdrift.public.unary.workflows.v1.Rule.RuleMeasureTime.MeasureTimeCondition "bitdrift.public.unary.workflows.v1.Rule.RuleMeasureTime.MeasureTimeCondition")</span> | An optional condition to check when time measurement is complete. If specified, actions that  target the match_id of this rule will only be triggered if the condition is met. |

</section>
<p class="h4">Example</p>
```json
{
  "additional_extracted_fields": [
    "field_name"
  ],
  "correlation_field_name": "field_name",
  "end_match_id": "_i1yUnHjKfmWpCaD5Tazo",
  "measure_time_condition": {
    "duration_threshold": "3600s",
    "operator": "NOT_EQUAL"
  },
  "name": "name",
  "start_match_id": "_i1yUnHjKfmWpCaD5Tazo"
}
```

# <a id="bitdrift.public.unary.workflows.v1.Rule.RuleMeasureTime.MeasureTimeCondition"></a>Rule.RuleMeasureTime.MeasureTimeCondition

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

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| operator | <span class="proto-type proto-type-enum">[<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">Operator</i>](bitdrift_public_unary_workflows_v1_Operator.md "bitdrift.public.unary.workflows.v1.Operator")</span><br><em class="proto-field-annotation">must be a defined enum value</em> | The operator to use when evaluating the duration threshold. |
| duration_threshold | <span class="proto-type proto-type-well-known">[google.protobuf.Duration](https://protobuf.dev/reference/protobuf/google.protobuf/#duration "google.protobuf.Duration")</span> | The duration threshold to use when evaluating the condition. |

</section>
<p class="h4">Example</p>
```json
{
  "duration_threshold": "3600s",
  "operator": "NOT_EQUAL"
}
```

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

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

A timeout-based exit that can be attached anywhere a step can define exit conditions. Timeout
 exits are terminal and do not advance to another step. A single step can define at most one
 timeout exit.

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| duration | <span class="proto-type proto-type-primitive">uint32</span><br><em class="proto-field-annotation">greater than 0</em> | The length of time to wait before the timeout exit fires. |
| duration_unit | <span class="proto-type proto-type-enum">[<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><i class="proto-type-dot">.</i><i class="proto-type-part">DurationUnit</i>](#bitdrift.public.unary.workflows.v1.Rule.RuleTimeout.DurationUnit "bitdrift.public.unary.workflows.v1.Rule.RuleTimeout.DurationUnit")</span><br><em class="proto-field-annotation">must be a defined enum value</em> | The unit for `duration`. |

</section>
<p class="h4">Example</p>
```json
{
  "duration": 1,
  "duration_unit": "SECONDS"
}
```

# <a id="bitdrift.public.unary.workflows.v1.Rule.RuleTimeout.DurationUnit"></a>Rule.RuleTimeout.DurationUnit <em class="proto-enum">Enum</em>

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

| Name | Description |
|---|---|
| MILLISECONDS |  |
| SECONDS |  |
| MINUTES |  |
| HOURS |  |

