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

# Manage automations with MCP

> Create, inspect, test, update, and route automations using workspace-scoped tools

Automation MCP tools use the same workspace services and definition contracts as the Portal. They are available when the module is enabled for the workspace and your connection has the appropriate access. Discover the tools exposed by your connection rather than assuming every workspace has the same tool list.

## Tool reference

| Tool | Purpose |
| - | - |
| `list_automations` | List definitions with status and 24-hour execution/failure counts |
| `get_automation` | Read the full definition, version, status, and direct entry URLs |
| `create_automation` | Create a draft with an empty webhook section |
| `update_automation` | Change metadata or replace the complete definition |
| `test_automation` | Test a section with a sample payload, including an optional unsaved definition |
| `set_automation_status` | Set `ACTIVE` or `PAUSED` |
| `list_automation_runs` | List runs, optionally filtered by status |
| `get_automation_run` | Read a run and its step results |
| `list_automation_trigger_routes` | Inspect existing trigger bindings |
| `set_automation_trigger_route` | Configure a webhook or status route from an existing production trigger |
| `delete_automation_trigger_route` | Remove one binding and restore the original path for new events |
| `rotate_automation_token` | Replace direct-entry tokens; previous direct URLs stop working |
| `delete_automation` | Delete the automation and its history |

## Update safely

1. Call `get_automation` and inspect its current definition and version.
2. Prepare the complete replacement definition, retaining section/step IDs where their meaning is unchanged.
3. Call `test_automation` with the proposed definition and representative payloads. Review [test-mode behavior](https://docs.runflow.ai/automations/testing-and-operations.md#what-test-mode-executes).
4. Re-read before updating to detect edits made by another operator. The current update tool does not accept an expected-version precondition; re-reading alone is not a concurrency lock. Coordinate edits.
5. Call `update_automation`, inspect the stored result, and activate only when ready for live events.

Example test arguments for the [quickstart](https://docs.runflow.ai/automations/quickstart.md):

```json theme={null}
{
  "automationId": "AUTOMATION_ID",
  "sectionId": "record_event",
  "payload": { "event": "record.created", "id": "example-001" }
}
```

For testing an unsaved definition, add `definition` with the complete `{ "sections": [...] }` object. An update with `definition` replaces the definition; it is not a partial patch of one step.

## Preserve the caller's URL

Example arguments for `set_automation_trigger_route`:

```json theme={null}
{
  "automationId": "AUTOMATION_ID",
  "triggerId": "EXISTING_TRIGGER_ID",
  "entryKind": "webhook",
  "match": {
    "match": "all",
    "rules": [
      { "path": "body:event", "operator": "equals", "value": "notification.requested" }
    ]
  }
}
```

A status binding uses `entryKind: "channel"` and `allRequests: true`, with a channel-status section on the destination automation. This can be a different automation from the webhook destination. Review [routing behavior](https://docs.runflow.ai/automations/data-and-routing.md#keep-an-existing-trigger-url) before changing an active trigger.

## Portal, MCP, and CLI

Use the Portal for visual editing and run inspection, and MCP for programmatic management through a connected assistant. The automation definitions can be retained in source control as integration artifacts, but they are not agent source files and are not automatically updated by an agent deploy.

Dedicated automation pull/diff/deploy/promote commands in the Runflow CLI are **not part of the interface documented here**. Do not apply the agent's staging/promotion commands to an automation or assume that copying a definition creates an automatic synchronization mechanism.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.