Loading...
Loading...
Trigger Novu notification workflows to send messages across email, SMS, push, chat, and in-app channels. Supports single triggers, bulk triggers, broadcast to all subscribers, topic-based targeting, and cancellation. Use when sending transactional notifications, alerts, or any event-driven messages.
npx skill4agent add novuhq/skills novu-trigger-notificationimport { Novu } from "@novu/api";
const novu = new Novu({
secretKey: process.env.NOVU_SECRET_KEY,
});const result = await novu.trigger({
workflowId: "welcome-email",
to: "subscriber-123",
payload: {
userName: "Jane",
activationLink: "https://app.example.com/activate",
},
});const result = await novu.trigger({
workflowId: "welcome-email",
to: {
subscriberId: "user-456",
email: "jane@example.com",
firstName: "Jane",
lastName: "Doe",
},
payload: { userName: "Jane" },
});transactionIdconst result = await novu.trigger({
workflowId: "order-update",
to: "subscriber-123",
payload: { orderId: "order-789" },
transactionId: "unique-tx-id-abc",
});const result = await novu.triggerBulk({
events: [
{
workflowId: "welcome-email",
to: "subscriber-1",
payload: { userName: "Alice" },
},
{
workflowId: "welcome-email",
to: "subscriber-2",
payload: { userName: "Bob" },
},
],
});const result = await novu.triggerBroadcast({
// here name field is for workflowId
name: "system-announcement",
payload: {
message: "Scheduled maintenance at 2am UTC",
},
});const result = await novu.trigger({
workflowId: "project-update",
to: [{
type: "Topic",
topicKey: "project-alpha-watchers",
}],
payload: { update: "New release deployed" },
});transactionIdawait novu.cancel("unique-tx-id-abc");| Parameter | Required | Description |
|---|---|---|
| Yes | The workflow identifier (not display name) |
| Yes | Subscriber ID (string), subscriber object, or topic target |
| No | Data passed to the workflow, validated against |
| No | Provider-specific overrides per channel |
| No | Unique ID for idempotency and cancellation |
| No | Subscriber ID or object representing who triggered the action |
| No | Key-value pairs for multi-tenancy / organizational context |
const result = await novu.trigger({
workflowId: "alert",
to: "subscriber-123",
payload: { message: "Server down" },
overrides: {
"providers": {
"sendgrid": {
from: "alerts@example.com",
cc: ["user1@example.com", "user2@example.com"],
replyTo: "support@example.com",
}
}
},
});workflowIdsubscriberIdsubscribertransactionIdpayloadSchema