> ## 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 all workflows

> MCP tool to retrieve a paginated list of all workflows in the Thena platform.

import Admonition from '@theme/Admonition';

### MCP tool: `get_all_workflows`

Retrieves a paginated list of all workflows defined by the organization. This tool supports filtering by team, type, and sub-types, along with pagination for efficient data retrieval.

<Admonition type="note">
  This tool supports pagination and optional filtering by team ID, workflow type, and sub-types.
</Admonition>

### Example prompt

```prompt theme={null}
Get all workflows for team TEAM001 with type "WORKFLOW"
```

<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\_all\_workflows</code> tool with the correct arguments.
</Admonition>

### Input parameters

| Name     | Type   | Required | Description                                                                  |
| -------- | ------ | -------- | ---------------------------------------------------------------------------- |
| teamId   | string | No       | The team ID to fetch workflows for                                           |
| page     | number | No       | The page number to fetch workflows by                                        |
| limit    | number | No       | The limit of workflows to fetch                                              |
| type     | string | No       | The type of workflows to fetch                                               |
| subTypes | string | No       | Comma separated sub types of workflows to fetch (e.g., "WORKFLOW,AI\_AGENT") |

### Response fields

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

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

  <tbody>
    <tr><td>uid</td><td>string</td><td>Unique identifier for current version of the workflow</td></tr>
    <tr><td>type</td><td>string</td><td>The type of the workflow</td></tr>
    <tr><td>subType</td><td>string</td><td>The sub type of the workflow</td></tr>
    <tr><td>uniqueIdentifier</td><td>string</td><td>The unique identifier of the workflow</td></tr>
    <tr><td>name</td><td>string</td><td>The name identifier of the workflow</td></tr>
    <tr><td>version</td><td>number</td><td>The version of the workflow</td></tr>
    <tr><td>triggerEvent</td><td>object</td><td>The trigger event of the workflow</td></tr>
    <tr><td>filters</td><td>object</td><td>The filters of the workflow</td></tr>
    <tr><td>annotations</td><td>array</td><td>The annotation for the workflow</td></tr>
    <tr><td>workflowDefinition</td><td>array</td><td>The workflow definition steps</td></tr>
    <tr><td>executingAgent</td><td>string</td><td>The executing agent of the workflow</td></tr>
    <tr><td>isActive</td><td>boolean</td><td>The status of the workflow</td></tr>
    <tr><td>createdAt</td><td>string (ISO8601)</td><td>The created at date of the workflow</td></tr>
    <tr><td>updatedAt</td><td>string (ISO8601)</td><td>The updated at date of the workflow</td></tr>
    <tr><td>createdBy</td><td>string</td><td>The created by of the workflow</td></tr>
    <tr><td>teamId</td><td>string</td><td>The team id of the workflow</td></tr>
    <tr><td>metadata</td><td>object</td><td>The metadata for the workflow</td></tr>
  </tbody>
</table>

#### Workflow step structure

Each step in the `workflowDefinition` array contains:

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

  <tbody>
    <tr><td>stepIdentifier</td><td>number</td><td>The step identifier of the workflow step</td></tr>
    <tr><td>activity</td><td>object</td><td>The activity of the workflow step</td></tr>
    <tr><td>input</td><td>object</td><td>The input to the activity</td></tr>
    <tr><td>retryPolicy</td><td>object</td><td>The retry policy of the activity</td></tr>
    <tr><td>onFailure</td><td>string</td><td>The action to take on failure (CONTINUE, ABORT, COMPENSATE)</td></tr>
    <tr><td>isSleepActivity</td><td>boolean</td><td>Whether the activity is a sleep activity</td></tr>
    <tr><td>executionTimeout</td><td>number</td><td>The execution timeout of the activity</td></tr>
    <tr><td>approver</td><td>object</td><td>The approver of the activity</td></tr>
    <tr><td>dependencies</td><td>array</td><td>The dependencies of the activity</td></tr>
    <tr><td>filters</td><td>object</td><td>The filters of the activity</td></tr>
    <tr><td>compensationActivity</td><td>object</td><td>The compensation activity of the activity</td></tr>
  </tbody>
</table>

### Sample response

```json theme={null}
{
  "data": {
    "results": [
      {
        "uid": "WORKFLOW001",
        "type": "WORKFLOW",
        "subType": "AI_AGENT",
        "uniqueIdentifier": "ticket-escalation-workflow",
        "name": "Ticket Escalation Workflow",
        "version": 1,
        "triggerEvent": {
          "id": "EVENT001",
          "name": "ticket.created",
          "description": "Triggered when a new ticket is created"
        },
        "filters": {
          "priority": "high",
          "team": "support"
        },
        "annotations": [
          {
            "entityType": "ticket",
            "data": {
              "autoEscalate": true
            },
            "relations": ["escalation"]
          }
        ],
        "workflowDefinition": [
          {
            "stepIdentifier": 1,
            "activity": {
              "name": "send-notification",
              "uniqueIdentifier": "notification.activity",
              "version": 1,
              "autoUpgradeToLatestVersion": true
            },
            "input": {
              "recipients": ["support-team"],
              "message": "High priority ticket requires immediate attention"
            },
            "retryPolicy": {
              "maximumAttempts": 3,
              "initialInterval": 1000,
              "backoffCoefficient": 2
            },
            "onFailure": "CONTINUE",
            "isSleepActivity": false,
            "executionTimeout": 30000,
            "dependencies": [],
            "filters": {}
          },
          {
            "stepIdentifier": 2,
            "activity": {
              "name": "assign-to-senior-agent",
              "uniqueIdentifier": "assignment.activity",
              "version": 1,
              "autoUpgradeToLatestVersion": true
            },
            "input": {
              "priority": "high",
              "skillSet": ["escalation", "technical"]
            },
            "retryPolicy": {
              "maximumAttempts": 2,
              "initialInterval": 5000,
              "backoffCoefficient": 1.5
            },
            "onFailure": "ABORT",
            "isSleepActivity": false,
            "executionTimeout": 60000,
            "dependencies": [1],
            "filters": {}
          }
        ],
        "executingAgent": "workflow-engine",
        "isActive": true,
        "createdAt": "2025-07-24T07:19:10.258Z",
        "updatedAt": "2025-07-24T07:19:10.258Z",
        "createdBy": "USER001",
        "teamId": "TEAM001",
        "metadata": {
          "description": "Automated workflow for escalating high-priority tickets",
          "tags": ["escalation", "automation", "support"]
        }
      }
    ],
    "total": 1
  },
  "status": true,
  "message": "Workflows 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>

***
