Skip to main content

Events and workflows

Events and workflows are the two core building blocks of Notifizz. Together, they define what happened, what to do about it, and who should know.

Events

An event represents something that happened in your application. You define events by giving them a name (a slug) and optional properties.
client.track({
  eventName: "order_shipped",
  sdkSecretKey: "SDK_SECRET_KEY",
  properties: {
    orderId: "ORD-4521",
    carrier: "FedEx",
    trackingUrl: "https://tracking.example.com/4521",
  },
});
Events are the trigger. On their own, they don’t send anything — they need at least one workflow attached to define what notification to produce.

Event properties

Properties are arbitrary key-value pairs that you attach to an event. They are used to personalize notification content in your workflow templates. For example, a {{ trackingUrl }} placeholder in your notification template will be replaced with the value you passed. Properties can contain any JSON-serializable data: strings, numbers, booleans, nested objects.

Workflows

A workflow (also called a campaign) is a template that defines what notification to send when an event is triggered. Workflows are configured in the Notifizz dashboard and referenced by their ID in your backend code.
client
  .track({
    eventName: "order_shipped",
    sdkSecretKey: "SDK_SECRET_KEY",
    properties: { orderId: "ORD-4521", carrier: "FedEx" },
  })
  .workflow("shipping_notification", [
    { id: "user_42", email: "alice@example.com" },
  ]);
A single event can trigger multiple workflows by chaining .workflow() calls:
client
  .track({ eventName: "order_shipped", sdkSecretKey: "SDK_SECRET_KEY", properties: { ... } })
  .workflow("shipping_notification", [{ id: "user_42", email: "alice@example.com" }])
  .workflow("ops_alert", [{ id: "ops_1", email: "ops@example.com" }]);
This is useful when the same event should produce different notifications for different audiences (e.g. a customer gets a shipping update while the ops team gets an internal alert).
Chaining workflows is one of the most powerful patterns in Notifizz. A single track() call can notify customers, internal teams, and third-party systems — all with different templates.

Recipients

Recipients define who receives the notification for a given workflow. Each recipient requires at minimum an id and an email:
{
  id: "user_42",
  email: "alice@example.com"
}
You can attach additional properties to recipients for use in templates or for your own tracking purposes.

Summary

ConceptWhat it isWhere it’s defined
EventSomething that happened in your appBackend code (client.track())
WorkflowA template for the notification to sendNotifizz dashboard, referenced by ID in code
PropertiesData attached to the event for personalizationBackend code (passed to track())
RecipientsUsers who should receive the notificationBackend code (passed to .workflow())

Next steps

Channels

Learn about the Notification Center and upcoming delivery channels.

Authentication

Secure the connection between your users and the widget.