Overview
SuprSend provides two distinct methods to trigger notification workflows: Event-Based Triggers and Workflow API Triggers. Both ultimately invoke the same workflow engine, but they differ in coupling, control, flexibility, and failure semantics. Choosing the right approach (or mixing both) depends on your architecture, notification type, and operational requirements. This guide lays out how each method works, when to prefer one over the other, and what trade-offs to keep in mind.How Each Method Works
Event-Based Trigger
Your system publishes an event to SuprSend via backend SDK, frontend SDK, HTTP API, or a third-party CDP like Segment. The event carries adistinct_id (identifying the user), an event_name, and a properties payload with relevant data.
SuprSend receives the event and checks if any live workflow is linked to that event name. If matched, SuprSend takes over — resolving the recipient from the user profile, computing target channels based on preferences, and executing the workflow.
Key characteristic: Your code knows what happened, not which workflow to run. The mapping from event to workflow(s) lives entirely in the SuprSend dashboard.
Check Send and Track Events doc for implementation details.
Check Send and Track Events doc for implementation details.
Workflow API Trigger
Here, you explicitly call a workflow using itsworkflow_slug, specifying the workflow and recipients directly in the API request. You control the full payload — including inline user and channel information if needed.
Key characteristic: Your code knows exactly which workflow to run and who should receive it. The mapping is explicit in code, not inside the dashboard.
Check Trigger Workflow from API doc for implementation details.
Check Trigger Workflow from API doc for implementation details.
Comparing both methods
| Dimension | Event-Based Trigger | Workflow API Trigger |
|---|---|---|
| Coupling | Loose — code emits events, SuprSend maps to workflows | Tight — code references workflow_slug directly. If there’s a mismatch in workflow slug on dashboard vs code, trigger fails. Treat workflow_slug as a stable API contract |
| User pre-creation | Mandatory — event is silently discarded if user doesn’t exist | Not mandatory — supports defining recipient inline (acts as UPSERT). Also supports anonymous/transient recipients via is_transient: true |
| Recipient resolution | Either pass the recipient’s distinct_id directly in the event call, or override recipient in workflow trigger settings on the SuprSend dashboard to resolve the actual recipient from event properties (you’ll need to pass a dummy recipient distinct_id in this case) | Recipients (user or object) are specified explicitly in the API request payload |
| Object triggers | Supported via override recipient — point to an event property containing the object_type and object_id | Supported natively — pass object_type and object_id directly in the recipients array. Recommended approach for sending to non-user entities like objects |
| One event → multiple workflows | Yes — a single event can fan out to many workflows | No — each API call targets one workflow |
| Payload schema validation | Supported - validates event properties with the defined schema and throws error in the API response if validation fails | Supported - validates workflow data with the defined schema and throws error in the API response if validation fails |
| Who controls workflow mapping | Product/ops team via dashboard | Engineering team via code |
| Adding new notifications | Dashboard-only change if added on an existing event | Requires code change for every new notification |
| CDP/Segment integration | Native fit — events flow through your existing data pipeline (Segment, Rudderstack, etc.) | Not applicable |
When to Use Event-Based Triggers
Event-based triggers are the right choice when:- Your architecture is event-driven. If you already publish domain events to a bus (Kafka, RabbitMQ, Segment) or use a microservices architecture where services communicate via events, adding SuprSend as a consumer is natural. You don’t need to add notification-specific API calls into your service code.
-
Notifications map cleanly to user actions. For user-initiated events —
POST_LIKED,COMMENT_ADDED,ORDER_PLACED,FRIEND_REQUEST_SENT— the event model is intuitive. The event already exists in your system; you just need to forward it to SuprSend. - You’re already syncing users to SuprSend. If you have a separate user sync pipeline (e.g., for storing preferences, channel info), events are a clean fit. User creation/update is decoupled from the notification trigger.
- You want product teams to iterate independently. Because the event-to-workflow mapping lives in the SuprSend dashboard, product or ops teams can add new notification workflows, change routing logic, or adjust channels without requiring engineering deployments.
-
One event should fan out to multiple workflows. For example, an
ORDER_PLACEDevent might trigger an order confirmation to the buyer, an alert to the seller, and an internal notification to the ops team — all from a single event. - You’re integrating via a CDP. If you use Segment, Rudderstack, or similar platforms, you can route events from your CDP directly into SuprSend. This avoids adding another integration point in your backend.
Watch Out For
- Silent failures. If the user doesn’t exist in SuprSend already, the event is silently discarded. There’s no error returned to the caller. You’ll need to monitor SuprSend logs or set up webhook callbacks to detect these.
- User sync reliability is critical. If your user sync fails for a user, all future event-triggered workflows for that user will fail silently. Build retries with backoff into your user sync pipeline — treat it as a critical dependency, not a fire-and-forget job.
- Not ideal for critical alerts. Since anyone with dashboard access can modify or disconnect event-to-workflow mappings, critical notifications (e.g., OTP delivery, payment confirmations) could break without engineering awareness. For high-stakes alerts where reliability is non-negotiable, prefer Workflow API triggers where the mapping is controlled in code.
- Debugging complexity. When a notification doesn’t fire, the root cause could be at multiple layers: event not sent, event sent but user not found, or workflow not linked to the event. The indirection adds debugging surface area.
When to Use Workflow API Triggers
Workflow API triggers are the right choice when:-
You don’t want to maintain a separate user sync. This is the biggest advantage. You can define users inline — it acts as an UPSERT function. Pass
distinct_idwith channel info, and SuprSend creates or updates the user as part of the trigger. No separate sync pipeline to build, monitor, or retry. - You’re sending system-generated or scheduled notifications. Daily digests, weekly reports, batch billing reminders, scheduled maintenance alerts — these originate from backend jobs, not user actions. There’s no natural “event” to emit; you’re programmatically deciding to notify.
-
You need to send to anonymous or transient users. OTP verification, magic link sign-in, or notifications to users who haven’t signed up yet. The Workflow API lets you pass
is_transient: truewith inline channel info, so no prior user creation is needed. - You’re migrating existing notifications to SuprSend. If you have an existing notification system and want to incrementally move workflows to SuprSend, the Workflow API is the path of least resistance. You replace your existing send calls with SuprSend API calls — no need to refactor your system into an event-driven model or set up user syncing first.
- You want engineering control over what triggers. Every trigger is an explicit API call in your codebase. This means triggers go through code review, are version-controlled, and can’t be accidentally modified via the dashboard.
Watch Out For
-
Tight coupling. Your code references specific
workflow_slugvalues. Renaming a workflow on the dashboard doesn’t change its slug, but if a workflow is deleted and recreated with a different slug, your code breaks. You’ll need coordination between dashboard changes and deploys. - No fan-out. Each API call triggers exactly one workflow. If a single business event should trigger multiple workflows, you need to make multiple API calls. Consider creating a helper/wrapper to manage this.
- More code changes for new notifications. Adding a new notification type always requires a code change and deployment, even if it’s added to an existing flow.
- User profile duplication risk. When you pass recipient details inline (e.g., email, phone), this data gets upserted to the user profile in SuprSend. If the same user is also being synced via a separate pipeline, the two sources can conflict — the API trigger may overwrite profile fields with stale or incomplete data, or vice versa.
Hybrid Approach: Using Both
In practice, most teams end up using both methods depending on the notification type.| Notification Type | Recommended Trigger |
|---|---|
| User action notifications (likes, comments, purchases) | Event |
| Transactional notifications requiring tight coupling with code (OTP, password reset) | Workflow API |
| Scheduled / batch notifications (digests, reports) | Workflow API |
| Notifications to anonymous users | Workflow API |
| Notifications to objects (departments, teams, topics) | Either — Workflow API for direct targeting, Event via override recipients when object ID is in event data |
| Notifications integrated via CDP (Segment, Rudderstack) | Event |
| Notifications where product team needs to iterate quickly | Event |
| Critical-path notifications where silent failure is unacceptable | Workflow API |
Best Practices
Idempotency
Both methods supportidempotency_key. Always use it for critical notifications to prevent duplicate sends on retries. SuprSend deduplicates requests with the same key for 24 hours.