---
search:
  exclude: true
---

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

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

<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> | A unique identifier for the workflow. This is set automatically by the server upon workflow creation and is immutable. |
| name | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">up to 255 chars</em> | A human readable title for the workflow. |
| flows | <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">Flow</i>](bitdrift_public_unary_workflows_v1_Flow.md "bitdrift.public.unary.workflows.v1.Flow")</span><br><em class="proto-field-annotation">up to 100 items</em> | The flows that make up this workflow. Each flow is a sequence of steps. Flows can be thought of  as independent paths through the workflow graph. Each step contains one match rule. Steps can  also contain exit conditions that allow resetting to the initial step in the flow based on  match rules or timeouts. |
| actions | <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">ActionRule</i>](bitdrift_public_unary_workflows_v1_ActionRule.md "bitdrift.public.unary.workflows.v1.ActionRule")</span><br><em class="proto-field-annotation">up to 100 items</em> | The actions that make up this workflow. Each action is associated with one or more match IDs  that are embedded in the steps of the flows. Individual actions may have restrictions on what  referential match IDs they can be associated with. See the documentation for each action type  for more details. |
| state | <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">Workflow</i><i class="proto-type-dot">.</i><i class="proto-type-part">WorkflowState</i>](#bitdrift.public.unary.workflows.v1.Workflow.WorkflowState "bitdrift.public.unary.workflows.v1.Workflow.WorkflowState")</span><br><em class="proto-field-annotation">must be a defined enum value; server generated</em> | The current deployment state of the workflow. |
| created_at | <span class="proto-type proto-type-well-known">[google.protobuf.Timestamp](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp "google.protobuf.Timestamp")</span><br><em class="proto-field-annotation">server generated</em> | Creation date of the workflow. |
| updated_at | <span class="proto-type proto-type-well-known">[google.protobuf.Timestamp](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp "google.protobuf.Timestamp")</span><br><em class="proto-field-annotation">server generated</em> | Last update date of the workflow. |
| owner | <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">common</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">Owner</i>](bitdrift_public_unary_common_v1_Owner.md "bitdrift.public.unary.common.v1.Owner")</span><br><em class="proto-field-annotation">server generated</em> | The user this workflow belongs to. |
| deployed_at | <span class="proto-type proto-type-well-known">[google.protobuf.Timestamp](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp "google.protobuf.Timestamp")</span><br><em class="proto-field-annotation">server generated</em> | Last deploy date of the workflow. |
| platform_targets | <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">shared</i><i class="proto-type-dot">.</i><i class="proto-type-part">platform</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">Platform</i>](bitdrift_public_shared_platform_v1_Platform.md "bitdrift.public.shared.platform.v1.Platform")</span><br><em class="proto-field-annotation">up to 100 items</em> | The platform targets for this workflow. If empty, this will match _any_ platform. |
| group_by_fields | <span class="proto-type proto-type-primitive">array of string</span><br><em class="proto-field-annotation">up to 100 items</em> | Additional group by values that are collected for each collected metric within the workflow. |
| deployment_expiration_time | <span class="proto-type proto-type-well-known">[google.protobuf.Timestamp](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp "google.protobuf.Timestamp")</span><br><em class="proto-field-annotation">server generated</em> | The time at which the deployment expires based on the deployment_expiration condition.  This is set automatically by the server and will be null if the deployment does not expire  or if the workflow has not been deployed yet.   Note that due to how LastSeen works, reading the workflow data counts as a "last seen" and will reset the  expiration time. |

</section>
#### Example
```json
{
  "actions": [
    {
      "metric_chart_rule": {
        "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
            }
          }
        ]
      },
      "rule_id": "_i1yUnHjKfmWpCaD5Tazo"
    }
  ],
  "created_at": "2024-01-15T09:30:00Z",
  "deployed_at": "2024-01-15T09:30:00Z",
  "deployment_expiration_time": "2024-01-15T09:30:00Z",
  "flows": [
    {
      "exclusive": {},
      "steps": [
        {
          "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": ""
            }
          ]
        }
      ]
    }
  ],
  "group_by_fields": [
    "field_name"
  ],
  "id": "DFg5",
  "name": "Workflow name",
  "owner": {
    "email": "user@example.com",
    "id": "usr_abc123",
    "name": "Jane Doe"
  },
  "platform_targets": [
    {
      "apple": {
        "apps": [
          {
            "app_id": "com.example.app"
          }
        ]
      }
    }
  ],
  "state": "LIVE",
  "updated_at": "2024-01-15T09:30:00Z"
}
```

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

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

| Name | Number | Description |
|---|---|---|
| IDLE | 0 | The workflow is not currently running and it has not been deployed. |
| LIVE | 1 | The workflow has been deployed and it’s currently live. |
| DEPLOYING | 2 | The workflow is in the process of being deployed and it has not reached  most live clients yet. |
| EXPIRED | 3 | The workflow has been deployed but it has expired and is no longer deployed.  This is similar to IDLE but it indicates that the workflow was not explicitly stopped. |

