novuhq / novu

Open-Source Notification Platform. Embeddable Notification Center, E-mail, Push and Slack Integrations.
https://novu.co
Other
34.01k stars 3.47k forks source link

πŸ› Bug Report: cannot trigger workflow with topic #5571

Open lukmanfarizi opened 3 months ago

lukmanfarizi commented 3 months ago

πŸ“œ Description

With Novu v.0.24, I am unable to trigger workflows with topics, whereas it worked in v.0.22. Although the API results indicate success with a β€˜processed’ status, the trigger is neither being called nor recorded in the activity feed.

πŸ‘Ÿ Reproduction steps

parameter to trigger topic,

{ "name": "event-started", "to": { "type": "Topic", "topicKey": "notification" }, "payload": { "alert": "xxxxx" } }

result from novu, { "data": { "acknowledged": true, "status": "processed", "transactionId": "24a5b418-f789-417c-ab81-ed951f93df0a" } }

πŸ‘ Expected behavior

it should trigger workflow

πŸ‘Ž Actual Behavior with Screenshots

image

Novu version

V.0.24.0

npm version

No response

node version

No response

πŸ“ƒ Provide any additional context for the Bug.

No response

πŸ‘€ Have you spent some time to check if this bug has been raised before?

🏒 Have you read the Contributing Guidelines?

Are you willing to submit PR?

None

linear[bot] commented 3 months ago

NV-3795 πŸ› Bug Report: cannot trigger workflow with topic

ainouzgali commented 3 months ago

Hi @lukmanfarizi :) Could you please try having to as an array of objects. Like this: { "name": "event-started", "to": [{ "type": "Topic", "topicKey": "notification" }], "payload": { "alert": "xxxxx" } }

ainouzgali commented 3 months ago

@lukmanfarizi did you get a chance to try what I suggested? It should work, please let me know if you still have problems with that. Assuming it did work for you - I will open a ticket for having a correct validation error for this.

lukmanfarizi commented 3 months ago

@ainouzgali, I apologize for the delayed response.

I have already tested your suggestion, but unfortunately, it is still not working. I attached capture from postman.

image

mohamed-cherifi commented 3 months ago

Hello,

I am having a similar issue. I am using Novu 0.23 Here's what I've tried so far with no luck:

So even when I tried to trigger the topic via a direct api call the notification didn't appear on the activity feed. But if I trigger the notification the standard way, ie with a subscriber id it does work as expected.

For additional context here's the list of topics:

image
BlackH3art commented 3 months ago

Hello,

@lukmanfarizi @mohamed-cherifi

The question is what version of Novu are you using? Is it the claud version or the selfhosted version?

I had exactly the same issue using self-hosted version. Topics were processed and properly sent but no actual notification was delivered. After couple days and discussion on Discord, it turns out that there is environment variable called IS_TOPIC_NOTIFICATION_ENABLED required in order for topic to be actually send.

If you're using self-hosted version, then adding this line in /docker/local/deployment/docker-compose.yml under the worker service in environment section should solve the problem:

IS_TOPIC_NOTIFICATION_ENABLED: true

Or in .env files if you run Novu locally, not using docker-compose.

ngonam22 commented 1 month ago

Hello @BlackH3art and thank you for your solution!!

Im using the latest version of Novu self hosted and have the exact same problem. Took me hours to digging around the source code but found nothing!! Anw really wonder what happened? We missed this Flag in our document or something?