Rate-limiting Blocks Discourse Workflow

AI-generated summary

gassim praises the Discourse Workflow feature but highlights a significant issue with its rate limiting (currently set to 10 executions per minute). He explains that using the ‘wait’ action does not solve the problem because the execution is still counted toward the limit immediately upon trigger, causing failures during bulk operations.

Gassim describes two primary use cases affected by this limitation:

  1. Bulk Badge Granting: Using the /user_badges.json API endpoint to grant badges with a ‘reason’ when members are added to a group. This is preferred over existing bulk grant features or workflow actions that lack the ‘reason’ parameter.
  2. Newsletter Subscriptions: Automatically subscribing new members to a newsletter, which fails if more than ten users sign up within a minute.

He argues that these are common automation tasks (e.g., importing users into groups) where the current rate limit is a blocker because triggers fire instantly, hitting the cap before the logic can process. Gassim requests a solution that either allows configurable rate limits per workflow or implements a queue system with a configurable timer to delay subsequent executions, ensuring large batches are processed without errors.

Hi
First, thank you for this feature, it’s actually very powerful. Second, I have a question about the rate limit.

Is it possible to change the ‘rate limit’ so it’s not only 10 executions in a minute? The issue with this limitation is that even if I decided to use the “wait” feature, it doesn’t work because the execution is already counted as an execution:

My current use case is to bulk grant badges when members are added to a group, and I use the API endpoint /user_badges.json because this one allows you to mention ‘reason’ (which is not the case in the bulk grant feature nor the workflow action).

However, this might not be the only use case. I’m working on subscribing members to the newsletter as soon as they sign up so if more than ten members join at the same minute, there might be an execution error.

Both use cases are helpful in automating things so that we won’t have to manually subscribe members or grant badges, and there might be quite a number of other similar bulk tasks that we would like to automate. However, the rate limit seems to be a blocker.

The problem with the rate limit is that when many users are imported into a group, the ‘user added to group’ triggers immediately and the execution limit is reached immediately. It would be nice if we can either change the limit or create a queue stack for each specific workflow and a timer for how long to wait before it executes the follow-up execution.

Please feel free to move this post into its own topic post. Thank you!