Unexpected duplication of events using multiple digests in the same trigger workflow
Our workflow is configured with 2 digests ( FIRST Digest and SECOND digest) - Each of them with exclusive conditions)
Each digest is of type Schedule every day at specific different time
After each digest we have an email step with exactly the same condition
We trigger two events matching the condition of FIRST digest
We receive the email using the template of FIRST email, but we see there is duplication
Numnber of events 3 when it should be 2
The detail show clearly duplication. The first event is not duplicated, however the second appears twice
This behaviour is critical for our business ( We run a enterprise plan )
Can you help us?
18 Replies
Hi @SafeMahou5x, I'm an AI assistant for Novu. While a team member reviews this question, I'll see if I can find relevant sources for your question.
-----------------------------
While I generate an answer, here are some sources that might be helpful:
* Collect multiple events to a single message with the Digest Engine
* Frequently Asked Questions
* Building notification workflows with the Novu Framework
* How to batch product notifications via code
-----------------------------
Answer
I understand you're experiencing an issue with unexpected duplication of events using multiple digests in the same trigger workflow. This is indeed a critical issue for your business, and I'll do my best to help you based on the information available.
First, it's important to note that there have been some reported issues with multiple digest steps in Novu workflows. According to a GitHub issue (1) , when having 2 digests in a workflow, the digest behavior may not be as expected. This issue was reported and seems to be still open, which suggests it might not have been fully resolved yet.
Regarding your specific case with scheduled digests, here's what we know:
1. Scheduled digests are designed to collect events for a specified period and send them at a set time (2) . In your case, you have two digests scheduled for different times of the day.
2. The behavior you're describing, where the first event is not duplicated but the second appears twice, is not the expected behavior for digest steps .
3. There have been reports of duplicate emails when using digests, especially when events are triggered very close together in time (3) . However, this issue was reported for an older version of Novu (0.9.0 and 0.10.0), and some fixes were implemented in version 0.12.0.
Given the critical nature of this issue for your business and the fact that you're on an enterprise plan, I would strongly recommend taking the following steps:
1. Double-check your workflow configuration to ensure there are no unintended overlaps in the digest conditions or timing.
2. Verify that you're using the latest version of Novu, as some digest-related issues have been addressed in newer versions .
3. If the issue persists, I str
ongly recommend reaching out directly to Novu's support team. As an enterprise plan customer, you should have access to priority support (4) . They will be able to investigate your specific workflow configuration and provide a more tailored solution.
4. In the meantime, you might want to consider implementing a workaround. For example, you could try using a single digest step with more complex conditions instead of two separate digests, if that's feasible for your use case.
5. It would also be helpful to gather more data about the issue. Try to identify any patterns in when the duplication occurs. Does it happen consistently with the second event? Is there a specific time frame where it's more likely to occur?
Unfortunately, without more detailed information about your specific workflow configuration and the exact version of Novu you're using, it's difficult to pinpoint the exact cause of this duplication. The Novu team would be best equipped to investigate this issue in depth, especially given its critical nature for your business.
If you need to track the status of triggered events more closely, you might find it useful to know that there's an ongoing feature request for an API to fetch all triggered events (5) . This could potentially help in diagnosing similar issues in the future.
I apologize that I couldn't provide a direct solution to your problem. Please don't hesitate to reach out to Novu's support team for further assistance with this critical issue.
Feel free to tag @Ask Inkeep with additional questions.
Got it. Tagging @Support for additional help.
I can provide more details if required, you can see our workflow and how it looks in our corporative account
@SafeMahou5x, you just advanced to level 1!
@SafeMahou5x
Currently, we don't support multiple digest in one workflow
@SafeMahou5x as you mentioned you are on enterprise plan on Novu, could you please share environmentid from api keys page?
Hi thanks for your response. A couple of weeks ago I asked you for our business use case, and you suggested using multiple digest variants.
In our business case is paramaount to be able to handle user preferences where they can set up monthly, weekly or four different daily schedules.
And before we started the official non free , i also explained our use case. That was one of the main reasons why thought Novu could be a good fit
Our environmentId 66432c55c4df36a964927b33
You can see a wf named MAU-PLAYGROUND with the test scenario
@SafeMahou5x
Thanks for sharing. I am checking with my team
This describes the test i made
Digest
Condition: user.digestType == 4
Agregate only by suscriberId
When: Every day at 4pm
Email
Using template X
Digest
Condition: user.digestType == 8
Agregate only by suscriberId
When: Every day at 8pm
Email
Using template Y
We triggered 4 events aimed for users expecting agregation Every day at 4pm
We did this way before the time of the FIRST digest
{
digestType: "4"
data : "data01"
}
{
digestType: "4"
data : "data02"
}
{
digestType: "4"
data : "data03"
}
{
digestType: "4"
data : "data04"
}
We can see only FIRST digest is sent which is good.
However its contents are wrong
FIRST DIGEST : Number of events 7
4 - data01
4 - data02
4 - data02
4 - data03
4 - data03
4 - data04
4 - data04
So why 7 instead of 4?
why the events 2,3, and 4 are duplicated? And the first event is not?
@SafeMahou5x
Thanks for sharing the steps and example payloads.
I see, I suggested you to use conditions with digest step in this post
https://discord.com/channels/895029566685462578/1209910907669319791/1209910907669319791
I missed the two digest steps part.
Apologies for inconvenience.
Is having two digest steps in the same workflow a blocker issue for you?
It is, not only two .... we have a deadline and we were relying on having multiple digest steps ( to represent different user preferences ) and emit different emails based on that. Mantaining different workflow is not an option for us, because we have multiple notification types and we would end with 42 triggers to maintain. Only for a customer. And we plan to onboard more customers. So yes is a serious issue. We evaluated several candidates and novu won by the digest engine, the conditions , etc. If we cannot use that would be really hard for us to evolve our platform.
@SafeMahou5x
Would you please like to share your tech stack?
By any chance you are using any of the 6 library/framweork?
Our use case is not driven by UI. We have built an event driven architecture where "events" happen and we process them via AWS Lambdas. The lambda is a Novu abstraction , using the novu sdk "@novu/node": "0.24.1"
@SafeMahou5x, you just advanced to level 2!
However the issue was reproduced using just the Novu console and test. So i guess that rules out any sdk issue.
@SafeMahou5x
Can I please schedule a call with you to resolve the issue?
sure that would be great
i messages u privately