Skip to Content

Webhooks

Preview

Start Luso8 workflows from your systems with a secret webhook URL, and call your own endpoints from workflows and campaigns.

Preview

This feature is in preview. The contract documented here is stable enough to build against, but details may still change before general availability.

Luso8 connects to your systems over HTTP in two directions today:

  • Inbound: your system calls a secret URL to start a Luso8 workflow.
  • Outbound: a Webhook step in a workflow or a campaign sequence calls your URL with JSON.

Event subscriptions are planned

Luso8 does not yet offer event subscriptions (registering one URL to receive events such as contact.created for the whole workspace). Until then, build the same thing with a workflow: trigger it on the event you care about and add a Webhook step that calls your endpoint.

Inbound: trigger a workflow

Any workflow whose trigger is Webhook gets its own secret URL. A POST to that URL starts a run, and the JSON body becomes the run's input.

Create the workflow

In Luso8, open AI tools›Workflows, create a workflow and set its trigger to Webhook.

Copy the webhook URL

Open the trigger settings to generate the URL. It has this shape:

https://api.luso8.rexplore.ai/api/v1/ai-workflows/hooks/<workflow_id>/<secret>

Activate the workflow

Compile and activate the workflow. Only active workflows accept webhook calls.

Send an event

curl -X POST "$LUSO8_WORKFLOW_WEBHOOK_URL" \
  -H "Content-Type: application/json" \
  -H "X-Event: order.paid" \
  -d '{
    "order_id": "ord_1042",
    "amount": 129.0,
    "currency": "USD",
    "customer": { "email": "ada@example.com", "name": "Ada Lovelace" }
  }'

A successful call returns the new run:

{
  "success": true,
  "run_id": "4a1f0c2e-6a51-4f7e-9d2b-1c8e5b9f3a77",
  "status": "pending",
  "dispatched": true,
  "message": "Workflow triggered"
}

Using the payload in steps

The body is available to every step as trigger (and as input for the first step). Step fields accept template expressions, so a notification message could read:

New order {{ trigger.order_id }} from {{ trigger.customer.name }} ({{ trigger.amount }} {{ trigger.currency }})

Missing fields resolve to empty values instead of failing, so {{ trigger.customer.phone or "no phone" }} is safe. A body that is not a JSON object (for example an array) is wrapped as {"data": ...}. The User-Agent, Content-Type and X-Event request headers are added under _headers.

Responses

StatusMeaning
200The run was created. dispatched: false means it is queued and will start shortly.
404 Webhook not foundWrong workflow ID or secret, or the workflow's trigger is not Webhook
409 Workflow is not activeActivate the workflow first

Treat the URL as a secret

The secret in the path is the only credential. Store the URL like an API key, never in client-side code. If it leaks, deactivate the workflow right away (inactive workflows reject webhook calls with 409), and contact hello@rexplore.ai to rotate the secret.

Outbound: call your endpoint

Add a Webhook step to a workflow or a campaign sequence to call your own API.

SettingDescription
URLMust start with https:// (or http://). Templates are allowed, for example https://example.com/hooks/{{ trigger.order_id }}.
MethodGET, POST, PUT, PATCH or DELETE. Defaults to POST.
HeadersKey-value pairs, templates allowed. Use them to authenticate to your endpoint.
BodyA JSON body, templates allowed. If you leave it empty, the step sends its input (the previous step's output or the trigger payload).
Ignore errorsBy default a response with status 400 or higher fails the step. Turn this on to continue anyway.

Requests time out after the step's timeout (at most two minutes). The step's output contains your endpoint's status code and response, so later steps can branch on it with a Condition step.

Securing your endpoint

Luso8 does not sign outbound requests yet. Protect your endpoint by checking a secret you choose:

  • add a header such as Authorization: Bearer <random-secret> in the step's Headers, and reject requests without it, or
  • include a long random token in the URL path and verify it on your side.

Always use HTTPS, and make your handler idempotent: a run can be retried, so the same event may arrive more than once.

Edit on GitHub

Last updated on

On this page