NovuN
Novu2y ago
maybeNoT

Triggering workflow to topic subscribers doesn't work.

I've got simple workflow defined send-mail which is just simply sending mails. I've tested it and I'm receiving mails when I'm triggering it to single subscriber, but it doesn't work when I try to trigger that to the topic.

First I created the topic like so:
const createdTopic = await this.novu.topics.create({
   key: 'some-key',
   name: 'just name',
});


Then I added two subscribers like so:
const addedSubsToTopic = await this.novu.topics.addSubscribers('some-key', {
   subscribers: ['6617e3701da082efc8ee2f92', '285u3298591y691'],
});


And now I'm trying to trigger this worflow to the topic like this:
const { data } = await this.novu.trigger('send-mail', {
  to: [{ type: TriggerRecipientsTypeEnum.TOPIC, topicKey: 'some-key' }],
  payload: {},
});


I'm getting back the transaction id in a response:
{
  data: {
    acknowledged: true,
    status: 'processed',
    transactionId: '5e99a3ba-5329-4e9e-8d37-cb77a7eb9b48'
  }
}


But no actual mail is delivered, and there's no such transaction id on my Activity Feed.

I've got Novu self-hosted and deployed with docker.

Any help appreaciated.
Was this page helpful?