{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cisco-crosswork/json-schema/cisco-crosswork-history-history-event-schema.json",
  "title": "history.HistoryEvent",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cisco-crosswork-jobs-api-openapi.yml#/components/schemas/history.HistoryEvent",
  "type": "object",
  "properties": {
    "attributes": {
      "description": "The event details. The type must match that in `event_type`.\n\nTypes that are valid to be assigned to Attributes:\n\n\t*HistoryEvent_WorkflowExecutionStartedEventAttributes\n\t*HistoryEvent_WorkflowExecutionCompletedEventAttributes\n\t*HistoryEvent_WorkflowExecutionFailedEventAttributes\n\t*HistoryEvent_WorkflowExecutionTimedOutEventAttributes\n\t*HistoryEvent_WorkflowTaskScheduledEventAttributes\n\t*HistoryEvent_WorkflowTaskStartedEventAttributes\n\t*HistoryEvent_WorkflowTaskCompletedEventAttributes\n\t*HistoryEvent_WorkflowTaskTimedOutEventAttributes\n\t*HistoryEvent_WorkflowTaskFailedEventAttributes\n\t*HistoryEvent_ActivityTaskScheduledEventAttributes\n\t*HistoryEvent_ActivityTaskStartedEventAttributes\n\t*HistoryEvent_ActivityTaskCompletedEventAttributes\n\t*HistoryEvent_ActivityTaskFailedEventAttributes\n\t*HistoryEvent_ActivityTaskTimedOutEventAttributes\n\t*HistoryEvent_TimerStartedEventAttributes\n\t*HistoryEvent_TimerFiredEventAttributes\n\t*HistoryEvent_ActivityTaskCancelRequestedEventAttributes\n\t*HistoryEvent_ActivityTaskCanceledEventAttributes\n\t*HistoryEvent_TimerCanceledEventAttributes\n\t*HistoryEvent_MarkerRecordedEventAttributes\n\t*HistoryEvent_WorkflowExecutionSignaledEventAttributes\n\t*HistoryEvent_WorkflowExecutionTerminatedEventAttributes\n\t*HistoryEvent_WorkflowExecutionCancelRequestedEventAttributes\n\t*HistoryEvent_WorkflowExecutionCanceledEventAttributes\n\t*HistoryEvent_RequestCancelExternalWorkflowExecutionInitiatedEventAttributes\n\t*HistoryEvent_RequestCancelExternalWorkflowExecutionFailedEventAttributes\n\t*HistoryEvent_ExternalWorkflowExecutionCancelRequestedEventAttributes\n\t*HistoryEvent_WorkflowExecutionContinuedAsNewEventAttributes\n\t*HistoryEvent_StartChildWorkflowExecutionInitiatedEventAttributes\n\t*HistoryEvent_StartChildWorkflowExecutionFailedEventAttributes\n\t*HistoryEvent_ChildWorkflowExecutionStartedEventAttributes\n\t*HistoryEvent_ChildWorkflowExecutionCompletedEventAttributes\n\t*HistoryEvent_ChildWorkflowExecutionFailedEventAttributes\n\t*HistoryEvent_ChildWorkflowExecutionCanceledEventAttributes\n\t*HistoryEvent_ChildWorkflowExecutionTimedOutEventAttributes\n\t*HistoryEvent_ChildWorkflowExecutionTerminatedEventAttributes\n\t*HistoryEvent_SignalExternalWorkflowExecutionInitiatedEventAttributes\n\t*HistoryEvent_SignalExternalWorkflowExecutionFailedEventAttributes\n\t*HistoryEvent_ExternalWorkflowExecutionSignaledEventAttributes\n\t*HistoryEvent_UpsertWorkflowSearchAttributesEventAttributes\n\t*HistoryEvent_WorkflowExecutionUpdateAcceptedEventAttributes\n\t*HistoryEvent_WorkflowExecutionUpdateRejectedEventAttributes\n\t*HistoryEvent_WorkflowExecutionUpdateCompletedEventAttributes\n\t*HistoryEvent_WorkflowPropertiesModifiedExternallyEventAttributes\n\t*HistoryEvent_ActivityPropertiesModifiedExternallyEventAttributes\n\t*HistoryEvent_WorkflowPropertiesModifiedEventAttributes\n\t*HistoryEvent_WorkflowExecutionUpdateAdmittedEventAttributes\n\t*HistoryEvent_NexusOperationScheduledEventAttributes\n\t*HistoryEvent_NexusOperationStartedEventAttributes\n\t*HistoryEvent_NexusOperationCompletedEventAttributes\n\t*HistoryEvent_NexusOperationFailedEventAttributes\n\t*HistoryEvent_NexusOperationCanceledEventAttributes\n\t*HistoryEvent_NexusOperationTimedOutEventAttributes\n\t*HistoryEvent_NexusOperationCancelRequestedEventAttributes\n\t*HistoryEvent_WorkflowExecutionOptionsUpdatedEventAttributes\n\t*HistoryEvent_NexusOperationCancelRequestCompletedEventAttributes\n\t*HistoryEvent_NexusOperationCancelRequestFailedEventAttributes"
    },
    "event_id": {
      "description": "Monotonically increasing event number, starts at 1.",
      "type": "integer"
    },
    "event_time": {
      "$ref": "#/$defs/timestamppb.Timestamp"
    },
    "event_type": {
      "$ref": "#/$defs/enums.EventType"
    },
    "links": {
      "description": "Links associated with the event.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/common.Link"
      }
    },
    "task_id": {
      "description": "TODO: What is this? Appears unused by SDKs",
      "type": "integer"
    },
    "user_metadata": {
      "$ref": "#/$defs/sdk.UserMetadata"
    },
    "version": {
      "description": "TODO: What is this? Appears unused by SDKs",
      "type": "integer"
    },
    "worker_may_ignore": {
      "description": "Set to true when the SDK may ignore the event as it does not impact workflow state or\ninformation in any way that the SDK need be concerned with. If an SDK encounters an event\ntype which it does not understand, it must error unless this is true. If it is true, it's\nacceptable for the event type and/or attributes to be uninterpretable.",
      "type": "boolean"
    }
  },
  "$defs": {
    "common.Link": {
      "type": "object",
      "properties": {
        "variant": {
          "description": "Types that are valid to be assigned to Variant:\n\n\t*Link_WorkflowEvent_\n\t*Link_BatchJob_"
        }
      }
    },
    "common.Payload": {
      "type": "object",
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        }
      },
      "description": "Alternative way to supply `message` and `stack_trace` and possibly other attributes, used for encryption of\nerrors originating in user code which might contain sensitive information.\nThe `encoded_attributes` Payload could represent any serializable object, e.g. JSON object or a `Failure` proto\nmessage.\n\nSDK authors:\n- The SDK should provide a default `encodeFailureAttributes` and `decodeFailureAttributes` implementation that:\n  - Uses a JSON object to represent `{ message, stack_trace }`.\n  - Overwrites the original message with \"Encoded failure\" to indicate that more information could be extracted.\n  - Overwrites the original stack_trace with an empty string.\n  - The resulting JSON object is converted to Payload using the default PayloadConverter and should be processed\n    by the user-provided PayloadCodec\n\n- If there's demand, we could allow overriding the default SDK implementation to encode other opaque Failure attributes.\n(-- api-linter: core::0203::optional=disabled --)"
    },
    "enums.EventType": {
      "type": "integer",
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13,
        14,
        15,
        16,
        17,
        18,
        19,
        20,
        21,
        22,
        23,
        24,
        25,
        26,
        27,
        28,
        29,
        30,
        31,
        32,
        33,
        34,
        35,
        36,
        37,
        38,
        39,
        40,
        47,
        41,
        42,
        43,
        44,
        45,
        46,
        48,
        49,
        50,
        51,
        52,
        53,
        54,
        55,
        56,
        57
      ],
      "x-enum-varnames": [
        "EVENT_TYPE_UNSPECIFIED",
        "EVENT_TYPE_WORKFLOW_EXECUTION_STARTED",
        "EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED",
        "EVENT_TYPE_WORKFLOW_EXECUTION_FAILED",
        "EVENT_TYPE_WORKFLOW_EXECUTION_TIMED_OUT",
        "EVENT_TYPE_WORKFLOW_TASK_SCHEDULED",
        "EVENT_TYPE_WORKFLOW_TASK_STARTED",
        "EVENT_TYPE_WORKFLOW_TASK_COMPLETED",
        "EVENT_TYPE_WORKFLOW_TASK_TIMED_OUT",
        "EVENT_TYPE_WORKFLOW_TASK_FAILED",
        "EVENT_TYPE_ACTIVITY_TASK_SCHEDULED",
        "EVENT_TYPE_ACTIVITY_TASK_STARTED",
        "EVENT_TYPE_ACTIVITY_TASK_COMPLETED",
        "EVENT_TYPE_ACTIVITY_TASK_FAILED",
        "EVENT_TYPE_ACTIVITY_TASK_TIMED_OUT",
        "EVENT_TYPE_ACTIVITY_TASK_CANCEL_REQUESTED",
        "EVENT_TYPE_ACTIVITY_TASK_CANCELED",
        "EVENT_TYPE_TIMER_STARTED",
        "EVENT_TYPE_TIMER_FIRED",
        "EVENT_TYPE_TIMER_CANCELED",
        "EVENT_TYPE_WORKFLOW_EXECUTION_CANCEL_REQUESTED",
        "EVENT_TYPE_WORKFLOW_EXECUTION_CANCELED",
        "EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED",
        "EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED",
        "EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_CANCEL_REQUESTED",
        "EVENT_TYPE_MARKER_RECORDED",
        "EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED",
        "EVENT_TYPE_WORKFLOW_EXECUTION_TERMINATED",
        "EVENT_TYPE_WORKFLOW_EXECUTION_CONTINUED_AS_NEW",
        "EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_INITIATED",
        "EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_FAILED",
        "EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_STARTED",
        "EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_COMPLETED",
        "EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_FAILED",
        "EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_CANCELED",
        "EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TIMED_OUT",
        "EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TERMINATED",
        "EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED",
        "EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED",
        "EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_SIGNALED",
        "EVENT_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES",
        "EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ADMITTED",
        "EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ACCEPTED",
        "EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_REJECTED",
        "EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_COMPLETED",
        "EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED_EXTERNALLY",
        "EVENT_TYPE_ACTIVITY_PROPERTIES_MODIFIED_EXTERNALLY",
        "EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED",
        "EVENT_TYPE_NEXUS_OPERATION_SCHEDULED",
        "EVENT_TYPE_NEXUS_OPERATION_STARTED",
        "EVENT_TYPE_NEXUS_OPERATION_COMPLETED",
        "EVENT_TYPE_NEXUS_OPERATION_FAILED",
        "EVENT_TYPE_NEXUS_OPERATION_CANCELED",
        "EVENT_TYPE_NEXUS_OPERATION_TIMED_OUT",
        "EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUESTED",
        "EVENT_TYPE_WORKFLOW_EXECUTION_OPTIONS_UPDATED",
        "EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_COMPLETED",
        "EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_FAILED"
      ],
      "description": "The event type of the history event generated by the request."
    },
    "sdk.UserMetadata": {
      "type": "object",
      "properties": {
        "details": {
          "$ref": "#/$defs/common.Payload"
        },
        "summary": {
          "$ref": "#/$defs/common.Payload"
        }
      },
      "description": "Metadata on the event. This is often carried over from commands and client calls. Most events\nwon't have this information, and how this information is used is dependent upon the interface\nthat reads it.\n\nCurrent well-known uses:\n  - workflow_execution_started_event_attributes - summary and details from start workflow.\n  - timer_started_event_attributes - summary represents an identifier for the timer for use by\n    user interfaces."
    },
    "timestamppb.Timestamp": {
      "type": "object",
      "properties": {
        "nanos": {
          "description": "Non-negative fractions of a second at nanosecond resolution. Negative\nsecond values with fractions must still have non-negative nanos values\nthat count forward in time. Must be from 0 to 999,999,999\ninclusive.",
          "type": "integer"
        },
        "seconds": {
          "description": "Represents seconds of UTC time since Unix epoch\n1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n9999-12-31T23:59:59Z inclusive.",
          "type": "integer"
        }
      },
      "description": "original_scheduled_time is the scheduled time of the first workflow task during workflow task heartbeat.\nHeartbeat workflow task is done by RespondWorkflowTaskComplete with ForceCreateNewWorkflowTask == true and no command\nIn this case, OriginalScheduledTime won't change. Then when current time - original_scheduled_time exceeds\nsome threshold, the workflow task will be forced timeout."
    }
  }
}