Triggering Events
Trigger events from your application to start workflows. You can use the official Node.js SDK or make HTTP requests from any programming language.Using the SDK
The Flowripple SDK provides a simple, type-safe way to trigger events from Node.js applications.Installation
Initialization
Configuration Options
| Option | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | Your API key (starts with frp_) |
baseUrl | string | No | Custom API URL. Defaults to https://api.flowripple.com |
silent | boolean | No | If true, errors return false instead of throwing |
version | string | No | API version. Defaults to v1 |
Basic Trigger
trigger method accepts:
- identifier (string): The event identifier (e.g.,
user.signup) - data (object, optional): JSON payload with event data
- options (object, optional): Trigger options including idempotency key
Idempotent Requests
Use idempotency keys to safely retry requests without creating duplicate events. This is useful when network issues occur or you need to ensure exactly-once processing.user.signupwith keyabc123andorder.createdwith keyabc123are independent- The same key can be reused across different event types
- Maximum 256 characters
- Alphanumeric characters, hyphens (
-), underscores (_), colons (:), and periods (.) allowed
- The cached response is returned immediately
- No duplicate event is created
- The response includes
cached: trueto indicate it was served from cache
Error Handling
By default, failed triggers throw an error:Silent Mode
Enable silent mode to returnfalse on failure instead of throwing:
Using the HTTP API
Trigger events from any programming language using HTTP requests.Endpoint
Headers
| Header | Value |
|---|---|
Content-Type | application/json |
x-api-key | Your API key |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
identifier | string | Yes | Event identifier |
data | object | No | Event payload |
idempotencyKey | string | No | Unique key for idempotent requests (max 256 chars, alphanumeric + -_:.) |
Response
Success (200)Code Examples
Auto-Creation on First Trigger
When you trigger an event identifier that doesn’t exist, Flowripple automatically creates the event:- Uses the identifier as the event name
- Extracts variables from the payload
- Appears in your dashboard immediately
Auto-creation is convenient for development. For production, consider pre-creating events in the dashboard to define expected payload structures.
Best Practices
Store API keys securely
Store API keys securely
Never hardcode API keys in your source code. Use environment variables or a secrets manager:
Handle trigger failures gracefully
Handle trigger failures gracefully
Decide how your application should behave if an event trigger fails:
Send consistent payloads
Send consistent payloads
Always send the same fields for a given event type:
Use separate keys per environment
Use separate keys per environment
Create different API keys for development, staging, and production to isolate environments and manage access.
Use idempotency keys for critical events
Use idempotency keys for critical events
For important events like payments or order creation, always use idempotency keys to prevent duplicates:Good idempotency key patterns:
order-{orderId}-creation- for order eventspayment-{paymentId}-{timestamp}- for payment eventsuser-{userId}-signup- for one-time user events