Skip to content
View as Markdown

Workflow

Source definition: src/bitdrift/public/unary/workflows/v1/workflow.proto#L50-L110

Field Type Description
id string
up to 100 chars; server generated
A unique identifier for the workflow. This is set automatically by the server upon workflow creation and is immutable.
name string
up to 255 chars
A human readable title for the workflow.
flows array of bitdrift.public.unary.workflows.v1.Flow
up to 100 items
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 array of bitdrift.public.unary.workflows.v1.ActionRule
up to 100 items
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 bitdrift.public.unary.workflows.v1.Workflow.WorkflowState
must be a defined enum value; server generated
The current deployment state of the workflow.
created_at google.protobuf.Timestamp
server generated
Creation date of the workflow.
updated_at google.protobuf.Timestamp
server generated
Last update date of the workflow.
owner bitdrift.public.unary.common.v1.Owner
server generated
The user this workflow belongs to.
deployed_at google.protobuf.Timestamp
server generated
Last deploy date of the workflow.
platform_targets array of bitdrift.public.shared.platform.v1.Platform
up to 100 items
The platform targets for this workflow. If empty, this will match any platform.
group_by_fields array of string
up to 100 items
Additional group by values that are collected for each collected metric within the workflow.
deployment_expiration_time google.protobuf.Timestamp
server generated
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.

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"
}

Workflow.WorkflowState Enum

Source definition: 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.