Flow Design Guide

Design interactive WhatsApp Flows in ChatYug without writing JSON. This guide covers why and how to use Flows in ChatYug, every designer component and its properties, starter templates, and what to do when Meta rejects a publish.

API / MCP: Generate or copy the same designs programmatically with flowJson — Commerce Flows API — Generate a flow design (per-node JSON, Image upload, analytics + media, ${data.*} / navigate payloads, product/order initialScreenData).

Why use Flow Design in ChatYug

WhatsApp Flows are Meta’s native in-chat forms (checkout, leads, surveys, appointments, support). ChatYug’s Flow Design module lets non-technical operators:

  • Build screens with drag-and-drop (n8n-style canvas).
  • Approve (= publish on Meta) from the same screen.
  • Test Send the published flow to any WhatsApp number.
  • Keep advanced JSON only as an escape hatch.

This is not the Chatbot keyword builder (Automation). Commerce Flows collect structured answers inside WhatsApp; chatbot flows automate replies with a different node engine.

How to use a Flow in ChatYug (end-to-end)

  1. Open WhatsApp Messaging → Flow Design (or Commerce → Flow Design).
  2. Click Create from template, choose a use case, and create the draft on Meta.
  3. In the designer: add/edit screens and components, connect screens with the purple port, then Save.
  4. Click Approve to publish on Meta (DRAFT → PUBLISHED). If Meta rejects, read the rejection panel (reason + fixes).
  5. Click Test Send and enter a number with country code (e.g. 919876543210).
  6. Open Analytics on the flow card to see sends and submissions (phone, name, time, payload) and export Excel.

Production paths after publish

PathWhen to useHow
Commerce checkout Cart / product checkout Copy Meta Flow ID into Commerce Settings → Checkout Flow ID. Enable auto-send if you want ChatYug to send the flow after a cart order.
Portal Test Send QA / demos Flow Design list or designer → Test Send.
External API / MCP Your CRM / AI assistant POST /api/external/messages/flow or MCP send_commerce_flow_message. Full manage + analytics: Commerce Flows API & MCP.
Customer answers Integrations + portal Webhook nfm_reply; also stored as Flow Analytics submit events. Checkout also hits ChatYug’s encrypted flow endpoint.

Create, list, and manage flows

  • Create: Flow Design → Create from template (50+ industry templates). You can create as draft, or use Create & Publish to Approve on Meta in one step. External API: POST /commerce/flows.
  • List: Flow Design home shows all drafts/published for the selected WABA; header strip shows Total / Draft / Published counts.
  • API list: GET /api/external/commerce/flows or MCP list_commerce_flows.

List page actions (per flow card)

ActionWhenWhat it does
DesignAnyOpens the drag-and-drop designer for that flow.
AnalyticsAnyOpens per-flow send/submit report and Excel export.
Approve / PublishDRAFTUploads JSON to Meta and publishes (DRAFT → PUBLISHED). ChatYug runs pre-publish checks first.
RejectionDraft with stored Meta errorsReopens the rejection panel (reason + fixes) without republishing.
Test SendPUBLISHEDSends the flow to a WhatsApp number (country code + digits).
DeprecatePUBLISHEDMarks the flow deprecated on Meta (can no longer be sent as a new message).
Copy IDHas Meta IDCopies Meta meta_flow_id (use for Commerce Settings checkout ID, API send, chatbot Flow Design Form node).
DeleteAnyDraft: removed from Meta and ChatYug. Published: deprecated on Meta first, then removed from ChatYug (Meta does not allow hard-delete of published Flows). Already-deprecated: removed from ChatYug only.
Sync (header)—Refreshes statuses from Meta for the selected WABA.

Analytics (from each flow card)

Analytics live inside Flow Design — not as a separate Messaging hub card. Each flow card shows mini send/submit counts and an Analytics button.

  • Opens a per-flow report: time, event type (send / submit), phone, name (when present), interaction payload summary.
  • Filters: date range, phone, event type.
  • Export Excel downloads customer submissions only (portal or GET /api/external/commerce/flows/analytics/export?flowId=). Flow-send rows are excluded. Each form answer becomes its own column (field labels from the flow when available).
  • Designer top bar also has Analytics for the open flow.

V1 records Test Send / API sends and customer completions. Meta per-screen open funnels are not available in ChatYug today.

Send a flow and receive filled answers

Send (portal)

  1. Publish with Approve (status must be PUBLISHED).
  2. Test Send → enter digits with country code (e.g. 917016793529), or from Start Chat use the green sitemap button to send a published flow while the 24-hour window is open.
  3. Conversations show an outbound Flow sent bubble; Analytics logs a send row.

Send (API / MCP)

POST /api/external/messages/flow or MCP send_commerce_flow_message. Pass your own flowToken so you can match the reply later. Details: Commerce Flows API.

Send (Chatbot Builder)

In Chatbot Builder v2, add a Flow Design Form node (whatsapp_flow). Choose a published Flow Design form (Meta meta_flow_id). The automation waits for the customer to submit, then stores each field as session variables. See Chatbot nodes — Flow Design Form. This is different from the Chatbot Flow node, which runs another automation.

Receive

Customer completion arrives as webhook interactive.type = nfm_reply. Parse response_json; keys = designer field Names; include flow_token for correlation. ChatYug also stores a readable Flow response bubble in Conversations and a Flow Analytics submit event.

const answers = JSON.parse(nfm_reply.response_json || '{}');
// answers.flow_token === the token from send
// answers.<field_name> === what the customer typed/selected

Full parse samples: Receive filled data.

Pre-publish checklist (ChatYug validates on Approve)

  • Terminal screens have a Footer
  • Unique UPPER_SNAKE_CASE screen IDs
  • Unique lowercase field names across the whole flow
  • ≥2 options on Dropdown / Radio / Checkbox
  • HTTPS image URLs
  • Navigate targets exist; data_exchange only if Commerce endpoint is configured

Use the Variables panel for ${form.field_name} (answers) and ${data.key} (init / endpoint data). Preview shows a phone frame of the selected screen; published flows may also show Meta’s preview_url.

Designer steps (canvas model)

  • Screen = a canvas node (one WhatsApp Flow screen).
  • Edge = routing from one screen to another (drag the purple out-port).
  • Components live inside the selected screen (left palette → drop or click).
  • Screen properties: ID (UPPER_SNAKE_CASE), Title, Terminal flag.
  • Terminal screens must end with a Footer (Meta requirement).
  • Top bar: Save · Approve · Test Send · Analytics · JSON · Help.
  • JSON opens the compiled Meta Flow JSON escape hatch (canvas layout is stored for round-trip and stripped before Meta upload).
  • Variables panel: insert ${form.field_name} (answers on this screen) and ${data.key} (values passed from a previous screen or endpoint).
  • Phone preview: right-hand frame of the selected screen; published flows may also show Meta’s preview_url.
  • Publish readiness strip above the canvas lists blocking issues; Approve stays disabled until they are fixed.

Component quick index

ComponentGroupKey properties
TextHeadingTexttext
TextSubheadingTexttext
TextBodyTexttext (may use ${data.*})
TextCaptionTexttext
RichTextTexttext
TextInputInputlabel, name, required, input-type
TextAreaInputlabel, name, required
DropdownInputlabel, name, required, options
RadioButtonsGroupInputlabel, name, required, options
CheckboxGroupInputlabel, name, required, options
DatePickerInputlabel, name, required
CalendarPickerInputlabel, name, required
OptInInputlabel, name, required
ImageMediasrc (HTTPS URL)
ImageCarouselMediaimage URLs (one per line)
PhotoPickerMedialabel, name, max KB, Require upload
DocumentPickerMedialabel, name, max KB, Require upload
EmbeddedLinkActionlink text, URL
NavigationListActionTitle|SCREEN_ID rows
FooterActionbutton label, action (complete / data_exchange / navigate)

Component reference

TextHeading

When: Start every screen with a clear title.

Step: Select screen → add Heading from Text palette → set text in the inspector.

Properties: text (required).

TextSubheading

When: Secondary title under the heading.

Step: Add Subheading → edit text.

Properties: text.

TextBody

When: Instructions or dynamic values such as order total.

Step: Add Body → set text. You may use ${data.order_total} when screen data provides that field (checkout).

Properties: text.

TextCaption

When: Small hints or legal notes under fields.

Properties: text.

RichText

When: Light formatting (e.g. **bold**) without adding an input.

Properties: text.

TextInput

When: Name, email, phone, PIN, short answers.

Step: Add Text Input → set Label, unique Name, Required, Input type (text, number, email, phone, etc.).

Properties: label, name (unique), required, input-type.

Prevent errors: Never reuse the same name on two fields.

TextArea

When: Comments, issue descriptions, notes.

Properties: label, name, required.

Dropdown

When: Single choice from a short list (payment method, issue type).

Step: Add Dropdown → set Label / Name → enter options as comma-separated titles.

Properties: label, name, required, options → Meta data-source.

RadioButtonsGroup

When: Visible single-choice list (ratings).

Properties: same pattern as Dropdown (comma-separated options).

CheckboxGroup

When: Allow multiple selections.

Properties: label, name, required, options.

DatePicker

When: Appointment or delivery date.

Properties: label, name, required.

CalendarPicker

When: Calendar-style date UI is preferred.

Properties: label, name, required.

OptIn

When: Consent / terms agreement.

Properties: label, name, required (mark required for mandatory consent).

Image

When: Show a product or brand image.

Step: Add Image → set public https:// src URL.

Prevent errors: Meta must be able to fetch the URL; avoid private or HTTP-only links.

ImageCarousel

When: Multiple images on one screen.

Step: One HTTPS URL per line in the inspector.

PhotoPicker

When: Customer uploads a photo (proof, KYC).

Properties: label, name, max file size (KB), Require upload. Meta forbids a required flag on PhotoPicker — ChatYug strips it on save. Turn on Require upload so min-uploaded-photos is 1 (and max-uploaded-photos stays 1 for complete payloads).

Answers: Submitted photos appear in Flow Analytics Attachments (thumbnails) and via External API / MCP as chatyug_url on the field.

DocumentPicker

When: Customer uploads a document (PDF, etc.). If the file MIME is video/*, Analytics treats it as video for preview/download — there is no separate VideoPicker in WhatsApp Flows.

Properties: label, name, max file size (KB), Require upload. Same Meta rule: never send required (even false). Use Require upload → min-uploaded-documents: 1 and keep max-uploaded-documents: 1 when the file is included in the Footer complete payload.

Answers: Appear in Flow Analytics Attachments and via API/MCP (list_flow_analytics, get_flow_media).

When: Link to terms or a help page.

Properties: link text, URL.

NavigationList

When: Menu that jumps to other screens.

Step: Enter rows as Title|SCREEN_ID (one per line). SCREEN_ID must exist on the canvas.

When: Every interactive screen needs a bottom button. Terminal screens must have a Footer.

Actions:

  • complete — close the flow (simple thank-you / done).
  • data_exchange — send form fields to ChatYug (checkout / endpoint flows). Requires Commerce endpoint + RSA when Meta health-checks.
  • navigate — go to another screen (set Next screen ID or connect ports).

Properties: button label, action, optional next screen.

Multi-screen variables

On a single screen, reference answers with ${form.field_name} (the field must exist on that same screen).

On a later screen, values from an earlier screen must use ${data.field_name}. Pass them in the previous screen’s Footer when action is navigate, for example:

"payload": { "interest": "${form.interest}" }

Then on the next screen body text can say You selected: ${data.interest}. Using ${form.interest} on screen 2 when interest is only on screen 1 is a common cause of Meta publish error 139002 / 4016011.

Publish readiness panel

The designer shows a Publish readiness strip above the canvas. It updates as you edit (debounced). When blocking issues exist, Approve is disabled until you fix them.

CodeMeaningFix
CROSS_SCREEN_FORM_REF${form.X} on a screen that does not contain field XUse ${data.X} and pass X in the previous navigate payload
TERMINAL_NAVIGATETerminal screen with Footer navigateUncheck Terminal or change Footer to complete
NO_TERMINALMulti-screen flow with no terminal screenMark the last screen Terminal with complete Footer
MULTIPLE_TERMINALMore than one terminal when screens navigateOnly the final screen should be Terminal
MISSING_DATA_REF${data.X} with no known source (navigate payload, screen data model, init key, or form field)Pass X via navigate payload, declare it on screen.data, use a known init key (e.g. product_name), or remove the reference
NAVIGATE_NO_TARGETFooter navigate points to missing screen IDFix Next screen ID or create the target screen

Templates

Core starters (also available in the industry catalog below):

TemplateCategoryWhat you getTypical next edit
CheckoutSHOPPINGDelivery fields + payment + success screenLabels, payment options; link Flow ID in Commerce Settings
Lead GenerationLEAD_GENERATIONName, business, email, phone, interest, opt-inInterest options; Test Send to sales phone
Lead + Follow-upLEAD_GENERATION2 screens: lead form → follow-up with ${data.interest}Customize follow-up question; use as pattern for multi-screen flows
SurveySURVEYRating radios + commentsRating labels
AppointmentAPPOINTMENT_BOOKINGName, phone, date, time slots, notesTime options
SupportCUSTOMER_SUPPORTIssue type + descriptionIssue dropdown values
BlankOTHEROne empty screen scaffoldBuild from palette

All templates use Footer action complete (publish-safe without a flow endpoint). Checkout / endpoint flows can switch the Footer to data_exchange after Commerce Settings are configured.

Industry template catalog (50+)

Create from template opens a grid grouped by industry. Each row is one publish-safe starter in the portal.

IndustryTemplateMeta category
GeneralLead GenerationLEAD_GENERATION
GeneralLead + Follow-up (2 screens)LEAD_GENERATION
GeneralBlankOTHER
GeneralContact UsCONTACT_US
GeneralNewsletter SignupSIGN_UP
GeneralWebinar RegistrationSIGN_UP
GeneralCustomer SurveySURVEY
GeneralNPS SurveySURVEY
GeneralSupport RequestCUSTOMER_SUPPORT
GeneralComplaint FormCUSTOMER_SUPPORT
ServicesAppointment BookingAPPOINTMENT_BOOKING
D2C / RetailCheckout (COD details)SHOPPING
D2C / RetailReturn / RMA RequestCUSTOMER_SUPPORT
D2C / RetailWarranty ClaimCUSTOMER_SUPPORT
D2C / RetailFashion Size PreferenceSURVEY
D2C / RetailJewellery Try-at-HomeAPPOINTMENT_BOOKING
D2C / RetailGrocery Delivery SlotAPPOINTMENT_BOOKING
D2C / RetailProduct FeedbackSURVEY
Food & HospitalityRestaurant Table BookingAPPOINTMENT_BOOKING
Food & HospitalityCatering EnquiryLEAD_GENERATION
Food & HospitalityHotel Room EnquiryLEAD_GENERATION
Food & HospitalityTravel Package EnquiryLEAD_GENERATION
Beauty & WellnessSalon AppointmentAPPOINTMENT_BOOKING
Beauty & WellnessGym Membership EnquiryLEAD_GENERATION
Beauty & WellnessSpa BookingAPPOINTMENT_BOOKING
HealthcareDoctor AppointmentAPPOINTMENT_BOOKING
HealthcareDental AppointmentAPPOINTMENT_BOOKING
HealthcareLab Test BookingAPPOINTMENT_BOOKING
HealthcarePharmacy RefillOTHER
HealthcarePet Clinic AppointmentAPPOINTMENT_BOOKING
EducationCourse EnquiryLEAD_GENERATION
EducationDemo Class BookingAPPOINTMENT_BOOKING
EducationTuition EnquiryLEAD_GENERATION
Real EstateSite Visit BookingAPPOINTMENT_BOOKING
Real EstateRent ApplicationLEAD_GENERATION
Real EstateInterior Design LeadLEAD_GENERATION
Home ServicesHome Service RequestCUSTOMER_SUPPORT
Home ServicesPackers & Movers QuoteLEAD_GENERATION
AutomotiveCar Service BookingAPPOINTMENT_BOOKING
AutomotiveBike Service BookingAPPOINTMENT_BOOKING
AutomotiveElectronics RepairCUSTOMER_SUPPORT
FinanceLoan Eligibility LeadLEAD_GENERATION
FinanceInsurance QuoteLEAD_GENERATION
FinanceMutual Fund InterestLEAD_GENERATION
Professional ServicesCA Tax Filing IntakeLEAD_GENERATION
Professional ServicesLegal ConsultationAPPOINTMENT_BOOKING
Professional ServicesVisa ConsultationLEAD_GENERATION
EventsWedding Photographer EnquiryLEAD_GENERATION
EventsEvent Hall BookingAPPOINTMENT_BOOKING
CommunityNGO Donation InterestOTHER
CommunityPooja / Temple BookingAPPOINTMENT_BOOKING
CommunityAstrology ConsultationAPPOINTMENT_BOOKING
B2BB2B Wholesale EnquiryLEAD_GENERATION
B2BFranchise EnquiryLEAD_GENERATION
B2BVendor OnboardingSIGN_UP
B2BJob Application IntakeSIGN_UP
AgricultureAgri Dealer EnquiryLEAD_GENERATION
EnergySolar Quote LeadLEAD_GENERATION

When Meta rejects Approve / Publish

ChatYug shows a rejection panel with three parts: What Meta said, What this means, and How to fix / prevent. The same guidance is summarized below.

Symptom (Meta / validation)What it meansHow to fix / prevent
Footer / terminal Final screen missing Footer or invalid Footer action Mark screen Terminal; add Footer; use complete or data_exchange; Save → Approve
routing_model / navigate Broken screen connections Reconnect ports; fix NavigationList Title|SCREEN_ID; remove edges to deleted screens
Screen ID Invalid or duplicate screen IDs Use unique UPPER_SNAKE_CASE IDs only
Duplicate / invalid field name Two inputs share name or name is illegal Unique lowercase names with underscores
version / data_api_version Unsupported Flow JSON version Prefer ChatYug templates; keep version 7.3 and data API 3.0 for endpoint flows
endpoint / RSA / health / data_exchange Endpoint flow without keys/URL Configure Commerce Settings endpoint + RSA, or switch Footer to complete for simple forms
data-source / dropdown / radio Empty or invalid options Provide at least two clear comma-separated options
image / src / media Bad or unreachable image URL Public HTTPS URL only; or remove Image components
required on PhotoPicker / DocumentPicker Meta INVALID_PROPERTY_KEY — property required is not allowed (even when false) Use inspector Require upload (min-uploaded-photos / min-uploaded-documents = 1). Save strips illegal required; Approve again

On the Flow Design list, drafts with stored validation_errors show Rejected by Meta — view details so you can reopen the same panel without republishing.