Is there an API to bulk-delete workflows?
I have tests that create workflows and it would be great for to bulk-delete them in the cases where my cleanup step does not run successfully
7 Replies
@Pawan Jain can you help here?
hi @rajat5885
If you are using in-app notifications, then we have
useRemoveAllNotifications
hook to bulk delete all in-app messages together
https://docs.novu.co/notification-center/react/api-reference#useremoveallnotifications
Currently, we don't have a similar endpoint for other channel messages (notifications)hey Pawan - I'm referring to workflows (previously known as notification templates.) Not notifications themselves
Hey @rajat5885
the only way I could see of bulk deleting workflows is to loop over this somehow:
Hi @rajat5885
Sorry I misunderstood your question
We currently don't have bulk deletion api for workflows
Only way is to delete them one by one 🙂
If you are interested in various solutions to this problem, go take a look at the novu-dotnet library. In particular, the Sync library mirrors environments and has to deal with deletions. Also the integration tests clean up after themselves.
https://github.com/novuhq/novu-dotnet/blob/main/src/Novu.Tests/AcceptanceTests/SyncEnvironmentTests.cs
thanks! this is helpful