Qubit API v1

Automations

How the business builds a workflow on your events, and what it can do.

An automation is a workflow the business builds in the dashboard - Automation → New workflow - with one trigger, optional conditions, and a chain of actions. Your integration reaches it through the External API event trigger and POST /events (Business events). This page is for the person building the workflow and the developer sending the events, so the two agree on names and fields.

The shape of a workflow

trigger  →  condition?  →  action  →  action  →  wait?  →  action  →  end

Every workflow has exactly one trigger. Conditions filter which runs continue; a branch can send different contacts down different paths; a wait parks the run for minutes, hours or days; actions do the work. A workflow runs only once it is published - a draft never fires.

Triggers

Trigger Fires when
External API event Your system posts a named event - order.paid, booking.confirmed - through POST /events. The event name is the filter: one workflow per name, any number of workflows on the same name.
Message received A customer sends a message on a channel
Contact created A contact is created, by any path (an inbound message, an agent, an import, the API)
Tag added to contact A tag lands on a contact
Lead created · Lead stage changed The CRM pipeline moves
Lead form submitted A Facebook or Instagram lead form arrives
Social comment received A comment on a connected page or account
Scheduled time A clock - daily at 9:00, every Monday

For the External API event trigger the only setting is Event name, matched exactly against what your system sends. Keep names lowercase with dots: order.paid, order.shipped, cart.abandoned, appointment.booked, invoice.overdue.

What the workflow can read

Inside the workflow every text field - a message body, a note, a task title, a webhook body - accepts placeholders in double braces. For an External API event these are available:

Placeholder Value
{{event}} The event name, e.g. order.shipped
{{data.<key>}} Any key you sent under data, nested keys with dots: {{data.order_id}}, {{data.address.city}}
{{contact.first_name}}, {{contact.name}}, {{contact.phone}}, {{contact.email}}, {{contact.company}} … The contact the event named (by contact_id or identity)
{{lead.title}}, {{lead.value}} … The contact's lead, once an action has created or the run has loaded one

An unknown placeholder renders as an empty string - never as literal braces in a customer's message - so agree the data keys with the business before they build on them.

Conditions

A condition keeps the run going only when it holds; otherwise the run ends at that step, recorded as such.

Condition Checks
Contact has tag A tag on the contact
Contact lifecycle stage is lead, prospect, customer, churned
Contact country is The contact's country
Contact can be messaged Not opted out, not blocked, a reachable identity
Channel is The channel of the conversation or event
Text contains keyword Words in the message (message triggers)
Lead stage is The pipeline stage
Source is Where the lead came from
Assigned to The agent or team on the conversation
Replying to campaign The message answers a campaign
Current time is within A time window - business hours, a weekday

Actions

Action What it does Reads your data?
Send WhatsApp message A text or an approved template to the contact on their channel; template variables can be placeholders yes
Send email An email to the contact, or to a fixed address (the warehouse, the account manager) yes
Add tag Tags the contact - paid, vip, shipped -
Update contact Changes a field or the lifecycle stage (customer once paid) yes
Create lead Opens a lead in a pipeline with a title and value yes
Update lead Moves the contact's lead to a stage, or marks it won or lost -
Assign agent Routes the conversation to an agent or a team -
Create task A follow-up for an agent with a due date - "call about the refund in 2 days" yes
Notify user or team An in-app notification yes
Call webhook POSTs a JSON body you define to a URL of yours - the reverse of Webhooks, for a one-off callback yes
Reply to social comment Answers a comment on a connected page yes
Wait Parks the run for minutes, hours or days, then continues -

A worked example

The store from Integrating your system sends order.shipped with data: { order_id, courier, tracking_url, eta }. The business builds:

  1. Trigger - External API event, name order.shipped.
  2. Condition - Contact can be messaged.
  3. Send WhatsApp message - template order_shipped, variables {{contact.first_name}}, {{data.order_id}}, {{data.courier}}, {{data.eta}}.
  4. Add tag - shipped.
  5. Wait - 3 days.
  6. Send WhatsApp message - template delivery_check, variable {{data.order_id}}.
  7. Create task - "Check order {{data.order_id}} arrived", due in 1 day, for the support team.

Your store then only ever sends the event. The messages go out under the business's number, the message.* webhooks report each one back to you with the message's external_reference empty and its conversation_id set, and every run is visible step by step under Automation → Runs - the input, each action's outcome, any error - so "why did my customer get this?" is answered by reading, not guessing.

Running twice

The same event with the same dedupe_key (or the same Idempotency-Key) does not start a second run for the same contact. Sending order.shipped twice for order 10025 is safe. Two different events for the same order - order.paid then order.shipped - start two runs, as they should.

Chatbots

A workflow of kind Chatbot holds a conversation instead of reacting once. It starts from Message received or Conversation started and can pause until the customer answers:

Node What it does
Ask a question Sends a question and waits. Checks the answer (any, number, email, phone, date, a pattern), re-asks up to a number of times, stores it (var.<name>, contact.<field>, contact.custom.<key>, lead.<field>), then goes on - or down on_invalid / on_timeout
Menu Up to ten options, each a branch. WhatsApp shows reply buttons (up to three) or a list, Messenger and Instagram quick replies, Telegram an inline keyboard, web chat chips; email and LinkedIn get numbered text (1) Sales). The reply is matched by the tapped option's id, then its number, then its label, then its keyword aliases; nothing matched re-asks, then takes fallback
Capture Stores the customer's last message (its text, or the file they sent)
Set variable Stores a value for later nodes: {{var.<name>}}
Hand off to a person Routes the conversation (a team, a person, the routing rules), tags it, pins a note with every question and answer, notifies the assignee, and stops the bot
End Optionally a closing message and resolving the conversation
AI answer Answers free-text questions from the business's knowledge base; takes unsure when the model is not confident

{{reply}} is the latest answer and {{var.<name>}} any stored one, in every text field. The The reply condition branches on what the customer said (equals, contains, starts_with, regex, is_number, is_email, in_options).

One bot talks to a conversation at a time. An agent always wins: the moment a person replies in the inbox or assigns the conversation to someone, the bot stops and stays quiet on that thread for its pause window (24 hours unless the bot says otherwise). Every bot run is readable question by question under Automation → Runs, and your integration hears bot.started, bot.handoff (with the answers the bot collected) and bot.completed through Webhooks.

Auto-replies

Without building anything, each connected number, page or mailbox can send a welcome (a conversation's first message, or once a day), an away message (outside the business hours set under Settings → Business hours) and keyword answers; chat channels also a delay notice when nobody has answered within a few minutes. At most one auto-reply answers any customer message, none while a chatbot is talking, and no welcome or away once a person has replied. Each is an ordinary outbound message: it appears in the thread and in message.* webhooks like any other.

Where to look when nothing happens

Base URL https://communication-api.artofluminaire.com Every response carries X-Request-ID; quote it when you write to support.