{
  "type": "record",
  "Aspect": {
    "name": "actionWorkflowInfo"
  },
  "name": "ActionWorkflowInfo",
  "namespace": "com.linkedin.pegasus2avro.actionworkflow",
  "fields": [
    {
      "Searchable": {},
      "type": "string",
      "name": "name",
      "doc": "Display name of the workflow"
    },
    {
      "Searchable": {},
      "type": {
        "type": "enum",
        "symbolDocs": {
          "ACCESS": "Workflow for requesting access to a resource, such as a dataset or data job.\nRequires the `access` field to be populated with specific access parameters.",
          "CUSTOM": "Custom, non-access related workflow. For example, may be used to model workflows like\nasset creation, asset cleanup or deletion, etc."
        },
        "name": "ActionWorkflowCategory",
        "namespace": "com.linkedin.pegasus2avro.actionworkflow",
        "symbols": [
          "ACCESS",
          "CUSTOM"
        ]
      },
      "name": "category",
      "doc": "Top-level category of the workflow, e.g. ACCESS"
    },
    {
      "Searchable": {},
      "type": [
        "null",
        "string"
      ],
      "name": "customCategory",
      "default": null,
      "doc": "Custom category for the workflow, if applicable.\n\nThis is used to group workflows that are not part of the standard types.\nShould be provided when the type is CUSTOM."
    },
    {
      "type": [
        "null",
        "string"
      ],
      "name": "description",
      "default": null,
      "doc": "Description of the workflow. \nIf this is based on a Form trigger, this will be displayed to users when completing the form. "
    },
    {
      "type": {
        "type": "record",
        "name": "ActionWorkflowTrigger",
        "namespace": "com.linkedin.pegasus2avro.actionworkflow",
        "fields": [
          {
            "Searchable": {
              "fieldName": "triggerType"
            },
            "type": {
              "type": "enum",
              "symbolDocs": {
                "FORM_SUBMITTED": "The only trigger type currently supported - a workflow request form is submitted successfully. \nThis enables admins to create forms and display them on various entrypoints. \nThe form is also captured in the field \"form\" below. "
              },
              "name": "ActionWorkflowTriggerType",
              "namespace": "com.linkedin.pegasus2avro.actionworkflow",
              "symbols": [
                "FORM_SUBMITTED"
              ]
            },
            "name": "type",
            "doc": "A type of step / task / node in the Action Workflow. "
          },
          {
            "type": [
              "null",
              {
                "type": "record",
                "name": "ActionWorkflowForm",
                "namespace": "com.linkedin.pegasus2avro.actionworkflow",
                "fields": [
                  {
                    "type": {
                      "type": "array",
                      "items": {
                        "type": "record",
                        "name": "ActionWorkflowEntrypoint",
                        "namespace": "com.linkedin.pegasus2avro.actionworkflow",
                        "fields": [
                          {
                            "Searchable": {
                              "fieldName": "entrypointType"
                            },
                            "type": {
                              "type": "enum",
                              "symbolDocs": {
                                "ENTITY_PROFILE": " Visible on the entity profile page. For all valid entity types specified in the parent object. ",
                                "HOME": " Visible on the home page to all users. "
                              },
                              "name": "ActionWorkflowEntrypointType",
                              "namespace": "com.linkedin.pegasus2avro.actionworkflow",
                              "symbols": [
                                "HOME",
                                "ENTITY_PROFILE"
                              ]
                            },
                            "name": "type",
                            "doc": "The type of entry point for the action request workflow.\nThis determines where the action request workflow will be displayed."
                          },
                          {
                            "type": "string",
                            "name": "label",
                            "doc": "The label for the entry point, which is displayed to users.\nThis should be a user-friendly name that describes the action request."
                          },
                          {
                            "type": [
                              "null",
                              {
                                "type": "record",
                                "name": "Filter",
                                "namespace": "com.linkedin.pegasus2avro.metadata.query.filter",
                                "fields": [
                                  {
                                    "type": [
                                      "null",
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "record",
                                          "name": "ConjunctiveCriterion",
                                          "namespace": "com.linkedin.pegasus2avro.metadata.query.filter",
                                          "fields": [
                                            {
                                              "type": {
                                                "type": "array",
                                                "items": {
                                                  "type": "record",
                                                  "name": "Criterion",
                                                  "namespace": "com.linkedin.pegasus2avro.metadata.query.filter",
                                                  "fields": [
                                                    {
                                                      "type": "string",
                                                      "name": "field",
                                                      "doc": "The name of the field that the criterion refers to"
                                                    },
                                                    {
                                                      "type": "string",
                                                      "name": "value",
                                                      "doc": "The value of the intended field"
                                                    },
                                                    {
                                                      "type": {
                                                        "type": "array",
                                                        "items": "string"
                                                      },
                                                      "name": "values",
                                                      "default": [],
                                                      "doc": "Values. one of which the intended field should match\nNote, if values is set, the above \"value\" field will be ignored"
                                                    },
                                                    {
                                                      "type": {
                                                        "type": "enum",
                                                        "symbolDocs": {
                                                          "ANCESTORS_INCL": "Represent the relation: URN field matches any nested parent in addition to the given URN",
                                                          "BETWEEN": "Represent the relation within an inclusive range, e.g. 3 <= ownerCount <= 5. Note that the values in Criterion must have two entries for a lower and upper bound.",
                                                          "CONTAIN": "Represent the relation: String field contains value, e.g. name contains Profile",
                                                          "DESCENDANTS_INCL": "Represent the relation: URN field any nested children in addition to the given URN",
                                                          "END_WITH": "Represent the relation: String field ends with value, e.g. name ends with Event",
                                                          "EQUAL": "Represent the relation: field = value, e.g. platform = hdfs",
                                                          "EXISTS": "Represents the relation: field exists and is non-empty, e.g. owners is not null and != [] (empty)",
                                                          "GREATER_THAN": "Represent the relation greater than, e.g. ownerCount > 5",
                                                          "GREATER_THAN_OR_EQUAL_TO": "Represent the relation greater than or equal to, e.g. ownerCount >= 5",
                                                          "IEQUAL": "Represent the relation: field = value and support case insensitive values, e.g. platform = hdfs",
                                                          "IN": "Represent the relation: String field is one of the array values to, e.g. name in [\"Profile\", \"Event\"]",
                                                          "IS_NULL": "Represent the relation: field is null, e.g. platform is null",
                                                          "LESS_THAN": "Represent the relation less than, e.g. ownerCount < 3",
                                                          "LESS_THAN_OR_EQUAL_TO": "Represent the relation less than or equal to, e.g. ownerCount <= 3",
                                                          "RELATED_INCL": "Represent the relation: URN field matches any nested child or parent in addition to the given URN",
                                                          "START_WITH": "Represent the relation: String field starts with value, e.g. name starts with PageView"
                                                        },
                                                        "name": "Condition",
                                                        "namespace": "com.linkedin.pegasus2avro.metadata.query.filter",
                                                        "symbols": [
                                                          "CONTAIN",
                                                          "END_WITH",
                                                          "EQUAL",
                                                          "IEQUAL",
                                                          "IS_NULL",
                                                          "EXISTS",
                                                          "GREATER_THAN",
                                                          "GREATER_THAN_OR_EQUAL_TO",
                                                          "IN",
                                                          "LESS_THAN",
                                                          "LESS_THAN_OR_EQUAL_TO",
                                                          "BETWEEN",
                                                          "START_WITH",
                                                          "DESCENDANTS_INCL",
                                                          "ANCESTORS_INCL",
                                                          "RELATED_INCL"
                                                        ],
                                                        "doc": "The matching condition in a filter criterion"
                                                      },
                                                      "name": "condition",
                                                      "default": "EQUAL",
                                                      "doc": "The condition for the criterion, e.g. EQUAL, START_WITH"
                                                    },
                                                    {
                                                      "type": "boolean",
                                                      "name": "negated",
                                                      "default": false,
                                                      "doc": "Whether the condition should be negated"
                                                    }
                                                  ],
                                                  "doc": "A criterion for matching a field with given value"
                                                }
                                              },
                                              "name": "and",
                                              "doc": "A list of and criteria the filter applies to the query"
                                            }
                                          ],
                                          "doc": "A list of criterion and'd together."
                                        }
                                      }
                                    ],
                                    "name": "or",
                                    "default": null,
                                    "doc": "A list of disjunctive criterion for the filter. (or operation to combine filters)"
                                  },
                                  {
                                    "type": [
                                      "null",
                                      {
                                        "type": "array",
                                        "items": "com.linkedin.pegasus2avro.metadata.query.filter.Criterion"
                                      }
                                    ],
                                    "name": "criteria",
                                    "default": null,
                                    "doc": "Deprecated! A list of conjunctive criterion for the filter. If \"or\" field is provided, then this field is ignored."
                                  }
                                ],
                                "doc": "The filter for finding a record or a collection of records"
                              }
                            ],
                            "name": "filter",
                            "default": null,
                            "doc": "Additional filter criteria to determine when the entry point should be displayed.\n\nNot yet supported (but will be in the future)."
                          }
                        ],
                        "doc": "The entry point arguments for the action request workflowform.\nIn the future, we may extend this model to support more granular entry point filters."
                      }
                    },
                    "name": "entrypoints",
                    "doc": "Entrypoints for form submission."
                  },
                  {
                    "Searchable": {
                      "/*": {
                        "fieldName": "entityTypes",
                        "fieldType": "URN"
                      }
                    },
                    "type": [
                      "null",
                      {
                        "type": "array",
                        "items": "string"
                      }
                    ],
                    "name": "entityTypes",
                    "default": null,
                    "doc": "The valid entity type URNs that can be associated with a Workflow Form.\nIf provided, this will require that an entity of one of the provided types is specified when completing the form.\n\nIf no entity types are provided, the workflow form can be submitted without specifying an entity. In general, this should\nbe populated for workflows of type ACCESS to enable users to request access to a specific entity!\n\nIf specified, the associated action requests for this workflow will contain an URN of the corresponding type inside of\nthe `resource` field.\n\nNote that associating multiple entities with a single Action Request is not yet supported.",
                    "Urn": "Urn",
                    "urn_is_array": true
                  },
                  {
                    "type": {
                      "type": "array",
                      "items": {
                        "type": "record",
                        "name": "ActionWorkflowField",
                        "namespace": "com.linkedin.pegasus2avro.actionworkflow",
                        "fields": [
                          {
                            "type": "string",
                            "name": "id",
                            "doc": "Workflow-local id for the field"
                          },
                          {
                            "type": "string",
                            "name": "name",
                            "doc": "The display name or label for the field, for rendering"
                          },
                          {
                            "type": [
                              "null",
                              "string"
                            ],
                            "name": "description",
                            "default": null,
                            "doc": "The description for the field, for rendering"
                          },
                          {
                            "java": {
                              "class": "com.linkedin.pegasus2avro.common.urn.Urn"
                            },
                            "type": "string",
                            "name": "valueType",
                            "doc": "The urn of the value type for the values - reused from structured properties.\nAlso, used for rendering",
                            "Urn": "Urn"
                          },
                          {
                            "type": [
                              "null",
                              {
                                "type": "array",
                                "items": "string"
                              }
                            ],
                            "name": "allowedEntityTypes",
                            "default": null,
                            "doc": "The urns for allowed entity types.",
                            "Urn": "Urn",
                            "urn_is_array": true
                          },
                          {
                            "type": [
                              "null",
                              {
                                "type": "array",
                                "items": {
                                  "type": "record",
                                  "name": "PropertyValue",
                                  "namespace": "com.linkedin.pegasus2avro.structured",
                                  "fields": [
                                    {
                                      "type": [
                                        "string",
                                        "double"
                                      ],
                                      "name": "value"
                                    },
                                    {
                                      "type": [
                                        "null",
                                        "string"
                                      ],
                                      "name": "description",
                                      "default": null,
                                      "doc": "Optional description of the property value"
                                    }
                                  ]
                                }
                              }
                            ],
                            "name": "allowedValues",
                            "default": null,
                            "doc": "A list of allowed values that the property is allowed to take.\nIf this is not specified, then the property can take any value of given type."
                          },
                          {
                            "type": {
                              "type": "enum",
                              "name": "PropertyCardinality",
                              "namespace": "com.linkedin.pegasus2avro.structured",
                              "symbols": [
                                "SINGLE",
                                "MULTIPLE"
                              ]
                            },
                            "name": "cardinality",
                            "doc": "Whether or not multiple values are allowed."
                          },
                          {
                            "type": "boolean",
                            "name": "required",
                            "default": false,
                            "doc": "Whether the field is required or not."
                          },
                          {
                            "type": [
                              "null",
                              {
                                "type": "record",
                                "name": "ActionWorkflowFieldCondition",
                                "namespace": "com.linkedin.pegasus2avro.actionworkflow",
                                "fields": [
                                  {
                                    "type": {
                                      "type": "enum",
                                      "symbolDocs": {
                                        "SINGLE_FIELD_VALUE": "The field should be shown if the value of a previously completed field matches the specified value."
                                      },
                                      "name": "ActionWorkflowFieldConditionType",
                                      "namespace": "com.linkedin.pegasus2avro.actionworkflow",
                                      "symbols": [
                                        "SINGLE_FIELD_VALUE"
                                      ]
                                    },
                                    "name": "type",
                                    "doc": "The type of field condition"
                                  },
                                  {
                                    "type": [
                                      "null",
                                      {
                                        "type": "record",
                                        "name": "ActionWorkflowSingleFieldValueCondition",
                                        "namespace": "com.linkedin.pegasus2avro.actionworkflow",
                                        "fields": [
                                          {
                                            "type": "string",
                                            "name": "field",
                                            "doc": "The id / name of the field that the criterion refers to"
                                          },
                                          {
                                            "type": {
                                              "type": "array",
                                              "items": "string"
                                            },
                                            "name": "values",
                                            "default": [],
                                            "doc": "Values. one of which the intended field should match\nNote, if values is set, the above \"value\" field will be ignored"
                                          },
                                          {
                                            "type": "com.linkedin.pegasus2avro.metadata.query.filter.Condition",
                                            "name": "condition",
                                            "default": "EQUAL",
                                            "doc": "The condition for the criterion, e.g. EQUAL, START_WITH"
                                          },
                                          {
                                            "type": "boolean",
                                            "name": "negated",
                                            "default": false,
                                            "doc": "Whether the condition should be negated"
                                          }
                                        ],
                                        "doc": "A specific type of field condition that checks whether a field should be shown based on the value of a previously completed field."
                                      }
                                    ],
                                    "name": "singleFieldValueCondition",
                                    "default": null,
                                    "doc": "A field value condition. Present if type is FIELD_VALUE."
                                  }
                                ],
                                "doc": "A condition that determines whether a form field should be shown in the action workflow.\nThis may evolve in the future to have additional condition types."
                              }
                            ],
                            "name": "condition",
                            "default": null,
                            "doc": "A dynamic condition that determines whether the field should be shown or not."
                          }
                        ],
                        "doc": "A field inside an Action Workflow Form."
                      }
                    },
                    "name": "fields",
                    "doc": "Fields comprising the workflow request. These are the inputs / arguments required to trigger the workflow."
                  }
                ]
              }
            ],
            "name": "form",
            "default": null,
            "doc": "The form definition that will trigger the action workflow when submitted. "
          }
        ],
        "doc": "Defines the conditions on which the action workflow is triggered. \n\nCurrently we have only one trigger type, but we expect this to extend e.g. in the case that change events, proposals,\nor other actions can trigger workflows. \n\nCurrently, the workflow must have exactly 1 trigger condition. We don't expect this to change. "
      },
      "name": "trigger",
      "doc": "The action or event that triggers the workflow. This MUST be stored here, because there is no other\nplace to capture dynamic form state like this. "
    },
    {
      "type": {
        "type": "array",
        "items": {
          "type": "record",
          "name": "ActionWorkflowStep",
          "namespace": "com.linkedin.pegasus2avro.actionworkflow",
          "fields": [
            {
              "type": "string",
              "name": "id",
              "doc": "A unique identifier for this step within the workflow.\nThis ID must be unique within the workflow and is used to match values during workflow execution."
            },
            {
              "type": {
                "type": "enum",
                "symbolDocs": {
                  "APPROVAL": "The only step type currently supported - a human review step. \nThis step type requires that an assigned user reviews an action request associated with this workflow. \nreviews the request, approving or denying it (currently the actions supported, may extend later). "
                },
                "name": "ActionWorkflowStepType",
                "namespace": "com.linkedin.pegasus2avro.actionworkflow",
                "symbols": [
                  "APPROVAL"
                ]
              },
              "name": "type",
              "doc": "A type of step / task / node in the Action Workflow. "
            },
            {
              "type": [
                "null",
                "string"
              ],
              "name": "description",
              "default": null,
              "doc": "Optional description shown alongside the step to explain its purpose."
            },
            {
              "type": [
                "null",
                {
                  "type": "record",
                  "name": "ActionWorkflowStepActors",
                  "namespace": "com.linkedin.pegasus2avro.actionworkflow",
                  "fields": [
                    {
                      "type": {
                        "type": "array",
                        "items": "string"
                      },
                      "name": "users",
                      "doc": "Users statically assigned to perform the review step.",
                      "Urn": "Urn",
                      "urn_is_array": true
                    },
                    {
                      "type": {
                        "type": "array",
                        "items": "string"
                      },
                      "name": "groups",
                      "doc": "Groups statically assigned to perform the review step.",
                      "Urn": "Urn",
                      "urn_is_array": true
                    },
                    {
                      "type": {
                        "type": "array",
                        "items": "string"
                      },
                      "name": "roles",
                      "doc": "Roles statically assigned to perform the review step.",
                      "Urn": "Urn",
                      "urn_is_array": true
                    },
                    {
                      "type": [
                        "null",
                        {
                          "type": "record",
                          "name": "ActionWorkflowStepDynamicAssignment",
                          "namespace": "com.linkedin.pegasus2avro.actionworkflow",
                          "fields": [
                            {
                              "type": {
                                "type": "enum",
                                "symbolDocs": {
                                  "ENTITY_DATA_PRODUCT_OWNERS": "Assign the entity data product owners.",
                                  "ENTITY_DOMAIN_OWNERS": "Assign the entity domain owners.",
                                  "ENTITY_OWNERS": "Assign the entity owners."
                                },
                                "name": "ActionWorkflowStepDynamicAssignmentType",
                                "namespace": "com.linkedin.pegasus2avro.actionworkflow",
                                "symbols": [
                                  "ENTITY_OWNERS",
                                  "ENTITY_DOMAIN_OWNERS",
                                  "ENTITY_DATA_PRODUCT_OWNERS"
                                ]
                              },
                              "name": "type",
                              "doc": "A standardized policy for resolving actors dynamically for an access request."
                            },
                            {
                              "type": [
                                "null",
                                {
                                  "type": "array",
                                  "items": "string"
                                }
                              ],
                              "name": "ownershipTypeUrns",
                              "default": null,
                              "doc": "Optional: A well defined set of ownership type urns to including in routing.",
                              "Urn": "Urn",
                              "urn_is_array": true
                            }
                          ]
                        }
                      ],
                      "name": "dynamicAssignment",
                      "default": null,
                      "doc": "Dynamic assignment type for the review step."
                    }
                  ],
                  "doc": "A definition of the actors required to review."
                }
              ],
              "name": "actors",
              "default": null,
              "doc": "A definition of the actors required to execute the step, if there are any.\n\nFor steps of type REQUEST_REVIEW, this field MUST be provided! "
            }
          ],
          "doc": "Defines a single review step in a workflow.\n\nToday, steps are simple. They execute in sequence after the trigger event. \n\nIn the future, we may extend steps to include \"depends on steps\" to form a DAG structure across\nsteps. For now, steps execute in linear sequence after the trigger event -- however the expectation\nis that they COULD run in parallel after the trigger event without a problem in the future.\n\nIf necessary, we'll extend this to represent conditional branching nodes as a step / node in the Workflow, e.g. Conditional Step, Notification Step, Review Step\n\nToday, step state is reflected via a single entity representing the workflow instance: the ActionRequest entity.\nIn the future we'll explore modeling individual step states separately if required."
        }
      },
      "name": "steps",
      "doc": "Definition of the steps / tasks / nodes comprising the workflow definition. This is the part we can aim \nto be able to convert / transform into serialized XML BPMN Format. For now, we model it strongly here. \nIf we can successfully use BPMN for step state, we can deprecate this field in place of the XML serialization. \n\nThis is the part we'll try to build a transpiler to BPMN for execution for. Ultimately, we do need \na representation we can easily convert into the frontend framework for display. This represents the set of \nwell known workflow step types - across tasks, conditionals, notifications, etc - that are officially supported today.\n\nIf necessary, we'll extend this to represent conditional branching nodes as a step / node in the Workflow, e.g. Conditional Step, Notification Step, Review Step"
    },
    {
      "Searchable": {
        "/actor": {
          "fieldName": "createdBy",
          "fieldType": "URN"
        },
        "/time": {
          "fieldName": "createdAt",
          "fieldType": "DATETIME"
        }
      },
      "type": {
        "type": "record",
        "name": "AuditStamp",
        "namespace": "com.linkedin.pegasus2avro.common",
        "fields": [
          {
            "type": "long",
            "name": "time",
            "doc": "When did the resource/association/sub-resource move into the specific lifecycle stage represented by this AuditEvent."
          },
          {
            "java": {
              "class": "com.linkedin.pegasus2avro.common.urn.Urn"
            },
            "type": "string",
            "name": "actor",
            "doc": "The entity (e.g. a member URN) which will be credited for moving the resource/association/sub-resource into the specific lifecycle stage. It is also the one used to authorize the change.",
            "Urn": "Urn"
          },
          {
            "java": {
              "class": "com.linkedin.pegasus2avro.common.urn.Urn"
            },
            "type": [
              "null",
              "string"
            ],
            "name": "impersonator",
            "default": null,
            "doc": "The entity (e.g. a service URN) which performs the change on behalf of the Actor and must be authorized to act as the Actor.",
            "Urn": "Urn"
          },
          {
            "type": [
              "null",
              "string"
            ],
            "name": "message",
            "default": null,
            "doc": "Additional context around how DataHub was informed of the particular change. For example: was the change created by an automated process, or manually."
          }
        ],
        "doc": "Data captured on a resource/association/sub-resource level giving insight into when that resource/association/sub-resource moved into a particular lifecycle stage, and who acted to move it into that specific lifecycle stage."
      },
      "name": "created",
      "doc": "Audit stamp capturing the time and actor who created the workflow."
    },
    {
      "Searchable": {
        "/time": {
          "fieldName": "lastModifiedAt",
          "fieldType": "DATETIME"
        }
      },
      "type": "com.linkedin.pegasus2avro.common.AuditStamp",
      "name": "lastModified",
      "doc": "Audit stamp capturing the time and actor who last modified the workflow."
    }
  ],
  "doc": "The ActionWorkflowInfo record captures the metadata and configuration of a workflow.\nTODO: In the future, we may store the serialized camunda / flowable workflow instance ID inside.\nWe'll likely also need to add the \"steps\" into here since we'll need that to inform state transitions."
}