Skip to main content
Salesive workflows are the store’s automations: “when an order is paid, wait a day, then email the customer”. Your app can plug into them in two ways:
  • Actions are steps your app performs. A merchant adds “Send an SMS (Your App)” to a workflow, maps values into its inputs, and when a run reaches the step Salesive sends a signed request to your app. What you answer is available to the steps after it.
  • Triggers are events your app reports. A merchant starts a workflow from “Loyalty tier changed (Your App)”, and your server fires it with one API call.
Both appear only on stores that have your app installed.

Declaring them

Open your app in Apps > Developer, then fill in Workflow steps with JSON:
Rules:
  • Up to 20 actions and 20 triggers. An id is lower case letters, numbers, _ or -, starts with a letter, at most 48 characters, and is unique in its list. label is required (80 characters), description is optional (300).
  • path is a path on the host of your webhook URL for the install’s environment, for example /salesive/workflow/send-sms. No host, query string or ...
  • Schemas are a small part of JSON Schema: an object with flat properties (at most 30) of type string, number, integer or boolean. Each may have title, description, enum, maxLength (strings), minimum and maximum (numbers), and required lists the properties that must be set. Nested objects, arrays and $ref are not supported.
  • Declaring actions needs a webhook URL, because that is where actions are sent and its secret is what signs them.
Changes take effect immediately on every store that has your app.

Receiving an action

  • Verify the signature exactly as for webhooks: base64 HMAC-SHA256 of the raw body with your webhook signing secret. A development install uses your development webhook URL and its own secret; production uses the production pair.
  • Inputs have already been checked against your inputSchema, and numbers and booleans arrive as JSON numbers and booleans.
  • run tells you where the call comes from. It carries ids and the trigger’s topic, never the trigger’s data or customer details: you receive what the merchant mapped into your inputs, nothing more. test is true for a test run from the builder.
  • Be idempotent. A call that times out or gets a 5xx is retried (3 attempts in all), always with the same id and X-Salesive-Event-Id. Each pass of a “For each” loop has its own id (iteration is set). Ignore an id you have already handled.

Answering

Answer within 10 seconds with a 2xx. To hand values to later steps, return JSON with an outputs object:
Later steps read them as {{nodes.<step>.outputs.messageId}}, or {{vars.<name>.messageId}} when the merchant saves the result under a name. Your address must be a public https host on port 443 (or http on 80). Private and local addresses are refused, so to test a development install from your machine use a public tunnel (for example cloudflared or ngrok) as your development webhook URL.

Firing a trigger

Your app needs the WRITE_WORKFLOW_TRIGGERS scope. Then:
  • Workflows of the store your token belongs to that start from this trigger run, with your payload as {{trigger.data.*}}. No other store is affected.
  • The body must match payloadSchema exactly: required fields present, declared types, no extra fields. A mismatch is a 400 listing the fields.
  • Idempotency-Key (optional, [A-Za-z0-9._:-], up to 128 characters) makes a retry safe: the same key never starts the same workflow twice.
  • The answer is 202 whether or not any workflow uses the trigger.

When a merchant uninstalls your app

Your tokens stop working, so your triggers cannot fire. Workflows that use your actions or triggers are paused, and the builder shows your steps as unavailable until the merchant reinstalls your app or removes them. Workflows containing app steps cannot be sold as marketplace templates.