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

# Triggers

> Schedule and event-based trigger instances

## What are triggers?

**Triggers** are the “when” for your [workflows](/guides/workflows). Instead of only running a workflow by hand (API call or button click), you attach a **trigger instance** to it: for example “every day at 9 AM” or “when a webhook is called”. Flowra then runs the workflow at that time or when that event happens. Each such rule is a **trigger instance** — it has a type (schedule, webhook, etc.), a slug, and is linked to a workflow (and optionally to a [connected account](/guides/connected-accounts) for OAuth context).

So: **workflow** = what runs; **trigger** = when it runs (schedule or event).

### Example use cases

* **Daily digest** — Create a trigger that runs every morning; the workflow fetches emails, summarizes them, and posts to Slack.
* **Webhook from your app** — Your backend sends a webhook when an order is placed; the trigger runs a workflow that notifies the team and updates a sheet.
* **Messaging channels** — Inbound events from messengers (for example Slack, Telegram, WhatsApp, Discord, or Gmail) map to a **trigger tool** on the workflow after the account is connected. Configure the channel’s trigger tool and confirm the instance under [Triggers](https://flowra.dev/dashboard/triggers). Product walkthrough: [Triggers in the dashboard](/product/triggers-in-dashboard).
* **Per-user schedules** — Each user has a connected account; you create one trigger instance per user so “their” workflow runs with “their” calendar or inbox.

### How it works

1. You have a [workflow](/guides/workflows) that you want to run automatically.
2. You **create or update** a trigger instance via `POST /trigger_instances/{slug}/upsert` — you pass the slug (e.g. for schedule), the workflow or connection info, and any schedule or event config. Same slug = idempotent update.
3. Flowra runs the workflow when the trigger fires. You can **list** active trigger instances, **enable/disable** one, or **delete** it to stop it permanently.

The API lets you list active triggers (with filters), upsert (create/update), change status, and delete.

***

## API endpoints

### Get active trigger instances

**GET** `/api/v1/trigger_instances/active` returns active trigger instances with optional filters and pagination.

| Query parameter                          | Description                     |
| ---------------------------------------- | ------------------------------- |
| `connectedAccountIds`                    | Filter by connected account IDs |
| `authConfigIds`                          | Filter by auth config IDs       |
| `trigger_ids`, `trigger_ids` (legacy)    | Filter by trigger IDs           |
| `trigger_names`, `triggerNames` (legacy) | Filter by trigger names         |
| `showDisabled`                           | Include disabled triggers       |
| `page`, `limit`, `cursor`                | Pagination                      |

### Upsert trigger instance

**POST** `/api/v1/trigger_instances/{slug}/upsert` creates or updates a trigger instance for the given `slug`. Request body: **UpsertTriggerInstanceDto** (see [API reference](/api-reference)). Use a stable slug to idempotently create or update the instance.

### Update trigger status (enable/disable)

**PATCH** `/api/v1/trigger_instances/manage/{triggerId}/status` enables or disables a trigger instance by ID. Send the desired status in the request body as defined in the API reference.

### Delete trigger instance

**DELETE** `/api/v1/trigger_instances/manage/{triggerId}` removes the trigger instance.

## Related

* [Workflows](/guides/workflows) — Create and run the workflows that triggers execute.
* [Connected accounts](/guides/connected-accounts) — Often used with triggers for OAuth context.
* [API reference: trigger\_instances](/api-reference) — Full request/response schemas.
