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

# Event triggers

> Start an agent from events in GitHub, Slack, Linear and other systems.

An agent can be started by an event in another system, answer people in Slack or Teams, take phone-style voice calls, be offered to customers in the portal, and be called from your own code. This chapter covers each, in that order.

## Start an agent from events in another system

A trigger has two halves. A **trigger connection** links Bud to one external app, and holds the credentials needed to trust its webhooks. It is created once and can be shared. A **trigger subscription** belongs to one agent and says which events from that connection start a run.

### What happens when an event arrives

1. The app sends a webhook to the connection's **Webhook URL**.
2. Bud **verifies** it against the provider's signature scheme or token, using the credentials stored with the connection. A delivery that fails verification is rejected and no agent runs. Delivery to a connection is also rate limited.
3. Duplicates of the same delivery are **dropped**, so a provider that retries does not start two runs.
4. The event is **normalised** to a standard shape with an event type such as *Issue opened*.
5. It is **matched** against agent subscriptions: the connection and the event types you chose.
6. The agent is **started** with the event, as a run whose source is *trigger*. You will see it on the agent's **Runs** tab and in the governance conditions `bud.trigger_origin` and `bud.connection_id`.

## Create the trigger connection

**Who:** someone with access to the project; only an administrator can make a connection global

**Where:** Connectors → Triggers → Add Trigger

1. **Select a Provider**: choose the app (GitHub, Jira, PagerDuty, Zendesk, Stripe, Linear, Asana and many more). The platform sets whether it is a trigger or a chat channel from the provider.
2. **Trigger details**: enter a name. Administrators can switch on **Global trigger**.
3. **Select Projects**: choose the projects that may use it. This step is skipped for a global trigger.
4. Enter the provider's **Credentials** (for most providers, a signing secret or token) and click **Create**.
5. Copy the **Webhook URL** from the success screen with its copy button, click **Done**, and register that address as a webhook in the provider. Use the same signing secret there.

| Field | What to enter | Rules and defaults |
| - | - | - |
| **Trigger Name** | A display name such as `Eng GitHub`. | Shown in the Triggers list. You can rename it later from the list. |
| **Global trigger** | Share the connection with every project. | Administrators only. Off by default (project scope). |
| **Projects** | The projects allowed to use it. | Only these projects can subscribe an agent to it. |
| **Credentials** | The fields the provider asks for. | Stored encrypted by the event service. They are not stored in the main application and are never shown again, so keep your own copy. |

The Triggers list shows each connection's name, provider, scope (**Global** or **Project**), connection ID and creation date. Delete is available to administrators.

> [!WARNING]
>
> Agents subscribed to a connection depend on it. Check which agents use a connection before you delete it.

## Subscribe an agent to events

**Who:** Model manage permission. The agent must be saved first.

**Where:** Agent builder → Tools → Triggers → + Add

The **Triggers** tab lists **Active Triggers** ("Route provider events to this agent"). Each row has edit and delete icons. If the agent has not been saved, the tab asks you to save it first. In the setup screen, enter a name first, then answer the questions in order. A live preview on the right shows what the agent will receive.

| Question | What to do | Rules and defaults |
| - | - | - |
| **Trigger name** | Name this trigger. | Required. |
| **1. Which app sends events?** | Search apps and pick a provider, then pick one of its connections (or **New connection** to create one on the spot, with a **Connection name** such as `Support workspace` and its credentials). | A connection created here has scope **This project** or **Global** (administrators). Its webhook URL is shown once created. |
| **2. What kicks off a run?** | Tick the event types. They are shown with friendly names such as "Issue opened". Use search to narrow them. | The agent starts the first time one of the chosen events arrives. |
| **3. Which events belong to the same run?** | Click the field in the sample event that holds the shared identifier, for example the ticket or pull request number. If there is no sample, type a path such as `$.path.to.identifier`. | Optional. Later events with the same value continue the same run instead of starting a new one. This is called a **case**. With a second app, pick the field in each source that holds the same identifier. |
| **Advanced: keep a case open for** | 1 hour, 6 hours, 1 day or 7 days. | After this period of silence a new event with the same identifier starts a fresh case. |
| **Advanced: if several open cases match** | **Use the newest**, **Feed all matches** or **Flag as ambiguous**. | Defaults to Use the newest. |
| **4. Wait to collect several events before acting?** | Turn it on, then **Choose events** that must all arrive for the case. **From other apps** adds events from a second source. | Off by default. The run is held until everything has arrived. |
| **Wait up to** | 1 hour, 6 hours, 12 hours, 1 day or 3 days. | Default 6 hours. |
| **If time runs out** | **Start with what arrived** or **Don't start**. | Defaults to Start with what arrived. |

Click **Save trigger**. To change it later, click the edit icon in **Active Triggers**; to stop it, click delete.

> [!TIP]
>
> Start with one event type and no grouping. Add case fields and joins only once the simple version works. Add a governance policy that applies to **Triggers** ([Governing and supervising agents](https://docs.budecosystem.com/prompts-agents/governance.md)) so an event-started run cannot take risky actions without approval.

Trigger-started runs have no person in the conversation, so an **Escalate** rule is the way to put a person in the loop. Set **Routes to** to named project members rather than **Invoker**.


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