# List workflows

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

`GET /workflow`

Resource: **Workflows**

## Query parameters

- **`trigger_name`** _(string)_
  Filter workflows by trigger name.
- **`environment_id`** _(string)_
  Filter workflows by environment ID.

## Response body

- **`results`** _(array<object>)_
  - **`id`** _(string)_
  - **`environment_id`** _(string)_
  - **`trigger_name`** _(string)_
  - **`config`** _(object, required)_
    Workflow execution configuration.
    - **`run_if`** _(string)_
      JSONata condition evaluated before executing workflow steps.
    - **`steps`** _(array<object>)_
      - **`type`** _(string)_
        Step execution type.
        Allowed: `run`
      - **`action`** _(string)_
        Action executed by the step.
      - **`cron_expression`** _(string)_
        Optional cron expression for scheduled execution.
      - **`config`** _(string)_
        JSONata expression evaluated at runtime to generate the step execution payload.
  - **`created_at`** _(string)_
  - **`updated_at`** _(string)_
- **`next_cursor`** _(string)_
- **`limit`** _(number)_

## Code examples

### curl

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

### JavaScript

```javascript
const response = await fetch('https://api.truto.one/workflow', {
  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"
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.workflow.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.workflows.list():
        print(item)

asyncio.run(main())
```
