Skip to content

Bot Flow Automation Recipes

Real-world flows you can build with ConnectGain's bot-flow builder, focused on the capabilities that bring full respond.io Workflows parity (and beyond): Jump To, Date & Time, Sub-flow, Google Sheets, Update Lifecycle, Close/Open Conversation, Add Comment, richer Branch logic, and the new triggers (Tag Updated, Field Updated, Lifecycle Updated, New Comment, Call Ended, Broadcast Response, Manual Shortcut).

Each recipe lists the trigger, the nodes in order, and the business value. Build them in Flows (/flows), publish, and they deploy to the n8n runtime automatically.

See also: Bot Flows user guide · respond.io parity spec · Automation & webhook use cases.


Table of Contents


Conversation control

UC-FLOW-001: Auto-Resolve & Close After a Satisfaction Reply

Business Scenario: After a bot answers an FAQ, it asks "Did that solve your issue?" and, on "yes", closes the conversation and tags the contact — keeping the inbox clean without an agent.

Flow: 1. Trigger: Message Received 2. Send Message: "Did that solve your issue? Reply YES or NO." 3. Collect Input → store as resolved 4. Condition (Branch): resolved contains "yes" (Match ANY with "y") - True → Add Comment ("Auto-resolved by bot") → Close Conversation - False → Handoff to agent 5. Publish

Business Value: Deflects resolved chats automatically, leaves an audit note, and routes only the unresolved ones to humans.


UC-FLOW-002: Reopen on Customer Reply

Business Scenario: When a customer replies to a previously closed conversation, reopen it so it resurfaces in the agent's queue.

Flow: 1. Trigger: Message Received 2. Open (Reopen) Conversation 3. Assign Conversation (availability-based) 4. Publish

Business Value: No customer message gets stranded in a closed thread.


Time-based routing

UC-FLOW-003: Business-Hours vs After-Hours Greeting

Business Scenario: During business hours, route new chats to a live agent; outside them, send an expectations-setting message and capture the request.

Flow: 1. Trigger: Message Received 2. Date & Time (timezone Africa/Cairo, windows Mon–Fri 09:00–17:00) - In hours → Assign Conversation → Send "An agent will be right with you." - Out of hours → Send "We're offline; we'll reply at 9 AM." → Collect Input (their question) → Add Comment with the captured text 3. Publish

Business Value: One flow handles both states with the correct timezone — no separate after-hours automation needed.


UC-FLOW-004: Weekend-Only Promotion Branch

Business Scenario: Offer a weekend-only discount code when customers ask about pricing on Saturday/Sunday.

Flow: 1. Trigger: Message Received 2. Condition: message contains "price" or "cost" (Match ANY) 3. Date & Time (windows Sat 00:00–23:59, Sun 00:00–23:59) - In hours → Send "Weekend special: use code WK15 for 15% off." - Out of hours → Send standard pricing link 4. Publish

Business Value: Time-gated offers without manual scheduling.


Lifecycle & segmentation

UC-FLOW-005: Promote to "Customer" on Purchase Confirmation

Business Scenario: When a contact confirms an order in chat, move them from Lead to Customer and notify the sales flow.

Prerequisite: Define stages in Settings → Lifecycle Stages (e.g. Lead, Opportunity, Customer).

Flow: 1. Trigger: Message Received 2. Condition: message contains "confirm" / "paid" (Match ANY) 3. Update Lifecycle → Customer 4. Add Tag: "Won" (mode: add) 5. Publish

Business Value: Lifecycle stays accurate automatically; the Lifecycle Updated trigger can kick off onboarding.


UC-FLOW-006: Onboarding Flow on Lifecycle Change

Business Scenario: The moment a contact becomes a Customer (by any path — bot, manual, or import), start an onboarding sequence.

Flow: 1. Trigger: Contact Lifecycle Updated 2. Condition: lifecycle_stage equals "Customer" 3. Send Message: welcome + onboarding checklist 4. Create Task: "Onboarding call" assigned to the account owner 5. Publish

Business Value: Decouples onboarding from how the stage changed — a single trigger covers every path.


UC-FLOW-007: React to a Specific Field Change

Business Scenario: When a contact's lead_score field is updated, re-evaluate routing.

Flow: 1. Trigger: Field Updated (Contact Updated, watch field = lead_score) 2. Condition: lead_score greater than or equal 80 3. Add Tag: "Hot" → Assign Conversation to a senior rep 4. Publish

Business Value: Fires only when the field you care about changes — not on every contact edit.


UC-FLOW-008: Tag-Driven Welcome

Business Scenario: When the "VIP" tag is added to a contact, send a white-glove greeting.

Flow: 1. Trigger: Contact Tag Updated 2. Condition: tags contains "VIP" 3. Send Message: VIP greeting → Add Comment: "VIP greeting sent" 4. Publish

Business Value: Tag changes become first-class automation triggers.


Data capture & integrations

UC-FLOW-009: Log Every Lead to Google Sheets

Business Scenario: The marketing team wants a live spreadsheet of inbound leads captured by the bot.

Prerequisite: Connect Google (Settings) — reconnect once to grant Sheets access.

Flow: 1. Trigger: Message Received 2. Collect Input: name → name 3. Collect Input: email → email 4. Google Sheets (Append Row): spreadsheet URL, tab Leads, values {{name}}, {{email}}, {{contact.phone}} (there's no {{now}} variable — let the sheet auto-timestamp with a =NOW column, or capture a value into a variable first) 5. Create Deal: "New web lead" in the Sales pipeline 6. Publish

Business Value: Captures structured lead data into a shared sheet and the CRM in one pass — no Zapier needed.


Campaign & post-call follow-up

UC-FLOW-010: Auto-Respond to Broadcast Replies

Business Scenario: After a WhatsApp campaign goes out, automatically engage contacts who reply, and tag them as engaged.

Flow: 1. Trigger: Broadcast Response (fires when a contact replies within 72h of receiving a campaign; carries campaign_id, campaign_name) 2. Add Tag: "Campaign Engaged" 3. Send Message: "Thanks for replying to {{campaign_name}}! Want to book a demo?" 4. Condition: reply contains "yes" → Sub-flow: Booking flow 5. Publish

Business Value: Turns broadcast replies into conversations instantly, with full attribution to the originating campaign.


UC-FLOW-011: Post-Call Follow-Up

Business Scenario: After every recorded call, send a follow-up message and log a note.

Flow: 1. Trigger: Call Ended (fires when the recording arrives; carries call id, contact, duration) 2. Send Message: "Thanks for the call! Here's a summary link…" 3. Add Comment: "Follow-up sent after {{duration_seconds}}s call" 4. Create Task: "Send proposal" (due in 2 days) 5. Publish

Business Value: No post-call follow-up slips through the cracks.


Agent-launched flows

UC-FLOW-012: One-Click "Send Pricing Pack" Shortcut

Business Scenario: Agents want to fire a multi-step pricing sequence from the inbox without typing it each time.

Flow: 1. Trigger: Manual Shortcut 2. Send Message: pricing PDF + intro 3. Add Tag: "Pricing Sent" 4. Update Lifecycle → Opportunity 5. Publish

Usage: In the inbox conversation header, open the ⚡ Shortcuts menu and pick "Send Pricing Pack." It runs for the current conversation, passing the contact context.

Business Value: Repeatable, on-demand playbooks an agent triggers in one click.


Modular flows

UC-FLOW-013: Reusable Booking Sub-flow

Business Scenario: Several flows need the same booking steps. Build it once and call it from anywhere.

Setup: - Booking flow (child): Trigger = Manual Shortcut (or any trigger) → collect date/time → create scheduled event → confirm. - Any parent flow: add a Sub-flow node pointing to "Booking flow", with pass current variables enabled.

Business Value: DRY flow design — update the booking logic in one place and every caller benefits.


UC-FLOW-014: Loop Back to the Main Menu with Jump To

Business Scenario: After completing any branch, return the user to the main menu instead of duplicating menu nodes.

Flow: 1. Trigger: Message Received → Send Message: main menu (1. Sales, 2. Support, 3. Hours) 2. Switch on the choice → each branch does its work 3. At the end of each branch, add a Jump To node targeting the main-menu Send Message node 4. Publish

Business Value: Clean, maintainable menus with no copy-pasted nodes; the Jump To resolves transparently at deploy time.


Multilingual

Full step-by-step, data shapes, and fallback rules: Building Multilingual Bot Flows.

UC-FLOW-015: One Bot, Many Languages (localized Quick Reply)

Business Scenario: A support bot must greet and menu customers in English, Arabic, and French — without maintaining three copies of the flow.

Flow: 1. Trigger: Message Received 2. Quick Reply — language picker: "Choose your language / اختر لغتك / Choisissez" with buttons English/العربية/Français. Enable Collect into variablelang, Save = payload (payloads en/ar/fr) 3. Quick Reply — main menu (single node): in the node's Content language selector, fill the Default (English) body + button labels, then add ar and fr and translate the body and each button label. Payloads stay shared. 4. Switch on the chosen menu option → localized answers 5. Publish

Business Value: One node per step serves every language; the customer's {{lang}} picks the right text at send time, missing translations fall back to Default. No branching, no duplicated flow.


UC-FLOW-016: Auto-Detect Language from the CRM

Business Scenario: Returning customers already have a preferred language on their contact record — don't ask again.

Flow: 1. Trigger: Message Received 2. Set Variable: lang = {{contact.language}} (or a custom field) 3. If Condition: lang is empty → fall back to the language-picker Quick Reply (UC-FLOW-015); else continue 4. Localized Quick Replies / Send Messages render in {{lang}} automatically

Business Value: Seamless, personalized experience for known contacts; only new contacts are asked to pick a language.


UC-FLOW-017: Localized Template Broadcast Follow-up

Business Scenario: After a multilingual WhatsApp campaign, replies should be answered with the right-language template.

Flow: 1. Trigger: Broadcast Response 2. Set Variable: lang from the contact's language 3. Send Message (template): set templateNameBase (e.g. promo_reply) — the engine appends __{{lang}} (promo_reply__ar, promo_reply__fr), falling back to __en 4. Quick Reply (localized) to continue the conversation

Business Value: Compliant, on-brand, right-language replies at campaign scale using your existing Meta templates.


AI + data

UC-FLOW-018: Let AI Offer Scheduler Slots to the Customer

Business Scenario: A booking bot should fetch real availability and have the AI phrase the options naturally ("I have Thu 3 PM or Fri 10 AM — which works?").

Flow: 1. Trigger: Message Received 2. Scheduler (operation get_slots, event_type_id set) → output variable available_slots 3. Transform (JMESPath) — input available_slots, expression [*].start, output slots_text 4. AI Response — prompt: "The available appointment times are: {{slots_text}}. Offer these to the customer and help them pick one." 5. Publish

Two gotchas this recipe avoids: - Adjacency: mid-flow variables reach the next node via the previous node's output, not the trigger-time snapshot — so the value-consuming node (Transform, then AI Response) must sit directly downstream of the node that produced it. - Shape: the Scheduler returns an array of { start, end } objects; dropping {{available_slots}} straight into a prompt renders as [object Object]. The Transform step projects it to plain strings ([*].start) so the model reads a clean list.

Note: the AI Response node interpolates {{variables}} in its prompt; the AI Agent node currently does not (its system prompt is sent as static text). Use AI Response when you need to inject flow variables like {{slots_text}} into the prompt.

Business Value: Real, bookable times phrased conversationally by AI — no hard-coded slot lists, no [object Object].

Troubleshooting — Transform output is null: the Transform reads its input by name from the session, and evalJmesPath(null, …) returns null, so a null output means the input wasn't found. Check, in order: 1. Scheduler → Output Variable = available_slots (exact, no braces). The Scheduler only persists the slots when this field is set — it's the most common cause. 2. Transform → Input Variable = available_slots — the bare name, not {{available_slots}} (braces break the lookup). 3. Transform → Expression = [*].start (applied to the array). If Input Variable is left blank, the expression runs against the whole vars object and must be available_slots[*].start instead. 4. Non-empty slots — with no availability in the window (default days_ahead ≈ 14) the Scheduler returns []. Widen days_ahead / confirm the event type has availability. 5. Isolate: drop a temporary Send Message after the Scheduler with body {{available_slots.0.start}} — blank ⇒ the Scheduler side (step 1/4); shows a time ⇒ the Transform config (step 2/3).


UC-FLOW-019: Book Appointments from Relative Dates

Business Scenario: Patients rarely give a full date — they say "tomorrow at 3 PM", "next Monday", "this Friday at 10 AM". The bot must turn that into a real appointment.

Why it used to break: the AI Agent's prompt had no reference to today, so the model invented a date (e.g. 2024-05-15) from its training data. The AI Agent (and RAG agent) now receive the current date/time at run time, so relative dates resolve correctly.

How a flow developer uses it: 1. Open the AI Agent node → set Timezone (for dates) to your clinic's IANA zone (e.g. Africa/Cairo). Blank = server/UTC (can be a day off near midnight). 2. No prompt change is required — the agent is auto-told the current date and instructed to output ISO 8601 (YYYY-MM-DDTHH:mm). Optionally add: "Resolve the patient's date/time, confirm it back in plain language, then book via the Scheduler." 3. Wire the booking, either: - Agent-as-booker: enable the Scheduler/booking tool on the agent, or - Agent-as-extractor: have the agent put the resolved ISO datetime in its Output Variable, then a downstream Scheduler node books it (read it by bare name — see data-flow rules). 4. Re-publish the flow — the current-date instruction is injected at Publish time, so changes only take effect after re-publishing.

Verify: in n8n → Executions, open the AI Agent input — the system message starts with Current date and time: …, and the emitted datetime matches. Test tomorrow at 3 PM, next Monday, in 3 days.

Business Value: patients book the way they talk; the agent produces correct, timezone-aware datetimes instead of hallucinated years.


Last Updated: June 2026