WACM.in Logo
Back to API Reference
REST API v1MCP Supported (13 Tools)40+ Node Types

Flowmaker Visual Automation API

Inspect, create, update, validate, toggle, duplicate, and manage multi-step WhatsApp visual flows programmatically. Build rich automation graphs with trigger events, interactive reply buttons, Meta utility templates, conditional branching, AI agents, CRM actions, and staff notification alerts without touching UI.

Authentication & Scope: All requests use Sanctum Bearer tokens and JSON payloads against https://app.wacm.in/api/v1/flowmaker. All operations are tenant-scoped, verified for structural integrity before activation, and support instant draft versus live publish separation.

Flowmaker API & Graph Specs for AI Assistants and Developers

LLM Ready

Feed WACM API specs directly to Cursor, Claude, ChatGPT, Antigravity, or custom AI agents.

Download .mdOpenAPI 3.1
Machine-Readable Feeds:/llms.txt /llms-full.txt

Flowmaker Endpoints

GET
/flows

List conversational flows in this workspace. Supports search, active (1/0), page, and limit filters. Returns node/edge summary metrics.

GET
/flows/{id}

Read complete flow definition (or /flows/show?flow_id={id}) including nodes, edges, trigger settings, and published draft status.

POST
/flows

Create a new visual flow with name, active state, and initial graph nodes and edges. Runs structural validation before persisting.

PUT
/flows/{id}

Update flow graph structure (nodes & edges), name, or published status. Set publish: true to publish live immediately.

POST
/flows/{id}/toggle-active

Activate or pause a conversational flow. Enforces pre-flight structural checks to prevent orphan triggers or broken links.

POST
/flows/{id}/duplicate

Clone an existing conversational flow as an inactive copy for safe testing.

POST
/flows/{id}/discard-draft

Discard unpublished draft graph changes and revert to the live published version.

DELETE
/flows/{id}

Safely delete a flow and unlink connected triggers and reply listeners.

POST
/flows/validate

Validate graph structure (orphan nodes, disconnected branches, handle mismatches, missing settings) without saving.

GET
/node-types

Retrieve full catalog of 40+ supported node types with complete settings_schema, incoming/outgoing handles, runtime variables, and routing rules.

POST
/flows/ai-generate

Generate an optimized flow graph with nodes and edges from a natural-language business prompt.

GET
/history

Query paginated step-by-step execution logs for debugging. Filters: flow_id, contact_id, status, limit.

DELETE
/history

Clear execution history logs, optionally filtered by flow_id, contact_id, or before_date.

Graph Schema: Nodes & Edges

Flowmaker graphs follow standard React Flow topology. A valid flow requires at least one starter trigger on the left (e.g. keyword_trigger, order_created, or incoming_message) connected sequentially to action nodes via directed edges.

Node Structure
{
  "id": "node_template_cod",
  "type": "template",
  "position": { "x": 650, "y": 150 },
  "data": {
    "label": "Send COD Template",
    "settings": {
      "selectedTemplateId": 142,
      "parameters": {
        "BODY_1": "{{order_customer_name}}",
        "BODY_2": "{{order_order_number}}",
        "BODY_3": "{{order_total_amount}}",
        "BODY_4": "{{order_payment_method}}",
        "BODY_5": "{{order_items_text}}",
        "BODY_6": "{{order_customer_address}}",
        "BODY_7": "{{order_customer_phone}}"
      }
    }
  }
}
Edge Structure
{
  "id": "e_cod_confirm_to_tag",
  "source": "node_template_cod",
  "target": "node_tag_confirmed",
  "sourceHandle": "quick-reply-0",
  "targetHandle": null
}

Critical Edge Handle Matching Rules

When connecting nodes, the edge's sourceHandle string must strictly conform to backend execution routing:

Node TypeSource Handle NameSettings Schema KeysExecution Behavior
buttons / quick_repliesbutton-1, button-2, button-3body, activeButtons (1-3), button1, button2, button31-indexed! Matches customer tapping button 1, 2, or 3. Settings key is body (not message).
templatequick-reply-0, quick-reply-1, quick-reply-2, alwaysselectedTemplateId, parameters0-indexed! quick-reply-0 routes 1st button tap. Handle always continues immediately (ideal for reminder timers).
branch"true", "false"conditions: [{"variable", "operator", "value"}], logicType: "and"|"or"Evaluates variables with 11 operators (equals, contains, regex, etc.). Routes along "true" or "false".
send_ext_messagealwaysphone (with country code), messageSends external alert to staff/operations phone (e.g. 919662775074). Outgoing handle is always.
questionalways (or valid / invalid)question, variable, validation (optional)Pauses flow, collects customer answer into named state variable, then resumes downstream.
followup / delayalwaysdelay_minutes or delay_hoursPauses execution branch for configured time before sending follow-up or reminder message.
end—{}Cleanly terminates branch execution and flushes temporary flow state.

Webhook Runtime Variables

When flows trigger from webhooks (such as Shopify, WooCommerce, or WACM Shop), context data is automatically injected into state variables prefixed with the event scope:

Variable NameDescriptionExample Injected Value
{{order_order_id}}Internal store order identifier1042
{{order_order_number}}Customer-facing order number#1042
{{order_total_amount}}Total order amount1299.00
{{order_payment_method}}Payment gateway / payment methodCash on Delivery (COD)
{{order_customer_name}}Recipient full customer namePriya Sharma
{{order_customer_phone}}Customer phone number with country code919876543210
{{order_customer_address}}Full multi-line shipping addressFlat 402, Lotus Apt, Surat, Gujarat 395007
{{order_items_text}}Formatted items summary string1x Embroidered Kurti (M)
{{contact_last_message}}Customer's latest message or button click labelConfirm Order

Creating a Flow via API

Submit a POST /api/v1/flowmaker/flows request with your complete node and edge layout:

POST /api/v1/flowmaker/flows Payload
{
  "name": "Order Confirmation (COD & Prepaid)",
  "active": true,
  "nodes": [
    {
      "id": "node_trigger",
      "type": "order_created",
      "position": { "x": 100, "y": 200 },
      "data": { "label": "Order Created Event" }
    },
    {
      "id": "node_branch_payment",
      "type": "branch",
      "position": { "x": 350, "y": 200 },
      "data": {
        "label": "Is COD Order?",
        "settings": {
          "conditions": [
            { "variable": "order_payment_method", "operator": "contains", "value": "COD" }
          ],
          "logicType": "and"
        }
      }
    },
    {
      "id": "node_template_cod",
      "type": "template",
      "position": { "x": 650, "y": 100 },
      "data": {
        "label": "Send COD Template",
        "settings": {
          "selectedTemplateId": 142,
          "parameters": {
            "BODY_1": "{{order_customer_name}}",
            "BODY_2": "{{order_order_number}}",
            "BODY_3": "{{order_total_amount}}",
            "BODY_4": "{{order_customer_address}}"
          }
        }
      }
    },
    {
      "id": "node_template_prepaid",
      "type": "template",
      "position": { "x": 650, "y": 350 },
      "data": {
        "label": "Send Prepaid Template",
        "settings": {
          "selectedTemplateId": 143,
          "parameters": {
            "BODY_1": "{{order_customer_name}}",
            "BODY_2": "{{order_order_number}}",
            "BODY_3": "{{order_total_amount}}"
          }
        }
      }
    }
  ],
  "edges": [
    {
      "id": "e_trigger_to_branch",
      "source": "node_trigger",
      "target": "node_branch_payment"
    },
    {
      "id": "e_branch_to_cod",
      "source": "node_branch_payment",
      "target": "node_template_cod",
      "sourceHandle": "true"
    },
    {
      "id": "e_branch_to_prepaid",
      "source": "node_branch_payment",
      "target": "node_template_prepaid",
      "sourceHandle": "false"
    }
  ]
}