# workflowHistory

Audience: Developer

Fetch workflow history for executions matching filter criteria.

Fetch workflow history for executions matching filter criteria.
Use workflowID and runID filters for a specific execution,
or other filters for batch retrieval across related workflows.
Returns all history events (no pagination).

**Served by:** [workflow](https://docs.pyck.cloud/dev/api/services/workflow.md)

## Arguments

| Name | Type | Description |
| --- | --- | --- |
| `where` | [WorkflowExecutionsWhereInput](https://docs.pyck.cloud/dev/api/inputs/workflowexecutionswhereinput.md)! | Filter criteria for workflow executions. |
| `limit` | Int | Maximum number of executions to fetch history for. Defaults to 10, max 100. |

## Returns

[WorkflowExecutionHistoryConnection](https://docs.pyck.cloud/dev/api/types/workflowexecutionhistoryconnection.md)!

## Example

Retrieves the event history for a specific workflow execution.

```graphql
query GetWorkflowHistory($where: WorkflowExecutionsWhereInput!, $limit: Int) {
  workflowHistory(where: $where, limit: $limit) {
    totalCount
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    edges {
      cursor
      node {
        execution {
          id
          workflowId
        }
        history {
          eventId
          eventTime
          eventType
          extra
        }
        typeName
      }
    }
  }
}
```

**Variables**

```json
{
  "limit": 50,
  "where": {
    "runID": "<run ID>",
    "workflowID": "<workflow execution ID>"
  }
}
```
