{
  "type": "record",
  "Aspect": {
    "name": "dataHubTaskInfo"
  },
  "name": "DataHubTaskInfo",
  "namespace": "com.linkedin.pegasus2avro.task",
  "fields": [
    {
      "Searchable": {
        "boostScore": 10.0,
        "enableAutocomplete": true,
        "fieldNameAliases": [
          "_entityName"
        ],
        "fieldType": "WORD_GRAM"
      },
      "type": "string",
      "name": "name",
      "doc": "Display name of the task"
    },
    {
      "Searchable": {
        "fieldType": "TEXT",
        "hasValuesFieldName": "hasDescription"
      },
      "type": [
        "null",
        "string"
      ],
      "name": "description",
      "default": null,
      "doc": "Human-readable description of what this task does"
    },
    {
      "Searchable": {
        "fieldType": "KEYWORD",
        "queryByDefault": false
      },
      "type": {
        "type": "enum",
        "symbolDocs": {
          "AGENT_TASK": "An LLM agent task. Requires agentTaskDefinition on DataHubTaskInfo."
        },
        "name": "DataHubTaskType",
        "namespace": "com.linkedin.pegasus2avro.task",
        "symbols": [
          "AGENT_TASK"
        ],
        "doc": "The type of a DataHub Task, used for routing to the correct executor handler."
      },
      "name": "taskType",
      "doc": "The type of task, used for routing to the correct executor handler."
    },
    {
      "type": [
        "null",
        {
          "type": "record",
          "name": "DataHubAgentTaskDefinition",
          "namespace": "com.linkedin.pegasus2avro.task",
          "fields": [
            {
              "Relationship": {
                "entityTypes": [
                  "aiAgent"
                ],
                "name": "TaskAgent"
              },
              "Searchable": {
                "fieldName": "agentUrn",
                "fieldType": "URN",
                "queryByDefault": false
              },
              "java": {
                "class": "com.linkedin.pegasus2avro.common.urn.Urn"
              },
              "type": "string",
              "name": "agent",
              "doc": "The agent to execute this task.",
              "Urn": "Urn",
              "entityTypes": [
                "aiAgent"
              ]
            },
            {
              "type": [
                "null",
                "string"
              ],
              "name": "instructions",
              "default": null,
              "doc": "Instructions describing what the agent should accomplish when this task runs.\nInjected into the agent's prompt alongside trigger context."
            },
            {
              "type": "boolean",
              "name": "allowHumanInput",
              "default": false,
              "doc": "Whether the agent is allowed to pause execution and request\nhuman input via the ask_human_for_input tool.\nWhen false (the default), the agent runs fully autonomously."
            }
          ],
          "doc": "Agent-specific parameters for a task with taskType = AGENT_TASK.\n\nSeparated into its own record so that future task types (e.g. RUN_EVALS)\ncan have their own definition records without polluting the base task model."
        }
      ],
      "name": "agentTaskDefinition",
      "default": null,
      "doc": "Agent-specific task parameters. Required when taskType = AGENT_TASK.\nContains the agent URN and instructions for the agent."
    },
    {
      "type": {
        "type": "record",
        "name": "DataHubTaskTrigger",
        "namespace": "com.linkedin.pegasus2avro.task",
        "fields": [
          {
            "type": [
              "null",
              {
                "type": "record",
                "name": "DataHubTaskSchedule",
                "namespace": "com.linkedin.pegasus2avro.task",
                "fields": [
                  {
                    "type": "string",
                    "name": "interval",
                    "doc": "A cron-formatted execution interval, e.g. 0 1 * * * for daily at 1am"
                  },
                  {
                    "type": "string",
                    "name": "timezone",
                    "doc": "Timezone in which the cron interval applies, e.g. America/Los_Angeles or UTC"
                  }
                ],
                "doc": "A cron-based schedule for triggering task runs."
              }
            ],
            "name": "schedule",
            "default": null,
            "doc": "Cron-based schedule for periodic task execution"
          },
          {
            "type": [
              "null",
              {
                "type": "record",
                "name": "DataHubTaskEventTrigger",
                "namespace": "com.linkedin.pegasus2avro.task",
                "fields": [
                  {
                    "type": {
                      "type": "enum",
                      "symbolDocs": {
                        "TASK_RUN_COMPLETED": "Fires when a task execution request finishes (success or failure).\nUse the event filter to narrow by source task URN or result status."
                      },
                      "name": "DataHubTaskEventType",
                      "namespace": "com.linkedin.pegasus2avro.task",
                      "symbols": [
                        "TASK_RUN_COMPLETED"
                      ],
                      "doc": "Well-known event types that can trigger a DataHub Task."
                    },
                    "name": "eventType",
                    "doc": "The type of event that triggers this task."
                  },
                  {
                    "type": [
                      "null",
                      {
                        "type": "record",
                        "name": "DataHubTaskEventFilter",
                        "namespace": "com.linkedin.pegasus2avro.task",
                        "fields": [
                          {
                            "Searchable": {
                              "fieldName": "sourceTaskUrn",
                              "fieldType": "URN",
                              "queryByDefault": false
                            },
                            "java": {
                              "class": "com.linkedin.pegasus2avro.common.urn.Urn"
                            },
                            "type": [
                              "null",
                              "string"
                            ],
                            "name": "sourceTaskUrn",
                            "default": null,
                            "doc": "For task chaining: only trigger when this specific task completes.",
                            "Urn": "Urn"
                          },
                          {
                            "type": [
                              "null",
                              "string"
                            ],
                            "name": "resultStatus",
                            "default": null,
                            "doc": "Only trigger when the run finishes with this status,\ne.g. SUCCEEDED, FAILED"
                          },
                          {
                            "type": [
                              "null",
                              {
                                "type": "map",
                                "values": "string"
                              }
                            ],
                            "name": "parameters",
                            "default": null,
                            "doc": "Extensible key-value filter criteria for future event types.\nKeys and values are event-type-specific."
                          }
                        ],
                        "doc": "Filter criteria for narrowing which events trigger a task.\n\nFor task chaining (eventType = TASK_RUN_COMPLETED), use sourceTaskUrn\nto only trigger when a specific upstream task finishes, and resultStatus\nto filter on outcome (e.g. only on success)."
                      }
                    ],
                    "name": "filter",
                    "default": null,
                    "doc": "Optional filter to narrow which events of the given type actually trigger the task."
                  }
                ],
                "doc": "Configuration for event-based task triggering."
              }
            ],
            "name": "eventTrigger",
            "default": null,
            "doc": "Event-based trigger for reactive task execution (e.g. task chaining)"
          }
        ],
        "doc": "Trigger configuration for a task definition.\n\nA task may have a cron schedule, an event trigger, or both.\nAt least one must be provided for the task to be executable."
      },
      "name": "trigger",
      "doc": "How and when this task should be triggered"
    },
    {
      "Searchable": {
        "fieldType": "KEYWORD",
        "queryByDefault": false
      },
      "type": {
        "type": "enum",
        "symbolDocs": {
          "ACTIVE": "The task is scheduled and will execute when triggered.",
          "INACTIVE": "The task is retained but will not execute."
        },
        "name": "DataHubTaskState",
        "namespace": "com.linkedin.pegasus2avro.task",
        "symbols": [
          "ACTIVE",
          "INACTIVE"
        ],
        "doc": "The operational state of a task definition."
      },
      "name": "state",
      "default": "ACTIVE",
      "doc": "The operational state of this task definition.\nINACTIVE tasks are retained but not executed."
    },
    {
      "type": [
        "null",
        {
          "type": "record",
          "name": "DataHubTaskSource",
          "namespace": "com.linkedin.pegasus2avro.task",
          "fields": [
            {
              "Searchable": {
                "fieldName": "sourceType",
                "fieldType": "KEYWORD",
                "queryByDefault": false
              },
              "type": {
                "type": "enum",
                "symbolDocs": {
                  "SYSTEM": "A system-internal task, bootstrapped at deployment time."
                },
                "name": "DataHubTaskSourceType",
                "namespace": "com.linkedin.pegasus2avro.task",
                "symbols": [
                  "SYSTEM"
                ],
                "doc": "The origin type of a task definition."
              },
              "name": "type",
              "doc": "The source type of the task"
            }
          ],
          "doc": "The source or origin of a task definition."
        }
      ],
      "name": "source",
      "default": null,
      "doc": "The source or origin of the task definition.\nSystem tasks (source.type = SYSTEM) are bootstrapped at deployment time."
    },
    {
      "Relationship": {
        "entityTypes": [
          "corpuser"
        ],
        "name": "TaskRunAs"
      },
      "Searchable": {
        "fieldType": "URN",
        "queryByDefault": false
      },
      "java": {
        "class": "com.linkedin.pegasus2avro.common.urn.Urn"
      },
      "type": [
        "null",
        "string"
      ],
      "name": "runAs",
      "default": null,
      "doc": "The identity (corpuser or corpGroup URN) under which this task's\nexecution requests are created. Determines the permissions context\nfor the agent during execution.\n\nIf not explicitly set, defaults to the user who created the task\n(i.e. the actor in the 'created' AuditStamp). This ensures that\nscheduled and event-triggered runs execute with a predictable,\nstable identity rather than depending on whoever happens to trigger them.\n\nTo set this to a service account other than yourself, the caller\nmust hold the MANAGE_SERVICE_ACCOUNTS platform privilege.",
      "Urn": "Urn",
      "entityTypes": [
        "corpuser"
      ]
    },
    {
      "Searchable": {
        "/time": {
          "fieldName": "createdAt",
          "fieldType": "DATETIME",
          "queryByDefault": false
        }
      },
      "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": "When this task was created"
    },
    {
      "Searchable": {
        "/time": {
          "fieldName": "lastModifiedAt",
          "fieldType": "DATETIME",
          "queryByDefault": false
        }
      },
      "type": "com.linkedin.pegasus2avro.common.AuditStamp",
      "name": "lastModified",
      "doc": "When this task was last modified"
    }
  ],
  "doc": "Configuration and metadata for a DataHub Task definition.\n\nTasks are scheduled or event-triggered units of work. The taskType enum\nroutes each task to the correct executor handler:\n\n  - AGENT_TASK: an LLM agent task. Requires agentTaskDefinition.\n\nTasks can be triggered by cron schedule, events (e.g. task chaining), or both."
}