Skip to content

Automation (Flow)

Fire an event

Flow is the automation engine. Your system tells it something happened (“order placed”, “form submitted”) and every active flow whose trigger matches starts a run. This is the only way to fire an event from outside.

Built-in events (payment captured, stage changed, …) are fired by ECODrIx itself and are rejected here with RESERVED_TRIGGER. Define your own under custom events. A scoped key needs the flow:events or flow scope. Each run counts toward your plan’s monthly runs.

POST/v1/api/product/erix/events/trigger

Fire an event. Returns trigger, idempotencyKey and, when a contact was found or created, leadId.

triggerstringRequired
Your event name. No spaces, max 100 characters.
phone / emailstringRequired
The contact. One is required unless your plan includes Flow v1.
variablesobjectOptional
Flat key/value pairs available to the flow’s steps.
dataobjectOptional
Any extra payload.
leadDataobjectOptional
firstName, lastName, source for a new contact.
createLeadIfMissingbooleanOptional
Find or create the CRM contact and attach it to the run.*
delaySeconds / delayMinutes / runAtnumber / ISO dateOptional
Run later, up to 30 days ahead. Use only one.*
idempotencyKeystringOptional
Same key, same event: safe to retry.

* Needs Flow v1 on your plan. Without it these fields are ignored and listed in data.ignored.

await ecod.product.erix.events.trigger({
  trigger: "order_placed",
  phone: "+91XXXXXXXXXX",
  variables: { orderId: "ORD-1001", amount: "4999" },
  idempotencyKey: "ORD-1001",
});