# Triggers

Simply defining a action in your config won't actually do anything. You need to trigger it somehow. The most common way is using a trigger, which connects events to actions.

### Trigger Config

Triggers are defined in your [config file](/config-file-structure.md). A top level `triggers` object contains an `namedTriggers` map/object, with subitems for each trigger.

Each trigger object contains:

* `eventName` \[string, required]: the event name which triggers this trigger
* `actionName` \[string, required]: the name of the action to perform when that event occurs
* `condition` \[string, optional]: a [condition string](/conditional-targeting/intro-to-conditions.md) to evaluate when the event occurs. The action will only be fired if it evaluates to true.

### Example Config

```
"triggers": {
    "namedTriggers": {
        "suggestWatchAppTrigger": {
            "eventName": "app_start",
            "actionName": "showSuggestWatchAppDialog",
            "condition": "hasWatch && eventCount('shown_suggest_watch_dialog') == 0"
        },
        "congratsMessageTrigger": {
            "eventName": "completed_list_item",
            "actionName": "showCongratsModal"
        }
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.criticalmoments.io/actions-in-app-messaging/triggers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
