# Reactions & Triggers: Chaining, delays & guards

> Sequencing safely, and the caps that stop a runaway.

Glider documentation · Logic · Web page: https://cgglider.com/docs/reactions/chaining/

Sections of this page: [The model](https://cgglider.com/docs/reactions.md) · [When](https://cgglider.com/docs/reactions/events.md) · [Conditions](https://cgglider.com/docs/reactions/conditions.md) · [Then](https://cgglider.com/docs/reactions/actions.md) · [Chaining, delays & guards](https://cgglider.com/docs/reactions/chaining.md)

Every reaction carries a delay. With delay 0 the action runs on a microtask, decoupled from the store's own watcher stack; with a delay it lands on a timer. Chain reactions by having one emit an event another listens for, or by reacting to a clip ending.

## The two caps

| Guard | Limit | Catches |
| --- | --- | --- |
| Burst cap | 256 actions per macrotask turn | A synchronous loop: setStore → onChange → setStore. |
| Rate cap | 512 actions per rolling second | A slower self-feeding cascade whose delay puts each iteration in its own turn. |

Over either cap the action is dropped and logged until the window advances. Emitting is charged too — without that, onEvent(e) → emit(e) would loop forever through the bus.

> **If reactions stop firing:** Check the logger for dropped-action lines before suspecting the engine. A legitimate page never approaches hundreds of reaction writes per second; hitting a cap means a loop.

![A chained reaction with a delay.](https://cgglider.com/docs-shots/reactions-chain.png)
