docs
/
AppEngine API

Automation and workflow

Event-driven automations, AI-generated flows, and the generic task workflow engine with SLAs.

Two related but distinct systems. Automation reacts to events and runs actions. Workflow tracks work items moving through stages, with assignment, escalation and SLAs.

Automation

GET/automationJWT
POST/automationJWT
GET/automation/:automationIdJWT
PUT/automation/:automationIdJWT
DELETE/automation/:automationIdJWT

Running them:

POST/automation/start/:automationIdJWT
POST/automation/stop/:automationIdJWT
POST/automation/:automationId/executeJWT
GET/automation/status/:automationIdJWT

start and stop enable and disable an automation; execute runs it once immediately, which is how you test without waiting for a trigger.

GET/automation/healthJWT
GET/automation/dashboard/statsJWT
GET/automation/execution/historyJWT

How an automation is built

An automation has three parts:

PartRole
TriggerWhat starts a run — a record changing, a schedule, an inbound message, a webhook
ConditionWhat must hold for the run to continue
ActionWhat it does — send, create, update, call out, escalate

Interactive voice response flows are built the same way, with the call itself as the trigger.

Create lead (create_lead) creates the lead through the leads service — the same path as a lead added by hand, so it gets a lead number, a score and its pipeline stage. Its config takes firstName / lastName or fullName (split into the two), email, phone, company, jobTitle, notes, description, source, sourceDetails, pipelineId, stageId, assignedTo, value, tags and customFields; string values may use {{…}} variables from the triggering record (for a form submission, {{data.values.<field>}}). A variable that resolves to nothing is dropped rather than stored as {{…}}. Paired with a form_submission trigger, it is how a web form fills the pipeline.

Execution is asynchronous. automation.consumer and automation-trigger.consumer read from schedule-queue, so a long-running automation does not block the request that fired it.

Datatypes: automation, automation_execution, automation_log.

AI-assisted authoring

POST/automation/ai/generateJWT
POST/automation/ai/improveJWT
POST/automation/ai/validateJWT
POST/automation/ai/templatesJWT

Describe the automation in prose and get a definition back; validate checks one before saving.

IVR

Phone menus are automations. Calls route through ivr_routing and sms_routing records. See Voice and phone.

Workflow

A generic work-item engine — POS tickets, kitchen orders, reservations, approvals. Records are task, definitions are workflow_definition, and any BaseModel can carry one in its workflow field.

Definitions

GET/workflow/definitionJWT
POST/workflow/definitionJWT
POST/workflow/definition/from-template/:nameJWT
PATCH/workflow/definition/:idJWT
DELETE/workflow/definition/:idJWT

Templates are seeded by POST /business-made/setup/workflows.

Firing work

POST/workflow/fireJWT

The single primitive that creates a task against a definition. The POS "fire to kitchen" action and a reservation arrival both come through here.

Tasks

GET/workflow/taskJWT
GET/workflow/task/:taskIdJWT
GET/workflow/task/:taskId/historyJWT
POST/workflow/task/:taskId/advanceJWT
POST/workflow/task/:taskId/move-to/:stageIdJWT
POST/workflow/task/:taskId/completeJWT
POST/workflow/task/:taskId/cancelJWT
POST/workflow/task/:taskId/reassignJWT
POST/workflow/task/:taskId/noteJWT
POST/workflow/task/:taskId/archiveJWT
POST/workflow/task/:taskId/unarchiveJWT
POST/workflow/task/restartJWT

advance moves to the next stage in the definition; move-to/:stageId jumps to a named one.

SLAs and escalation

This is what distinguishes the workflow engine from a status field.

GET/workflow/task/:taskId/slaJWT
GET/workflow/escalation/breachedJWT
GET/workflow/escalation/upcomingJWT
POST/workflow/task/:taskId/snoozeJWT
POST/workflow/task/:taskId/escalate-nowJWT

upcoming is the list to act on; breached is the list to explain. Escalation runs on a queue processor (escalation.processor).

Analytics

GET/workflow/analytics/:workflowId/wait-timesJWT
GET/workflow/analytics/task/:taskId/etaJWT

eta predicts completion from historical wait times — what a customer-facing "ready in about 12 minutes" display uses.