notiflowsDocs
LearnBuilding Notiflows

Trigger Step

The entry point for your notiflow

The trigger step is the starting point of every notiflow. When you trigger a notiflow via the API, execution begins at this step and flows through the connected steps.

How It Works

When you call the trigger API endpoint, you provide:

  • Recipient - The user who will receive the notification
  • Actor (optional) - The user who caused the notification to be sent
  • Data (optional) - Custom payload with dynamic content for templates

The trigger step receives this data and passes it to subsequent steps in the flow.

Triggering via API

Use the Admin API to trigger a notiflow:

curl -X POST https://api.notiflows.com/v1/notiflows/{notiflow_id}/trigger \
  -H "Authorization: Bearer {api_key}" \
  -H "Content-Type: application/json" \
  -d '{
    "recipient_id": "user_123",
    "actor_id": "user_456",
    "data": {
      "order_id": "ORD-789",
      "total": "$99.00"
    }
  }'

Or use the SDK:

import { Notiflows } from '@notiflows/node';

const notiflows = new Notiflows({ apiKey: 'your-api-key' });

await notiflows.notiflows.trigger('notiflow_id', {
  recipientId: 'user_123',
  actorId: 'user_456',
  data: {
    orderId: 'ORD-789',
    total: '$99.00'
  }
});

Data Context

The data you pass when triggering becomes available in templates:

ContextDescription
recipient.*Recipient user attributes (first_name, email, etc.)
actor.*Actor user attributes
data.*Custom payload you passed when triggering

See Templates for how to use these variables.

Connected Steps

The trigger step connects to the first action step in your flow. This is typically a channel step, but could also be a control step like wait or batch.

On this page