-
Notifications
You must be signed in to change notification settings - Fork 111
feature: MRK-1066 content for the throttle step #979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
1e7127e
Docs content for the throttle step
Aviatorscode2 66fceec
Update content/docs/platform/workflow/throttle-step.mdx
Aviatorscode2 7a9de8d
Update content/docs/platform/workflow/throttle-step.mdx
Aviatorscode2 aa7e625
Update content/docs/platform/workflow/throttle-step.mdx
Aviatorscode2 bf9104f
Update content/docs/platform/workflow/throttle-step.mdx
Aviatorscode2 8a060f9
Update content/docs/platform/workflow/throttle-step.mdx
Aviatorscode2 b192ae2
Update content/docs/platform/workflow/throttle-step.mdx
Aviatorscode2 5559912
Update content/docs/platform/workflow/throttle-step.mdx
Aviatorscode2 e8a29e6
Make changes based on feedback
Aviatorscode2 1fcf512
Make changes base on feedback
Aviatorscode2 690cbf2
Merge branch 'MRK-1066' of https://github.com/novuhq/docs into MRK-1066
Aviatorscode2 da9e942
Update docs based of feedback from Diana
Aviatorscode2 65a78ed
Add throttle diagram
Aviatorscode2 d6fb40e
Apply suggestion from @DianaHackmamba
jainpawan21 486051d
Update content/docs/platform/workflow/throttle-step.mdx
jainpawan21 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| --- | ||
| title: 'Throttle Step' | ||
| description: 'Learn how to use the Throttle step in Novu workflows to control notification frequency.' | ||
| icon: 'Gauge' | ||
| --- | ||
|
|
||
| The Throttle step lets you limit the number of workflow executions within a specified time window. You can configure throttling directly in Novu workflow editor. By setting limits, you can prevent subscribers from receiving duplicate or excessive notifications when a trigger fires repeatedly. | ||
|
|
||
| Some use cases for this include: | ||
| - Limiting high-frequency alerts (such as CPU or billing usage checks) to one notification per hour, day, or week. | ||
| - Preventing duplicate messages from automated cron jobs or recurring triggers. | ||
| - Controlling notification frequency for subscribers who belong to multiple projects or contexts. | ||
|
|
||
| ## How the Throttle step works | ||
|
|
||
| At a high level, the throttle step counts the number of times a workflow is triggered for a specific subscriber. | ||
|
|
||
| - If the count is within the defined execution threshold for the time window, the workflow proceeds as normal. | ||
Aviatorscode2 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - If the count exceeds the threshold, the workflow execution is halted at the throttle step. Any steps placed after the throttle step in your workflow will not be executed. For example, if you have an email step following a throttle step, that email will not be sent once the limit is reached. | ||
Aviatorscode2 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|  | ||
|
|
||
| Throttling applies consistently across channels, whether the workflow sends email, in-app, SMS, chat or push notifications. | ||
Aviatorscode2 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| The throttle step applies to all workflows, including those marked as critical. If a critical workflow is triggered more frequently than the throttle limit allows, it will be skipped just like any other workflow. This ensures that even high-priority alerts do not overwhelm a subscriber. | ||
Aviatorscode2 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| To the subscriber, the experience is transparent. They are not aware that any throttling has occurred; they either receive a notification or they don’t. The subscriber is never exposed to information about the throttle itself. | ||
|
|
||
| ## Configuration options | ||
Aviatorscode2 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| The Throttle step has several configuration fields that define how throttling is applied. | ||
|
|
||
| ### Throttle Step properties | ||
Aviatorscode2 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - **Name**: A descriptive label for the step in the workflow editor. | ||
| - **Identifier**: A unique key used to reference the step programmatically. | ||
|
|
||
| ### Throttle window | ||
|
|
||
| The throttle window defines the time period in which executions are counted. Within this window, only the specified number of executions are allowed. You can choose between a fixed or dynamic window. | ||
|
|
||
| #### Fixed window | ||
|
|
||
| In fixed window, the time frame is predefined in the workflow editor. Use this mode when the time window for throttling is constant and known in advance. For example, "allow only one login alert per hour." | ||
|
|
||
|  | ||
|
|
||
| - **Throttle for**: Sets the fixed duration of the time window. The minimum duration is one minute. You can set this in minutes, hours, or days. | ||
| - **Execution threshold**: Defines the maximum number of workflow executions allowed within the specified time window. This defaults to 1. | ||
| - **Group throttling by**: By default, all throttling is grouped by the `subscriberId`. This field allows you to add a second aggregation key based on a variable from your trigger `payload`. This is useful for creating more throttling rules. | ||
|
|
||
| Here is an example of how they work together: | ||
|
|
||
| Imagine you want to send a notification for each project a user belongs to, but no more than once a week per project. You can set `Throttle for` to "7 days" and `Group throttling by` to `payload.projectId`. This ensures the user receives one alert for Project A and one for Project B within the same week, instead of just one alert total. | ||
| #### Dynamic window | ||
Aviatorscode2 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| In dynamic window, the time frame is determined by data sent in the trigger payload. Use this mode when the throttle duration or end time needs to be flexible and defined at the time of the trigger. For example, "throttle billing alerts until the end of the current billing cycle." | ||
|
|
||
|  | ||
|
|
||
| - **Dynamic window key**: Specify the key in your trigger payload that contains the dynamic window configuration. For example, `payload.throttleUntil` or `payload.customWindow`. | ||
|
|
||
| The value for the dynamic window key can be provided in one of two formats: | ||
| 1. **ISO-8601 Timestamp (string)**: | ||
| This format throttles executions until a specific future date and time. Any new triggers before this timestamp will be evaluated against the throttle limit. | ||
|
|
||
| ```json | ||
| { | ||
| "throttleUntil": "2025-10-31T23:59:59Z" | ||
| } | ||
| ``` | ||
| 2. **Duration Object**: This format throttles executions for a duration relative to the time of the first trigger. It follows the same structure as the fixed window configuration. | ||
jainpawan21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```json | ||
| { | ||
| "customWindow": { "amount": 30, "unit": "minutes" } | ||
| } | ||
| ``` | ||
|
|
||
| - **Execution threshold**: This works the same as in the fixed window mode, defining the maximum number of executions allowed within the dynamically set window. | ||
|
|
||
| - **Group throttling by**: This also functions identically to the fixed window mode, allowing for an additional grouping key from the payload. | ||
|
|
||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not capitalize every instance of "throttle." Apply throughout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throttle is a feature in the UI, that was why it was capitalized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but you capitalize it in some places and not others. In this description, it is not clear whether you are explicitly talking about a UI thing (click Throttle step) or a generic thing (the throttle step exists and does useful stuff).