N
Novu5d ago
Vivek

Dynamic Workflow Tags (for in app tabs)

Hi Team, we're using single workflow for sending different notification to user and we want to tag the same based notification being sent. eg. if we're sending user management notification then "user-management-tag" for other promotion type notification then "promotion-tag" Reference: https://docs.novu.co/workflow/introduction#tags Is there any way to dynamically assign tags based on payload params?
workflow(
"acme-login-alert",
async ({ step, payload }) => {
await step.inApp('inbox', async () => {
return {
subject: 'New Login Detected',
body: 'We noticed a login from a new device or location. If this wasn’t you, change your password immediately.',
};
});
},
{
tags: ['security'], // <= here = [payload.tag]
}
);
workflow(
"acme-login-alert",
async ({ step, payload }) => {
await step.inApp('inbox', async () => {
return {
subject: 'New Login Detected',
body: 'We noticed a login from a new device or location. If this wasn’t you, change your password immediately.',
};
});
},
{
tags: ['security'], // <= here = [payload.tag]
}
);
5 Replies
Novu_Bot
Novu_Bot5d ago
@Vivek, you just advanced to level 1!
Vivek
VivekOP5d ago
Also tags from workflow API in node js like above is not working. No tags are coming in in-app notification.
Pawan Jain
Pawan Jain4d ago
@Vivek Thanks for raising this issue. currently tags value can be hardcoded value. it can not be dynamic from payload. I am sharing this with team.
Also tags from workflow API in node js like above is not working. No tags are coming in in-app notification.
workflow created with api is not compatible with inbox
Vivek
VivekOP4d ago
Thanks @Pawan Jain for update.
Want results from more Discord servers?
Add your server