Documentation:Visual Flow Builder

Visual Flow Builder & Execution Simulator

The drag-and-drop conversational automation engine. Build intelligent branching logic, evaluate customer sentiment in real time, delegate queries to Google Gemini RAG nodes, and test customer journeys using the dry-run simulator.

1. Purpose of the Page

The Visual Flow Builder allows teams to design end-to-end conversational customer journeys without writing code. By chaining triggers, conditional filters, automated WhatsApp messages, AI responders, CRM actions, and human agent handoffs, businesses can provide instantaneous 24/7 self-service while escalating high-friction conversations directly to human agents in the Workspace Care Inbox.

2. Who Uses It (Target Roles)

Conversation Designers

Architects multi-step decision trees, FAQ routing branches, and user onboarding flows.

Customer Support Managers

Configures fallback escalation triggers, urgent sentiment handlers, and agent handoff thresholds.

Technical Product Leads

Tests routing logic in the interactive simulator and coordinates CRM webhook actions.

Interactive Visual Preview

FlowBuilderPage.tsx • /flows
6 Node Types
Customer Support & Triage Flow
Status: Active Engine • 5 Nodes, 4 Edges
▶ Open SimulatorSave Flow Layout
Trigger
Inbound Message
Matches any keyword or greeting
➔
Condition
Sentiment Check
Negative or Urgent?
➔
AI RespondGemini RAG
Knowledge Auto-Reply
Ground answer in indexed docs
Human HandoffUrgent
Escalate to Live Inbox
Alert agent & pause bot
Dry-Run Simulator:Test sample messages to inspect node routing before publishing to live users.
Input: “I need refund now!” ➔ Escalate (Handoff)

3. Step-by-Step: Designing a Workflow

  1. Place a Trigger Node: Drag a Trigger node onto the canvas. Set trigger criteria to match specific keywords (e.g. “price”, “catalog”) or accept any inbound message.
  2. Add Condition & Sentiment Routing: Connect the trigger to a Condition node. You can branch based on customer sentiment (positive, neutral, negative, urgent) or keyword contents.
  3. Configure Gemini AI & Outbound Messages: Route neutral or positive inquiries to an AI Respond node. This instructs the Gemini model to ground its response in your indexed Knowledge Base documents.
  4. Set Human Escalation Fallbacks: Route urgent inquiries or low-confidence replies to a Human Handoff node. This pauses AI auto-replies and alerts live agents in the Workspace Care Inbox.
  5. Test with Dry-Run Simulator: Click Open Simulator. Type a sample customer message (e.g. “Cancel my subscription immediately”), set the sentiment, and click Run. The visual nodes highlight in sequence, verifying your routing logic without sending actual WhatsApp messages.

4. Flow Node Types & Configuration Schema

Node TypeIdentifierKey ParametersOperational Role
TriggertriggertriggerType: 'keyword' | 'any_message'Entry point activated by incoming Meta Cloud API WhatsApp webhooks.
ConditionconditionconditionType: 'sentiment' | 'keyword'Evaluates user message properties and routes downstream along true/false edges.
Send Messagesend_messagemessageText: stringDispatches an immediate canned text message back to the customer on WhatsApp.
AI Respondai_responduseKnowledgeBase: boolean, systemPromptInvokes Google Gemini with RAG vector search to compose a grounded, dynamic response.
ActionactionactionType: 'add_tag', tagNameUpdates CRM contact attributes or assigns audience segmentation tags.
Human Handoffhuman_handoffreason: stringSets isHumanTakeover: true and marks thread as priority for live human agents.

5. Behind the Scenes: Asynchronous Flow Execution

When an inbound customer message passes signature verification, the backend executes the active flow graph:

  • Directed Acyclic Graph (DAG) Traversal: The flow engine evaluates nodes in topological order. Sentiment analysis runs against the message text to classify urgency.
  • RAG Vector Query: When hitting an ai_respond node, the engine computes a 768-dimension embedding, queries MongoDB Vector Search, and passes retrieved context to Gemini 1.5.
  • WhatsApp Dispatch: The resulting response is queued to BullMQ and sent to Meta Graph API endpoint /v20.0/{phone_number_id}/messages.

6. Common Errors & FAQs

Why are my messages not triggering the flow?

Ensure that your flow status toggle is set to Active and that only one primary flow is active per workspace. Check that the trigger node matches incoming keywords or accepts any message.

What happens if a customer sends a message when Human Handoff is active?

Once an escalation node is executed, automated flow routing and AI responses are muted for that specific customer conversation until a human agent manually reactivates the bot from the Workspace Care Inbox.