# List workflow runs

> Source: https://truto.one/docs/api-reference/admin/workflowruns/list/

`GET /workflow-run`

Resource: **WorkflowRuns**

## Query parameters

- **`workflow_id`** _(string)_
- **`status`** _(string)_
  Allowed: `created`, `running`, `completed`, `failed`
- **`environment_id`** _(string)_

## Response body

- **`result`** _(array<object>)_
  - **`id`** _(string)_
  - **`workflow_id`** _(string)_
  - **`environment_id`** _(string)_
  - **`status`** _(string)_
    Allowed: `created`, `running`, `completed`, `failed`
  - **`result`** _(object, required)_
    - **`steps`** _(array<object>)_
      - **`type`** _(string)_
      - **`action`** _(string)_
      - **`success`** _(boolean)_
      - **`error`** _(string)_
      - **`result`** _(object)_
    - **`success`** _(boolean)_
    - **`error`** _(string)_
  - **`retry_attempt`** _(number)_
  - **`created_at`** _(string)_
  - **`updated_at`** _(string)_
  - **`started_at`** _(string)_
  - **`finished_at`** _(string)_
- **`next_cursor`** _(string)_
- **`limit`** _(number)_

## Code examples

### curl

```bash
curl -X GET 'https://api.truto.one/workflow-run' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json'
```

### JavaScript

```javascript
const response = await fetch('https://api.truto.one/workflow-run', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

url = "https://api.truto.one/workflow-run"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}

response = requests.get(url, headers=headers, params=params)
print(response.json())
```

### Truto TS SDK

```typescript
import Truto from '@truto/truto-ts-sdk';

const truto = new Truto({
  token: '<your_api_token>',
});

for await (const item of truto.workflowRun.list()) {
  console.log(item);
}
```

### Truto Python SDK

```python
import asyncio
from truto_python_sdk import TrutoApi

truto_api = TrutoApi(token="<your_api_token>")

async def main():
    async for item in truto_api.workflow_runs.list():
        print(item)

asyncio.run(main())
```
