novu framework questions
i have a couple questions about novu framework that i still need help with if someone has a moment!
16 Replies
1. i still need help changing my novu cloud instance over from the old workflows to the new ones. i have tried to run the novu sync command (
npx novu@latest sync --bridge-url ...
) and it completes with no errors that i can see, but the workflows aren't appearing in novu cloud. where should i be able to see the workflows that appear in local studio once they are synced to a new environment? if i had old workflows with the same identifiers, is that why the new ones are not appearing? how can i at least see logs to see what is going on with the sync? i've asked about migrating in the discord a couple times and have been told i have to do it manually, which i undesrtand, but i still don't know how to successfully switch over when i had existing workflows. do i need to delete them manually?
2. is there an example of a custom novu framework serve function? i'd love to see more documentation or examples of custom framework serve functions and what all the different handler keys are supposed to return. there doesn't seem to be much documentation in the source code so i'm not sure how to write a proper one. e.g. what should the "frameworkName" be since if it's custom it won't be one of the SupportedFrameworkName enum values like express, next, etc.@sheena could you try maybe making the workflow with another identifier name? Also, please verify that you are viewing the correct environment that was used with the sync API key
i'm viewing the correct environment but all my old workflows are there. if i want to keep using the same identifier, can i delete the old ones manually and try that way?
Yes, you can try it out π
are there logs anywhere that can help me debug?
Are you using our cloud environment? In this case could you please send me in a DM your account email address?
thanks, i'll follow up if i'm still having issues, but just an update for anyone else struggling with this that it worked to delete the old UI-based workflows manually from the cloud before syncing. hopefully i can then promote those deletion changes and then sync against production as well, but i haven't tried that step just yet
i would still really like a way to see more detailed logs though to be able to debug the workflows
e.g. right now i'm seeing something like this for FCM
On all the errors i see
"Sending message failed due to \"Requested entity was not found.\""
but there is no way to tell what device token it's trying to send to. i'm not sure why there are so many errors, unless perhaps it's retrying the same token multiple times? i would love to see end-to-end logs from novu's side from what it sees for the workflow trigger, subscribers, payload, etc. and which tokens are triggering the errors (this also ties into not knowing how to use novu to delete expired device tokens -- when i managed my own FCM i used to delete any expired or entity-not-found device tokens as firebase says to do in the documentation, but there is no way to do that in novu as far as i can tell)(would also be great to be able to search or filter subscribers in the novu cloud interface)
Thank you for the feedback! we are going to invest in better reporting and activity feed as part of the new dashboard experience we are working on. I'm passing your feedback to the team π
thank you! great work on all the new features -- framework is a really nice step forward in the developer experience
btw though am i still understanding correctly that there is no way with novu to manage deletion of expired FCM device tokens? i have a lot of subscribers that have dozens of now-expired tokens, so it creates a situation where almost every trigger causes push notification errors, and the list of tokens for each subscriber continues to grow
@sheena, you just advanced to level 3!
perhaps there could be a webhook or some other way to know when there is an error? i searched the docs and discord and saw other questions about this but no definitive answer i could find
Yes, currently this is not supported. I think we can add a try catch block inside of FCM, and throw a token expired error to remove it from the subscriber. That's the suggest flow is that correct?
i think there are at least 2 exceptions that they recommend deleting the token on https://firebase.google.com/docs/cloud-messaging/manage-tokens (UNREGISTERED and INVALID_ARGUMENT) so that would probably be a good start
i think there would still need to be a webhook though or some other asynchronous way to know that Novu deleted the token so that users could keep these synced in their databases if they have them (i have tokens as a DB table also)
or perhaps you were suggesting that novu would let the user know what the error was and then the user deletes the token, but i guess either way there is some async communication needed