> For the complete documentation index, see [llms.txt](https://docs.pixiebrix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pixiebrix.com/developing-mods/developer-concepts/types-of-mods/trigger/intervals.md).

# Intervals

The **Interval** trigger is a type of event used in the [**Trigger Starter Brick**](/developing-mods/developer-concepts/types-of-mods/trigger.md) that allows you to run bricks on a recurring time interval. This is useful for mods that need to continuously check for new data, poll an API, or monitor changes to content on the current page.

For example, you might:

* Periodically check an API for new notifications or messages
* Watch a DOM element on the page and trigger an action when it updates
* Run a script every few seconds to keep data in sync

### Configuration Options

<table><thead><tr><th width="216.6015625">Option</th><th>Description</th></tr></thead><tbody><tr><td><strong>Interval</strong></td><td>How frequently the trigger should fire in milliseconds. For example, <code>10000</code> = every 10 seconds.</td></tr><tr><td><strong>Run in Background</strong></td><td>When <code>true</code>, continues running even if the tab is inactive.</td></tr><tr><td><strong>Run in All Frames</strong></td><td>When <code>true</code>, runs in all frames (iframes, embedded contexts).</td></tr><tr><td><strong>Debounce</strong></td><td>Optional. Helps prevent excessive triggering. <br>Includes:<br>• <code>Delay</code> (ms) – time to wait before firing<br>• <code>Leading</code> – trigger at the start<br>• <code>Trailing</code> – trigger at the end</td></tr></tbody></table>

<figure><img src="/files/uT8DYGdtHLOYG9MpuCd5" alt=""><figcaption></figcaption></figure>

***

### FAQs

**What’s the minimum interval I can set?**\
We recommend setting intervals of at least 1000 ms (1 second) to avoid performance issues.

**Will intervals still run if the user navigates away from the tab?**\
Only if **Run in Background** is set to `true`.

**What happens if multiple frames are on the page?**\
Use **Run in All Frames** to determine if the trigger should fire in each iframe or just the main window.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.pixiebrix.com/developing-mods/developer-concepts/types-of-mods/trigger/intervals.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
