Best approach for unread notification
Hello, I'm evaluating Novu as the notification backend for our app.
I have a use case where users interact with AI agents / Humans in conversations and the conversation is marked as unread for a specific user when a new message is added to the conversation.
The conversation is marked as read client-side when the user is actually looking at it.
Ideally I want to trigger a workflow right when we mark as unread (fire and forget) and the workflow would be as such:
1. delay X seconds (to give some time for the client-side to mark as read potentially)
2. send notifications if still still marked as unread, otherwise skip.
This workflow will probably represent 80% of our activity and likely 90% of the executions will result in skipping the second step.
It's nice and all but, when I look at the pricing, it seems that it will count as one event because I triggered the workflow even if it really didn't do anything in the end.
Or is there a nuance if the workflow has no real activity ?
Is that correct ? Ideally, I would like to avoid delaying via another system...
(Note that we'll probably use the enterprise plan in the end.)
Thanks !
4 Replies
@Fraggle
Thanks for sharing the usecase
Our pricing is indeed based on the events. One workflow trigger to one subscriber consumes one event. Read more about events here
Regarding your question:
send notifications if still still marked as unread, otherwise skip.since this read and unread status is managed by your system, how you plan to share this status with Novu once delay duration is complete?
Trigger | Novu Documentation
Managing Trigger Events from Request to Processing
I plan to use Framework for our all our workflows
So I can check in my database, no ?
@Fraggle
Yes, you can use
@novu/framework for this setup and use a custom step to query your database.okay thanks