Rate limit for topic email

Hey, I noticed today that I hit a rate limit on resend while sending out a weekly email that I trigger using a topic.
Is it possible somehow to add a delay so that not all email is sent at the same time?
9 Replies
Pawan Jain
Pawan Jain2w ago
@christian Currently, it is not supported.
christian
christianOP2w ago
ok thanks
Novu_Bot
Novu_Bot2w ago
@christian, you just advanced to level 3!
Tomer Barnea
Tomer Barnea2w ago
@christian to make sure we undertand this, the issue is rate limit on resend API? are you looking for a solution for that? (debounce/throttle, fallback provider, retry)?
christian
christianOP2w ago
I use a topic for sending out a weekly e-mail, I got this response from resend for most of the emails

"Too many requests. You can only make 2 requests per second. See rate limit response headers for more information. Or contact support to increase rate limit."

"Too many requests. You can only make 2 requests per second. See rate limit response headers for more information. Or contact support to increase rate limit."
I guess what I'm asking for is if I can add some kind of delay so that not all e-mails are sent at the same time for the topic, perhaps i could do this by adding a random delay in my workflow?
export const topRecipesWorkflow = workflow(
TriggerEvents.TopWeekly,
async ({ step, payload, subscriber }) => {
const recipes = JSON.parse(payload.recipes ?? "[]");
const userId = subscriber.subscriberId ?? "";
const userFirstName = subscriber.firstName ?? "";

await step.email("weekly-top-recipes", async () => {
const emailBody = await renderEmail(recipes, userId, userFirstName);
return {
subject: "Top recipes last week",
body: emailBody,
};
});
},
{
payloadSchema: topWeeklyPayloadSchema,
},
);
export const topRecipesWorkflow = workflow(
TriggerEvents.TopWeekly,
async ({ step, payload, subscriber }) => {
const recipes = JSON.parse(payload.recipes ?? "[]");
const userId = subscriber.subscriberId ?? "";
const userFirstName = subscriber.firstName ?? "";

await step.email("weekly-top-recipes", async () => {
const emailBody = await renderEmail(recipes, userId, userFirstName);
return {
subject: "Top recipes last week",
body: emailBody,
};
});
},
{
payloadSchema: topWeeklyPayloadSchema,
},
);
Tomer Barnea
Tomer Barnea2w ago
@christian that would be a simple and effective slution, I am also adding this to our product feedback under the category of throttling. @Dima Grossman @Pawan Jain maybe we can document a solution like that in the docs?
Pawan Jain
Pawan Jain2w ago
Sure Tomer. Adding a task for docs
Linear
Linear2w ago
Want results from more Discord servers?
Add your server