Skip to content

feat(api-service): provider trigger overrides alignment #7448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
May 6, 2025

Conversation

scopsy
Copy link
Contributor

@scopsy scopsy commented Jan 7, 2025

What changed? Why was the change needed?

Per step override

novu.trigger('workflow-id', {
  to: 'sub-1',
  payload: {},
  overrides: {
    steps: {
      'step-1': {
        providers: {
          sendgrid: {
            ipPoolName: 'pool-1',
            'x-tracking-header-id': 55
          }
        }
      }
    }
  }
});

Whole workflow provider config

novu.trigger('workflow-id', {
  to: 'sub-1',
  payload: {},
  overrides: {
        providers: {
          sendgrid: {
            ipPoolName: 'pool-1',
            'x-tracking-header-id': 55
          }
    }
  }
});

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

@scopsy scopsy changed the title feat(api): provider trigger overrides alignment - WIP feat(api-service): provider trigger overrides alignment - WIP Jan 7, 2025
Copy link

pkg-pr-new bot commented Jan 7, 2025

Open in StackBlitz

npm i https://pkg.pr.new/novuhq/novu/@novu/framework@7448
npm i https://pkg.pr.new/novuhq/novu@7448
npm i https://pkg.pr.new/novuhq/novu/@novu/providers@7448
npm i https://pkg.pr.new/novuhq/novu/@novu/shared@7448

commit: debb52b

Copy link

netlify bot commented Jan 7, 2025

Deploy Preview for dev-web-novu ready!

Name Link
🔨 Latest commit c02d8eb
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/677d0f08675f310008e866bb
😎 Deploy Preview https://deploy-preview-7448.dashboard.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 7, 2025

Deploy Preview for dashboard-v2-novu-staging canceled.

Name Link
🔨 Latest commit debb52b
🔍 Latest deploy log https://app.netlify.com/sites/dashboard-v2-novu-staging/deploys/681a2f719d52c80008c17b70

const workflowGlobalProviderOverrides = overrides?.providers?.[integrationId] || {};
const triggerOverrides = stepId ? overrides?.steps?.[stepId]?.providers[integrationId] || {} : {};

return merge({}, bridgeProviderData, workflowGlobalProviderOverrides, triggerOverrides);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We deeply merge all levels:

  • Bridge
  • Trigger Workflow
  • Rrigger Step specific

in that order

@scopsy scopsy changed the title feat(api-service): provider trigger overrides alignment - WIP feat(api-service): provider trigger overrides alignment May 5, 2025
@scopsy scopsy requested a review from djabarovgeorge May 5, 2025 20:22
@scopsy scopsy merged commit 906cefa into next May 6, 2025
31 checks passed
@scopsy scopsy deleted the feat-provider-overrides branch May 6, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants