Can't trigger workflows through topic, Novu Cloud

Hi, I'm trying to trigger a workflow with a topic that users have subscribed to. I'm using node @novu/framework and I trigger the event like this:
try {
const res = await chatMessageSentWorkflow.trigger({
payload: { dealId: opts.dealId },
to: {
type: 'topic',
topicKey: allTopicKey,
},
actor: {
subscriberId: opts.subscriberIdToExlude ?? '',
},
});

logger.info(
`Recieved novu workflow ${chatMessageSentWorkflow.id}, topic key ${allTopicKey} response: ${JSON.stringify(res.data)}`,
);
} catch (e) {
logger.error(
`Failed to trigger chat message on topic: ${allTopicKey}`,
e,
);
}
try {
const res = await chatMessageSentWorkflow.trigger({
payload: { dealId: opts.dealId },
to: {
type: 'topic',
topicKey: allTopicKey,
},
actor: {
subscriberId: opts.subscriberIdToExlude ?? '',
},
});

logger.info(
`Recieved novu workflow ${chatMessageSentWorkflow.id}, topic key ${allTopicKey} response: ${JSON.stringify(res.data)}`,
);
} catch (e) {
logger.error(
`Failed to trigger chat message on topic: ${allTopicKey}`,
e,
);
}
I can see this being printed in my logs: "Recieved novu workflow chat-message-sent-workflow, topic key topic-deal-73-all response: {"data":{"acknowledged":true,"status":"processed","transactionId":"f9b714ab-baa1-4184-a476-0ec9fcfb655e"}}" However no notifications are sent for the subscribers to that topic key and I can't find anything in the activity log for transaction id f9b714ab-baa1-4184-a476-0ec9fcfb655e Is there some way I can access more detailed logs for Novu Cloud?
4 Replies
Pawan Jain
Pawan Jain5mo ago
@Axel Dickson - does allTopicKey exist in your current environment - try with type: "Topic"
Axel Dickson
Axel DicksonOP5mo ago
Thanks @Pawan Jain for reply. The allTopicKey is set to topic-deal-73-all as shown in the logs and yes I can find that topic in the Dashboard for my environment with subscribers to it. I can try with "Topic" - however the workflow in @novu/framework is typed to "topic"!
No description
No description
Axel Dickson
Axel DicksonOP5mo ago
Changing it to "Topic" worked thanks! But I had to slam a @ts-ignore onto it
Pawan Jain
Pawan Jain5mo ago
Thanks for the sharing the bug with "topic" value in framework @Axel Dickson I am sharing this with team.

Did you find this page helpful?