NovuN
Novu13mo 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]
  }
);
Was this page helpful?