> For the complete documentation index, see [llms.txt](https://docs.pyck.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pyck.cloud/graphql-api/types/workflowexecutionhistory.md).

# WorkflowExecutionHistory

WorkflowExecutionHistory Type - Workflow execution with history events

Audience: Programmer

Represents a workflow execution with its complete history events. This type is returned by the `workflowHistory` query and provides access to all events that occurred during a workflow execution.

This type was introduced to support the separation of execution metadata from history data, enabling better performance when listing workflow executions.

## Fields

| Field       | Type                 | Description                                                       |
| ----------- | -------------------- | ----------------------------------------------------------------- |
| `execution` | `WorkflowExecution!` | The workflow execution identifier containing workflowId and runId |
| `typeName`  | `String!`            | The name of the workflow type                                     |
| `history`   | `[WorkflowEvent!]!`  | Complete list of history events for this execution                |

## Related Types

### WorkflowExecution

| Field        | Type      | Description                            |
| ------------ | --------- | -------------------------------------- |
| `workflowId` | `String!` | The unique workflow identifier         |
| `id`         | `String!` | The run ID for this specific execution |

### WorkflowEvent

| Field       | Type      | Description                                            |
| ----------- | --------- | ------------------------------------------------------ |
| `eventId`   | `Int!`    | Sequential event identifier                            |
| `eventTime` | `String!` | ISO 8601 timestamp when the event occurred             |
| `eventType` | `String!` | Type of the event (e.g., WORKFLOW\_EXECUTION\_STARTED) |
| `extra`     | `Map`     | Event-specific attributes and details                  |

## Service

This type is defined in the **Workflow** service.

## Usage Example

### Query Workflow History

```graphql
query {
  workflowHistory(
    where: {
      workflowID: "picking-order-12345"
    }
  ) {
    edges {
      node {
        execution {
          workflowId
          id
        }
        typeName
        history {
          eventId
          eventTime
          eventType
          extra
        }
      }
    }
  }
}
```

### Example Response

```json
{
  "data": {
    "workflowHistory": {
      "edges": [
        {
          "node": {
            "execution": {
              "workflowId": "picking-order-12345",
              "id": "run-abc-123"
            },
            "typeName": "PickingWorkflow",
            "history": [
              {
                "eventId": 1,
                "eventTime": "2024-01-15T10:30:00Z",
                "eventType": "EVENT_TYPE_WORKFLOW_EXECUTION_STARTED",
                "extra": {
                  "workflowType": {
                    "name": "PickingWorkflow"
                  },
                  "taskQueue": {
                    "name": "picking-queue"
                  }
                }
              },
              {
                "eventId": 2,
                "eventTime": "2024-01-15T10:30:01Z",
                "eventType": "EVENT_TYPE_WORKFLOW_TASK_SCHEDULED",
                "extra": {}
              },
              {
                "eventId": 3,
                "eventTime": "2024-01-15T10:30:01Z",
                "eventType": "EVENT_TYPE_WORKFLOW_TASK_STARTED",
                "extra": {}
              }
            ]
          }
        }
      ]
    }
  }
}
```

## Notes

* This type is used exclusively for history retrieval via the `workflowHistory` query
* History events are returned in chronological order by eventId
* The `extra` field contains event-specific data that varies by event type
* For execution metadata without history, use `WorkflowExecutionInfo` via the `workflowExecutions` query

## Related Documentation

* [workflowHistory Query](/graphql-api/queries/workflowhistory.md) - Query to fetch workflow history
* [WorkflowExecutionHistoryConnection](/graphql-api/types/workflowexecutionhistoryconnection.md) - Connection type for paginated results
* [WorkflowEvent](/graphql-api/types/workflowevent.md) - Individual history event type
* [WorkflowExecutionInfo](/graphql-api/types/workflowexecutioninfo.md) - Execution metadata type (without history)
* [workflowExecutions Query](/graphql-api/queries/workflowexecutions.md) - Query for execution metadata


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pyck.cloud/graphql-api/types/workflowexecutionhistory.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
