---
title: "Workflows"
description: "Trigger-driven automations: build, test, run and debug."
---

> **For AI agents:** the complete documentation index is at [llms.txt](https://docs.trillet.ai/llms.txt). Append `.md` to any page URL for its markdown version.

{/* Generated by packages/mcp/scripts/gen-tool-reference.mjs from @trillet-ai/mcp v0.10.0. Do not edit by hand. */}

Trigger-driven automations: build, test, run and debug. 12 tools.

## `trillet_workflow_reference`

**Workflow reference**

Return the complete reference for Trillet automation workflows: all 7 trigger types with their payloads, all 15 step types with exact config fields, edge/graph rules, settings gotchas, the template/function system, test-vs-run semantics, and billing. READ THIS FIRST before creating or editing any workflow.

Flags: `read-only`

### Parameters

None.

## `trillet_list_workflows`

**List workflows**

List automation workflows in the workspace with compact summaries.

Flags: `read-only` `structured output`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | "draft" \| "active" \| "paused" \| "archived" | no |  |
| `trigger_type` | "inbound_call_completed" \| "outbound_call_completed" \| "webhook" \| "schedule" \| "inbound_message" \| "ghl_new_contact" \| "meta_ads_lead" | no |  |
| `search` | string | no | Name search |
| `page` | number | no | Default: `1`. |
| `limit` | number | no | Default: `20`. |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |

### Structured output

Returned as `structuredContent` (fields are optional; the same data is in the text result):

| Field | Type | Description |
| --- | --- | --- |
| `total` | number |  |
| `workflows` | object[] |  |

## `trillet_get_workflow`

**Get workflow**

Fetch one workflow: full trigger (type, config, filters), steps with configs, edges, settings, status, stats, and webhook token if any.

Flags: `read-only` `structured output`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workflow_id` | string | yes |  |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |

### Structured output

Returned as `structuredContent` (fields are optional; the same data is in the text result):

| Field | Type | Description |
| --- | --- | --- |
| `_id` | string |  |
| `name` | string |  |
| `status` | string |  |
| `trigger` | any |  |
| `steps` | any[] |  |
| `edges` | any[] |  |
| `settings` | any |  |
| `stats` | any |  |
| `webhookToken` | string |  |

## `trillet_create_workflow`

**Create workflow**

Create an automation workflow (created as a draft; test with trillet_test_workflow, then trillet_activate_workflow). Consult trillet_workflow_reference for step configs, trigger payloads, and template variables before building. GOTCHA: settings.maxRunsPerContact defaults to 1 per 24h and silently skips repeat runs for the same contact; this tool defaults it to 500. Filter call-completed triggers to one flow with a filter on 'pathwayId'.

Flags: `writes` `structured output`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | yes |  |
| `description` | string | no |  |
| `trigger_type` | "inbound_call_completed" \| "outbound_call_completed" \| "webhook" \| "schedule" \| "inbound_message" \| "ghl_new_contact" \| "meta_ads_lead" | yes |  |
| `trigger_config` | object (map) | no | Trigger extras: schedule needs \{cron, timezone\}; webhook may set \{listenMode:'workspace'\}; optional businessHours gate \{mode:'after_hours'\|'during_hours', timezone, perDay, blockedDates\} and contactMapping (see reference) Default: `\{\}`. |
| `trigger_filters` | object[] | no | ALL must pass. Operators: equals, not_equals, equals_ci, not_equals_ci, contains, not_contains, is_empty, is_not_empty (gt/lt NOT valid here). e.g. [\{"field":"pathwayId","operator":"equals","value":"&lt;flow id&gt;"\}] Default: `[]`. |
| `steps` | object[] | yes |  |
| `edges` | object[] | yes | Graph edges; first edge usually \{source:'trigger', target:&lt;first stepId&gt;\}. Max one edge per handle, no cycles, all steps must be reachable. |
| `timezone` | string | no | Default: `"Australia/Sydney"`. |
| `max_runs_per_contact` | number | no | Default: `500`. |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |

### Structured output

Returned as `structuredContent` (fields are optional; the same data is in the text result):

| Field | Type | Description |
| --- | --- | --- |
| `id` | string |  |
| `name` | string |  |
| `status` | string |  |
| `trigger` | string |  |
| `filters` | any |  |
| `steps` | string[] |  |
| `stats` | any |  |

## `trillet_update_workflow`

**Update workflow**

Partial update of a workflow (name, trigger, steps, edges, settings). Steps and edges replace wholesale when provided. Active workflows keep running the updated definition. stats/webhookToken/ids are server-managed and ignored if sent.

Flags: `writes` `destructive` `structured output`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workflow_id` | string | yes |  |
| `update` | object (map) | yes |  |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |

### Structured output

Returned as `structuredContent` (fields are optional; the same data is in the text result):

| Field | Type | Description |
| --- | --- | --- |
| `id` | string |  |
| `name` | string |  |
| `status` | string |  |
| `trigger` | string |  |
| `filters` | any |  |
| `steps` | string[] |  |
| `stats` | any |  |

## `trillet_activate_workflow`

**Activate workflow**

Activate a draft or paused workflow so its trigger starts firing. Fails if: no trigger or no steps, invalid cron (schedules), unreachable steps, or a code step that fails to deploy to Cloudflare (502).

Flags: `writes` `idempotent` `open-world` `structured output`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workflow_id` | string | yes |  |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |

### Structured output

Returned as `structuredContent` (fields are optional; the same data is in the text result):

| Field | Type | Description |
| --- | --- | --- |
| `id` | string |  |
| `status` | string |  |

## `trillet_pause_workflow`

**Pause workflow**

Pause an active workflow: its trigger stops firing (schedules are unregistered). Reactivate with trillet_activate_workflow.

Flags: `writes` `idempotent` `structured output`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workflow_id` | string | yes |  |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |

### Structured output

Returned as `structuredContent` (fields are optional; the same data is in the text result):

| Field | Type | Description |
| --- | --- | --- |
| `id` | string |  |
| `status` | string |  |

## `trillet_delete_workflow`

**Delete workflow**

Delete a workflow (soft delete). Cancels its running/waiting/queued runs and unregisters its schedule. Always confirm with the user first; requires confirm=true.

Flags: `writes` `destructive` `asks for confirmation`

Clients that support MCP elicitation show a confirmation form before this tool runs; declining cancels it with no changes. Other clients rely on their own approval prompt and the `confirm` argument.

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workflow_id` | string | yes |  |
| `confirm` | boolean | yes | Must be true. Only set after the user explicitly approved deleting this workflow. |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |

## `trillet_test_workflow`

**Test workflow (simulated)**

Run a workflow in test mode with a sample trigger payload. Works on drafts. SMS/email/calls/webhooks/sheets/GHL are SIMULATED (returns wouldSend previews) and delays resolve instantly - but condition/switch/set_variables/for_each and CODE steps run for real. Returns the run id; inspect with trillet_get_workflow_run.

Flags: `writes`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workflow_id` | string | yes |  |
| `trigger_data` | object (map) | no | Sample trigger payload, e.g. \{"phone":"+61412345678","analyzedData":\{"outcome":"booked"\}\} Default: `\{\}`. |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |

## `trillet_run_workflow`

**Run workflow now (REAL side effects)**

Trigger a REAL run of an ACTIVE workflow immediately: SMS, emails, AI calls, and webhooks actually fire and consume credits. Always confirm with the user first; requires confirm=true. For a dry run use trillet_test_workflow instead.

Flags: `writes` `destructive` `open-world` `billed` `asks for confirmation`

Clients that support MCP elicitation show a confirmation form before this tool runs; declining cancels it with no changes. Other clients rely on their own approval prompt and the `confirm` argument.

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workflow_id` | string | yes |  |
| `trigger_data` | object (map) | no | Trigger payload for the run (fields readable as \{\{trigger.*\}\}) Default: `\{\}`. |
| `confirm` | boolean | yes | Must be true. Only set after the user explicitly approved a real run. |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |

## `trillet_list_workflow_runs`

**List workflow runs**

List runs of a workflow (newest first) with status, contact, progress, and skip/error reasons. Statuses: running, waiting, queued, completed, failed, skipped (see skipReason - 'max_runs_per_contact' means the per-contact cap silently ate the trigger), filtered, cancelled.

Flags: `read-only` `structured output`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workflow_id` | string | yes |  |
| `status` | string | no |  |
| `page` | number | no | Default: `1`. |
| `limit` | number | no | Default: `20`. |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |

### Structured output

Returned as `structuredContent` (fields are optional; the same data is in the text result):

| Field | Type | Description |
| --- | --- | --- |
| `total` | number |  |
| `runs` | object[] |  |

## `trillet_get_workflow_run`

**Get workflow run detail**

Fetch one workflow run with its per-step logs (inputs, outputs, errors, timings), plus parent/child runs for for_each loops. The primary tool for debugging why a workflow run did what it did.

Flags: `read-only`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `run_id` | string | yes |  |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |
