Trigerring workflow with topic not working.
Hi, I'm trying to use a simple topic to send email to somes subscribers. But its not working:
I'm on Java 11. using sdk Novu 1.5.0.
Calling like this:
I've also tryed with curl:
Ensuring that my topic exist with subscribers:
Get topic:
Get of subscriber:
14 Replies
Hi @Etigma, I'm an AI assistant for Novu. While a team member reviews this question, I'll look through relevant sources and see if I can provide suggestions. Please tag @Ask Inkeep with any follow-up questions.
-----------------------------
While I generate an answer, here are some sources that might be helpful:
* Java quickstart
* Go quickstart
* Kotlin quickstart
* .NET
-----------------------------
Answer
Based on the information you've provided, it looks like your setup and trigger event request are correctly structured. If you're experiencing issues with triggering a workflow using topics, ensuring that the topic and subscriber IDs are correctly set up and that the workflow ID you're using in your request matches one that's configured in your Novu environment is crucial.
For triggering a notification to a topic in Java, your approach appears aligned with Novu's recommended practices. If issues persist, confirm the following:
- The
topicId
used in setting t.setTopicKey(topicId);
matches the key
of an existing topic you've retrieved.
- The workflowId
used in triggerEventRequest.setName(workflowId);
is correct and corresponds to a configured workflow in Novu that is designed to send emails.
- Ensure that your Novu SDK version is compatible with the functionality you're trying to use. As you mentioned using Novu SDK 1.5.0, checking for any updates or discrepancies in the documentation might help.
- The subscribers are correctly identified and associated with the topic in question.
Additionally, verify the Novu environment setup, including API keys and any configurations specific to email or subscriber channel setups, to ensure they are correct and active.
If the problem persists, reviewing the Novu official documentation and ensuring your setup aligns with the latest guidelines might provide further insights.When i try to trigger the topic with this curl:
I receive:
But nothing in show in activity and no email is sent.
Here is the workflow in picture:
When i try the same things in the novu playground. Everything work fine.
The only difference in workflow is that there is a " "type": "REGULAR"," in the workflow of the playground.
Got it. Tagging @Support for additional help.
I'm using the 0.23 version
@Etigma
Thanks for sharing
I see there is some issue with topics in self hosting using docker.
I will keep you updated about this when we will fix this
Thanks
@Etigma, you just advanced to level 1!
When self-hosting, I have found that the
IS_TOPIC_NOTIFICATION_ENABLED
env var defaults to false. Have you set it to true in your environment?
When it’s not set to true, you see behaviour exactly like this. A trigger will succeed but start workflows for an empty subscriber list, basically doing nothing.@Pawan Jain seems like @Mei is 100% right here, can you confirm?
Thanks for sharing @Mei
TBH, I was not aware of this variable.
I spent almost 1 hour debugging the issue with @maybeNoT 🫠
@Etigma could you try setting this variable in api and worker service?
I currently do not have access to the environment. Will keep you updated.
Many thanks
Hello everyone,
I can confirm what @Mei wrote here. IS_TOPIC_NOTIFICATION_ENABLED env var should be changed. I had the same problem and with this thread I've fixed it. Tnx
Thanks @Veljko Sicevic Didimora !!