N
Novuβ€’3w ago
AN1RUDH

Triggering a workflow using topics does not do anything

Hi everyone, We've self-hosted Novu and were able get it in a working state. We're able to send notifications. However, when we tried to create topics and send notifications to those topic(s), we get back a sucess response:
{
"data": {
"acknowledged": true,
"status": "processed",
"transactionId": "677555f6-0d9c-4ae0-b12f-6d3254a07146"
}
}
{
"data": {
"acknowledged": true,
"status": "processed",
"transactionId": "677555f6-0d9c-4ae0-b12f-6d3254a07146"
}
}
But this actually doesn't do anything, nothing shows up in activity feed, not notifications are sent. (We have subscribers in those topics). I also checked the database and I don't see any records with transaction ID that we get back from the response. (I think mainly jobs collection) Also, took a quick look at API and worker logs but wasn't able to find anything useful. The way we trigger this was using the node SDK: (Also tried making an API call directly but the results were same)
const res = await novu.trigger('worklow', {
to: [
{
type: "Topic",
topicKey: 'my-topic',
},
],
payload: {
key: "value"
},
});
const res = await novu.trigger('worklow', {
to: [
{
type: "Topic",
topicKey: 'my-topic',
},
],
payload: {
key: "value"
},
});
However, if we send notification (trigger workflow) for individual subscribers, it works:
const res = await novu.trigger('worklow', {
to: 'subscriber-id',
payload: {
key: "value"
},
});
const res = await novu.trigger('worklow', {
to: 'subscriber-id',
payload: {
key: "value"
},
});
This sends the notification as expected and entry shows up in activity feed too. Thanks for your time. πŸ™
6 Replies
Ask Inkeep
Ask Inkeepβ€’3w ago
Hi @AN1RUDH, 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: * Payload * Topics * Angular * RedwoodJS -----------------------------
Ask Inkeep
Ask Inkeepβ€’3w ago
Answer It seems you're encountering an issue where triggering a workflow to topics does not result in notifications being sent, even though the operation is acknowledged as successful. This problem might be related to the configuration of your self-hosted environment, which could be missing specific environment variables required for the topics feature to function correctly. To address this, ensure that the environment variable IS_TOPIC_NOTIFICATION_ENABLED is explicitly set to true in your Docker Compose configuration. This setting is crucial for enabling topic-related notifications in a self-hosted setup (1) . Adding this variable directly to your docker-compose.yml file under the environment section for the relevant service should resolve the issue. Here is how you can add it:
environment:
- IS_TOPIC_NOTIFICATION_ENABLED=true
environment:
- IS_TOPIC_NOTIFICATION_ENABLED=true
Make sure to restart your services after making this change. If this configuration update does not resolve the issue, further investigation into the logs and setup would be necessary to diagnose the underlying cause of the failure to send notifications to topic subscribers. If the problem persists, it might be beneficial to revisit the setup and ensure all components are configured correctly. Please ensure to check this configuration and see if it resolves your issue. : Self-Host: Triggering workflow to topic subscribers doesn't work
AN1RUDH
AN1RUDHβ€’3w ago
ig I found the answer. I'll give it a shot.
Ask Inkeep
Ask Inkeepβ€’3w ago
Glad I could be helpful. Feel free to create a new thread with any new questions you may have.
AN1RUDH
AN1RUDHβ€’3w ago
This solved the issue βœ”οΈ
Pawan Jain
Pawan Jainβ€’3w ago
Thanks for the update @AN1RUDH πŸ™πŸ»
Want results from more Discord servers?
Add your server
More Posts