Documentation

Event-driven automation workflows — build multi-step sequences with a visual canvas.

What are Flows?

Flows are event-driven automation graphs. Each flow is a visual graph of nodes connected by edges — when an event fires (a message arrives, a lead is created, a schedule ticks), the engine walks the graph, executing logic and actions step by step. Think of them as n8n-style workflows built into Neuron, with full access to your contacts, conversations, knowledge bases, and WhatsApp.

Building a Flow

Open Flows from the sidebar and create a new one. The visual canvas lets you:

  1. 1

    Add a trigger

    Every flow starts with a trigger node — the event that kicks it off. Drag one from the palette on the left (e.g. "Message received", "Lead created", "On a schedule").

  2. 2

    Add logic & actions

    Wire downstream nodes by clicking the "+" on an output port. Logic nodes route the flow (If/else, Switch, Filter, Loop, Delay); action nodes do things (Send message, Tag contact, Call API).

  3. 3

    Configure each node

    Click a node to open the inspector. Fill in the config — values support {{trigger.text}}, {{vars.myVar}}, and {{= expression}} templates that resolve at runtime.

  4. 4

    Enable the flow

    Toggle it on with the switch in the top bar. It starts listening for its trigger events immediately.

Start from a template — the "Create from template" menu offers ready-to-use flows like auto-reply, lead nurture, unsubscribe, and drip sequences that you can customize.

Triggers

Triggers are the entry points. A flow can have multiple triggers (any of them starts a run). Available triggers include: Message received (with keyword, media type, and sender filters), Message delivered / read, Lead created / converted, Contact created / tag added, Call received, Status reply, Group member joined, Webhook received, Schedule (interval or daily at a time), Broadcast completed, Wallet funded, Subscription renewed / payment failed, Social post published, Newsletter posted, Web agent run finished, Approval answered, and Manual (for testing). Every trigger also supports an advanced AND/OR condition builder for fine-grained filtering.

Logic Nodes

Logic nodes control the flow's path and data: **Branching:** If/else (condition → true/false paths), Switch (multi-way with conditions per case, each case is a wirable port), Filter (stop unless condition holds). **Timing:** Delay (wait seconds/minutes/hours/days), Wait until (specific datetime, time of day, or next business hours with timezone), Wait for reply (pause until the contact responds), Wait for event (pause until a domain event matches), Wait for approval (send a WhatsApp approval request, pause until approved/rejected), Wait for first-of (race multiple signals — reply vs event vs timeout). **Control flow:** Loop (repeat N times, while, or until a condition), For each (iterate over a list with optional batching and delay), Merge/Join (wait for parallel branches to converge), Call a sub-flow (synchronous call & return with typed input/output), Return (hand a value back to the calling flow), Stop (end a branch or fail the run). **Data:** Set variable, Set fields (multi-assignment mapper), Run code (sandboxed JavaScript), HTTP request (call external APIs with method/headers/body/auth). **AI:** AI Router (classify input into named routes using the LLM — each route is a wirable output port). **Safety:** Rate limit (Redis-backed "at most N per key per time window" with allowed/blocked paths), Log (write to run trace).

Action Nodes

Action nodes perform side effects: **WhatsApp:** Send message (text, image, video, audio, document — defaults to the triggering contact), Post to Status/Story (text or media, visible to all synced contacts), Close conversation. **Audience:** Add/remove tag, Add to/remove from list, Update contact (name, email, tags), Create contact (idempotent), Lookup contact (found/not-found branching), Add note (with semantic embeddings for search), Suppress contact (do-not-broadcast / do-not-auto-respond). **AI:** Generate with AI (run an LLM prompt, use the output downstream). **Composition:** Trigger another flow (fire-and-forget), Call a flow & wait (synchronous sub-routine with return value).

Templates

Neuron ships with ready-to-use flow templates you can create from the flows list page: • **Auto-reply on keyword** — reply when a message contains a word. • **New-contact welcome + tag** — greet first-time senders, wait for reply, tag as engaged. • **Lead → nurture** — delay a day after a new lead, then follow up. • **Enrich new contacts** — lookup on message, create if new, add note if returning. • **Unsubscribe on keyword** — suppress + remove tags + confirm. • **3-step drip sequence** — welcome → 1-day delay → follow-up → 3-day delay → final nudge. • **Out-of-hours auto-reply** — acknowledge instantly, follow up when business hours resume. • **Missed-call auto-reply** — incoming call → send a text. • **Approval-gated reply** — customer asks for refund → get admin approval → branch on decision.

Error Handling

Every action and logic node has an "Error handling" section in its inspector with two settings: **Continue on fail** — when enabled, a node that errors does not stop the run. Instead, the flow continues on the "error" output handle, so you can wire a fallback path. **Retry count + delay** — when set, a failing node is automatically retried up to N times with exponential backoff (base delay doubles each attempt). After all retries are exhausted, the error either fails the run or routes to the "error" handle (if continue-on-fail is also on).

Combine retry + continue-on-fail for resilient integrations: retry transient API failures 3 times, then send a notification on the error path if they all fail.

Template Syntax

Node config values support template expressions resolved at runtime: • **{{trigger.text}}** — the triggering event's data (message text, contact phone, sender name, etc.). • **{{vars.myVar}}** — a variable set by the Set variable or Set fields node. • **{{nodes.n_abc.output.text}}** — the output of a previous node (by node id). • **{{= amount * 1.1 }}** — inline JavaScript expressions (arithmetic, comparisons, ternary). Templates work in every text and textarea field across all nodes.

Runs & Debugging

Click the history icon in the flow builder to open the runs panel. Every execution is logged with its status (running, waiting, completed, failed, cancelled), trigger type, and timestamp. Click a run to see the full step trace — each step shows the node type, resolved input, output, which handle fired, and how long it took. Use this to debug flows: see exactly where a branch diverged, what a condition evaluated to, or why an action failed.

Building Flows via AI (MCP)

The Neuron MCP server exposes the full flow engine so AI agents can build, manage, and debug flows via natural language. Tools include neuron_get_flow_catalog (read the node registry), neuron_create_flow (build a graph from nodes + edges), neuron_run_flow (test with a sample payload), and neuron_get_flow_run (inspect the step trace). An agent can handle prompts like "build me a flow that auto-replies to price inquiries, waits for a reply, tags them as interested, then sends a follow-up the next day" end-to-end.

When asking an AI agent to build a flow, have it call neuron_get_flow_catalog first — the catalog describes every node type, its config fields, and output handles, giving the agent enough context to wire graphs correctly.