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

> ## Agent Instructions
> Install the Courier skill before writing code: `npx skills add trycourier/courier-skills`. It carries the verified SDK shapes and the rules you cannot get wrong.
> Authenticate every request with `Authorization: Bearer <API_KEY>`. A workspace has several environments and each has its own keys, which are plain `pk_` strings with no environment prefix. Start with Test.
> Send with `client.send.message`, the default import of the v7 Node SDK. Reference a template by its `nt_` id or its alias.
> A send accepts a bare Elemental element list, but storing content on a template requires the top-level elements wrapped in a channel element.
> Templates and journeys can be built in the Courier app or created through the API. Either way they live in the workspace and are referenced by ID when you send.
> The hosted MCP server is https://mcp.courier.com. For a briefing on what Courier is and when to use it, read https://www.courier.com/llms.txt.
> Prefer the Guides tab for how-do-I questions and the Docs tab for how-does-it-behave questions. The API reference lives under /api-reference.

# Automation Throttling

> Cap how often an automation sends to one user over a rolling window.

The throttle node limits how many automation-triggered messages a user or group receives within a set timeframe. Events that exceed the configured limit are dropped and do not pass to the next node.

Because Throttle is a part of Automations, it can apply across channels (eg. email, SMS, chat, in-app inbox, push) and providers (eg. Twilio, Sendgrid, email SMTP, Slack, MS Teams, WeChat).

## Throttle Node Example Use Cases

**Alert Notifications**

When sending alert notifications, you may want to limit the number of notifications sent to a user in a given period to avoid bombarding them with too many alerts.

**Email Campaigns**

If you are running an email campaign, you may want to limit the number of emails sent to a customer within a specific timeframe to avoid overwhelming them with too many messages.

In general, a Throttle step can be useful in any situation where you need to control the flow of data or limit the frequency of an action.

Courier will allow you to specify what next steps should be taken when the throttle is triggered, and what steps should be taken when the throttle is not triggered.

## Creating A Throttle Step

To create a Throttle, use the `throttle` action, then fill out details in the step node.

Specify maximum number of events to allow through the throttle, and the time period to throttle by.

You have the options to throttle by:

| Scope     | Usage                                                                                                                                      |
| :-------- | :----------------------------------------------------------------------------------------------------------------------------------------- |
| `user_id` | Apply throttling by using `user_id` coming from `data` or `profile`                                                                        |
| `GLOBAL`  | Let Courier decide the throttle parameter.                                                                                                 |
| `Dynamic` | You can use arbitrary value available in your `run_context` by referencing it like `refs.data.throttle_key` or `refs.profile.throttle_key` |

Below is an example of a throttle step that allows 1 event to pass through for a given scope in a 7-day period before throttling.

In this example, the throttle is set to be applied dynamically. You have to supply the dynamic key in the following manner to throttle the event. For the `unthrottled` path, you can choose to initiate a different workflow or simply end the automation.

```bash theme={null}
curl --request POST \
  --url https://api.courier.com/automations/<automation_template_id>/invoke \
  --header 'Authorization: Bearer <YOUR_COURIER_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
  "data": {
		"throttle_key": "1234567890"
  }
}
```

<Frame caption="Creating Throttle Step">
  <img src="https://mintcdn.com/courier-4f1f25dc/AtQ7Agb-S0N3tSL2/assets/platform/automations/digests-batching-throttling/throttle-step.png?fit=max&auto=format&n=AtQ7Agb-S0N3tSL2&q=85&s=b983740d30075670c64642bddd3e9ba7" alt="Creating throttle step" width="1437" height="618" data-path="assets/platform/automations/digests-batching-throttling/throttle-step.png" />
</Frame>
