> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thena.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get workflow executions

> MCP tool to retrieve executions/instances of a specific workflow from the Thena platform.

import Admonition from '@theme/Admonition';

### MCP tool: `get_workflow_executions`

Retrieves all executions/instances of a specific workflow with optional filtering by status and date range. This tool provides detailed information about workflow execution history and current status.

<Admonition type="note">
  You must provide the workflow ID. Optional filters include version, status, and date range for more targeted results.
</Admonition>

### Example prompt

```prompt theme={null}
Get all executions for workflow "ticket-escalation-workflow" with status "COMPLETED"
```

<Admonition type="info">
  When you use this prompt in a chat with the model (with the MCP tool registered), the model will automatically call the <code>get\_workflow\_executions</code> tool with the correct arguments.
</Admonition>

### Input parameters

| Name       | Type   | Required | Description                                                   |
| ---------- | ------ | -------- | ------------------------------------------------------------- |
| workflowId | string | Yes      | The unique identifier of the workflow                         |
| version    | number | No       | The version of the workflow                                   |
| status     | string | No       | The status of the workflow execution                          |
| from       | string | No       | The start date from which to fetch executions (in ISO format) |
| to         | string | No       | The end date to which to fetch executions (in ISO format)     |

### Response fields

Below are the fields you may see in each workflow execution object in the response:

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr><td>id</td><td>string</td><td>The identifier of the workflow instance</td></tr>
    <tr><td>workflowId</td><td>string</td><td>The identifier of the workflow</td></tr>
    <tr><td>version</td><td>number</td><td>The version of the workflow</td></tr>
    <tr><td>status</td><td>string</td><td>The status of the workflow instance</td></tr>
    <tr><td>context</td><td>object</td><td>The context of the workflow instance</td></tr>
    <tr><td>startedAt</td><td>string (ISO8601)</td><td>The start date of the workflow instance</td></tr>
    <tr><td>lastUpdatedAt</td><td>string (ISO8601)</td><td>The last updated date of the workflow instance</td></tr>
  </tbody>
</table>

### Sample response

```json theme={null}
{
  "data": [
    {
      "id": "EXECUTION001",
      "workflowId": "ticket-escalation-workflow",
      "version": 1,
      "status": "COMPLETED",
      "context": {
        "ticketId": "TICKET123",
        "priority": "high",
        "team": "support",
        "triggeredBy": "ticket.created",
        "executionId": "EXECUTION001"
      },
      "startedAt": "2025-07-24T10:00:00.000Z",
      "lastUpdatedAt": "2025-07-24T10:05:30.000Z"
    },
    {
      "id": "EXECUTION002",
      "workflowId": "ticket-escalation-workflow",
      "version": 1,
      "status": "RUNNING",
      "context": {
        "ticketId": "TICKET124",
        "priority": "high",
        "team": "support",
        "triggeredBy": "ticket.created",
        "executionId": "EXECUTION002",
        "currentStep": 2,
        "stepStatus": "IN_PROGRESS"
      },
      "startedAt": "2025-07-24T11:15:00.000Z",
      "lastUpdatedAt": "2025-07-24T11:16:45.000Z"
    },
    {
      "id": "EXECUTION003",
      "workflowId": "ticket-escalation-workflow",
      "version": 1,
      "status": "FAILED",
      "context": {
        "ticketId": "TICKET125",
        "priority": "high",
        "team": "support",
        "triggeredBy": "ticket.created",
        "executionId": "EXECUTION003",
        "error": "Activity assignment.activity failed after 3 retry attempts",
        "failedStep": 2,
        "errorDetails": {
          "code": "ACTIVITY_FAILURE",
          "message": "No available agents with required skills",
          "timestamp": "2025-07-24T09:30:15.000Z"
        }
      },
      "startedAt": "2025-07-24T09:25:00.000Z",
      "lastUpdatedAt": "2025-07-24T09:30:15.000Z"
    }
  ],
  "status": true,
  "message": "Workflow executions retrieved successfully!",
  "timestamp": "2025-07-25T12:50:38.937Z"
}
```

<Admonition type="tip">
  Always pass an object as input, even if empty, to avoid errors when calling the tool directly.
</Admonition>

***
