Skip to main content

Event Payloads & Variables

Event payloads are JSON objects containing data about an occurrence in your system. Flowripple automatically extracts variables from payloads, making the data available throughout your workflows.

What is an Event Payload?

A payload is the JSON data you send when triggering an event. It contains context about what happened:
await flowripple.trigger('order.created', {
  orderId: 'ord_789',
  customer: {
    id: 'cust_123',
    email: '[email protected]',
    name: 'Jane Smith'
  },
  items: [
    { sku: 'PROD-001', quantity: 2, price: 29.99 },
    { sku: 'PROD-002', quantity: 1, price: 49.99 }
  ],
  total: 109.97,
  createdAt: '2024-01-15T14:30:00Z'
});
This payload contains:
  • Order identification (orderId)
  • Customer information (nested customer object)
  • Order items (array of products)
  • Order total and timestamp

Automatic Variable Extraction

When Flowripple receives a payload, it automatically extracts variables using dot notation paths:
Payload PathVariableTypeSample Value
orderIdtrigger.orderIdstringord_789
customer.idtrigger.customer.idstringcust_123
customer.emailtrigger.customer.emailstring[email protected]
customer.nametrigger.customer.namestringJane Smith
totaltrigger.totalnumber109.97
createdAttrigger.createdAtdate2024-01-15T14:30:00Z
All event variables are prefixed with trigger. to distinguish them from variables created by workflow steps.

Variable Properties

Each extracted variable has these properties:
PropertyDescription
PathDot notation path to the value (e.g., customer.email)
LabelHuman-readable name shown in the variable picker
TypeData type: string, number, boolean, date, object, array
SampleExample value from the expected payload

Type Detection

Flowripple automatically detects variable types based on values:

Strings

{ "name": "John Doe" }
Detected as string.

Numbers

{ "amount": 99.99, "quantity": 5 }
Both detected as number.

Booleans

{ "isActive": true, "hasDiscount": false }
Detected as boolean.

Dates (ISO 8601)

{
  "createdAt": "2024-01-15T10:30:00Z",
  "expiresAt": "2024-02-15T10:30:00.000Z"
}
Use ISO 8601 format for dates (YYYY-MM-DDTHH:mm:ssZ). Flowripple recognizes this format and provides date-specific functionality in workflow steps.

Objects

{
  "user": {
    "id": "usr_123",
    "profile": {
      "firstName": "John"
    }
  }
}
Nested objects are flattened into dot notation paths:
  • trigger.user.idusr_123
  • trigger.user.profile.firstNameJohn

Arrays

{
  "tags": ["premium", "verified"],
  "items": [{ "id": 1 }, { "id": 2 }]
}
Arrays are accessible as variables but individual elements require specific workflow logic to iterate.

Using Variables in Workflows

Reference variables in workflow step configurations using the {{variable.path}} syntax:

Email Step Example

To: {{trigger.customer.email}}
Subject: Order #{{trigger.orderId}} Confirmed
Body: Hi {{trigger.customer.name}}, your order total is ${{trigger.total}}.

HTTP Request Example

{
  "url": "https://api.example.com/orders",
  "body": {
    "externalOrderId": "{{trigger.orderId}}",
    "customerEmail": "{{trigger.customer.email}}",
    "amount": {{trigger.total}}
  }
}
Use the variable picker in any workflow step to browse available variables. Click on a variable to insert it at the cursor position.

Managing Variables

Viewing Variables

In the Events section of your dashboard, click on an event to view its extracted variables. Each variable shows:
  • Variable path
  • Detected type
  • Sample value from the expected payload

Editing Variable Labels

Variable paths are auto-generated, but you can customize the display labels:
  1. Navigate to the event in your dashboard
  2. Click on a variable to edit
  3. Update the label to something more descriptive
  4. Save changes

Regenerating Variables

If your payload structure changes, regenerate variables from a new expected payload:
  1. Edit the event’s expected payload
  2. Click “Regenerate Variables”
  3. Review the new variable list
  4. Save changes
Regenerating variables may affect workflows using the old variable paths. Review all workflows using the event after regenerating.

Payload Best Practices

Always send the same structure for a given event type. Inconsistent payloads lead to missing variables and workflow failures.
// Always include the same fields
await flowripple.trigger('user.signup', {
  userId: user.id,
  email: user.email,
  name: user.name || 'Unknown' // Provide defaults
});
Choose clear, descriptive names that explain the data:
// Good
{ "purchaseAmount": 99.99, "customerEmail": "[email protected]" }

// Avoid
{ "amt": 99.99, "e": "[email protected]" }
Keep nesting to 2-3 levels. Deep nesting creates long variable paths:
// Good
{ "user": { "email": "[email protected]" } }

// Avoid
{ "data": { "user": { "contact": { "email": { "primary": "[email protected]" } } } } }
Add creation timestamps for audit trails and time-based workflow logic:
{
  "orderId": "ord_123",
  "createdAt": "2024-01-15T10:30:00Z"
}

What’s Next?