> For the complete documentation index, see [llms.txt](https://docs.criticalmoments.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.criticalmoments.io/actions-in-app-messaging/triggers.md).

# 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"
        }
    }
}
```
