N
Novu9mo ago
duc_22.

python novu trigger topic to Slack not working in docker-compose

Hi Novu team, I built Novu locally using docker-compose, and trigger messages to a subscriber, it works well. But when triggering the topic, the message was not sent to multi-user or channel. Besides, I checked the log in API service container, I didn't see any error. I also tried to trigger the topic on Novu Cloud, it worked for me Image: ghcr.io/novuhq/novu 0.24.0.
6 Replies
Ask Inkeep
Ask Inkeep9mo ago
Hi @duc_22., 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: * How to use Novu to send notifications to a channel in a Discord server * Topics * SMS Channel Overview * Vue -----------------------------
Ask Inkeep
Ask Inkeep9mo ago
Answer To trigger a workflow to a topic, ensuring messages are sent to multiple users or channels, you should use the to field with a structure specifying type: 'Topic' and your topicKey. Here's how you can structure your trigger call:
const topicKey = 'your-topic-key';
await novu.trigger('<WORKFLOW_TRIGGER_IDENTIFIER>', {
to: [{ type: 'Topic', topicKey: topicKey }],
payload: {},
});
const topicKey = 'your-topic-key';
await novu.trigger('<WORKFLOW_TRIGGER_IDENTIFIER>', {
to: [{ type: 'Topic', topicKey: topicKey }],
payload: {},
});
(1) If you're experiencing issues with messages not being sent to multiple users or channels when triggering a topic, and you've verified that there are no errors in your API service container logs, it could be related to how the topic or workflow is set up in your local environment versus Novu Cloud. Ensure that: 1. The topic exists and has subscribers associated with it in your local Novu setup. 2. Your workflow is correctly configured to target the desired topic. 3. Your local Novu setup, including the Docker environment, is correctly configured and up-to-date. Since it works on Novu Cloud but not locally, double-check your local environment's configuration and version compatibility. The image version you mentioned, ghcr.io/novuhq/novu 0.24.0, should be checked to ensure it's compatible with your local setup and workflows.
Sources [1] Topics
Pawan Jain
Pawan Jain9mo ago
@duc_22. Could you please share your code snippet you used to trigger ?
duc_22.
duc_22.OP9mo ago
Hi @Pawan Jain , this is my code
No description
Pawan Jain
Pawan Jain9mo ago
@duc_22. if possible could you please share the payload value as well?
duc_22.
duc_22.OP9mo ago
@Pawan Jain for testing purposes so I pass payload={}
Want results from more Discord servers?
Add your server