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

# Triggers

> Automate agent execution with webhook events and time schedules.

A trigger runs an agent automatically — either when an event occurs in an external service, or on a recurring schedule.

## Trigger types

<CardGroup cols={2}>
  <Card title="Webhook" icon="webhook">
    Fires when an event occurs in a connected service, such as a new Slack mention or a GitHub pull request.
  </Card>

  <Card title="Time" icon="clock">
    Fires on a recurring schedule: hourly, daily, weekly, or monthly.
  </Card>
</CardGroup>

## Create a trigger

<Steps>
  <Step title="Open your workspace">
    Go to [guild.ai](https://guild.ai) and open the workspace where the agent is installed.
  </Step>

  <Step title="Go to Triggers">
    In the left sidebar, open **More** and click **Triggers**, then click **New trigger**.
  </Step>

  <Step title="Choose a type">
    Select **Webhook** or **Time**, then configure the trigger.
  </Step>

  <Step title="Select an agent">
    Choose the agent the trigger will run when it fires.
  </Step>
</Steps>

## Webhook triggers

A webhook trigger fires when a specific event occurs in a connected service.

### Supported services

| Service      | Example events                                |
| ------------ | --------------------------------------------- |
| Slack        | `app_mention`, `message`                      |
| GitHub       | `pull_request`, `issues`, `push`              |
| Linear       | `issue`, `comment`                            |
| Jira         | `issue_created`, `issue_updated`              |
| Azure DevOps | `workitem.created`, `git.pullrequest.created` |
| Google Docs  | Document changes                              |
| Notion       | Page updates                                  |

Configure the service, event type, and optional event action when creating the trigger. The agent receives the event payload as its input.

### Agent input

By default, a webhook trigger passes the external service payload to the agent as its input. You can customize this input the same way you do for time triggers — define schema-driven input fields or supply raw JSON. Custom input overrides or supplements the trigger execution context.

When you configure a webhook trigger's agent input, you can also choose to pass the external event payload unaltered. Select this option to forward the raw payload to the agent without defining any custom input fields.

### CLI

```bash theme={null}
# Create a Slack webhook trigger
guild trigger create \
  --type webhook \
  --service SLACK \
  --event app_mention \
  --agent slack-assistant

# Create a GitHub webhook trigger for opened pull requests
guild trigger create \
  --type webhook \
  --service GITHUB \
  --event pull_request \
  --action opened \
  --agent code-reviewer
```

## Time triggers

A time trigger fires on a recurring schedule and runs the agent with a fixed input.

### Frequencies

| Frequency | Options                    |
| --------- | -------------------------- |
| `HOURLY`  | —                          |
| `DAILY`   | Time of day                |
| `WEEKLY`  | Days of week, time of day  |
| `MONTHLY` | Days of month, time of day |

### CLI

```bash theme={null}
# Daily trigger at 9:00 AM
guild trigger create \
  --type time \
  --frequency DAILY \
  --time 09:00 \
  --agent daily-report \
  --input '{"project": "GUILD"}'

# Weekly trigger on Monday mornings
guild trigger create \
  --type time \
  --frequency WEEKLY \
  --days-of-week monday \
  --time 09:00 \
  --agent weekly-summary
```

## Manage triggers

### Activate and deactivate

Deactivate a trigger to pause it without deleting it.

```bash theme={null}
guild trigger deactivate <trigger-id>
guild trigger activate <trigger-id>
```

### List and inspect

```bash theme={null}
# List all triggers in the workspace
guild trigger list

# Get details for a specific trigger
guild trigger get <trigger-id>

# List sessions spawned by a trigger
guild trigger sessions <trigger-id>
```

### Update

```bash theme={null}
# Change the schedule of a time trigger
guild trigger update <trigger-id> --time 10:00

# Change the event of a webhook trigger
guild trigger update <trigger-id> --event message
```
