# WWeb BotForge Configuration Example # This is a comprehensive example showing all available configuration options # Copy this to ~/.config/wweb-botforge/config.yml and customize for your needs # Global system configuration chromium_path: "/usr/bin/chromium" # Path to your Chromium/Chrome installation api_port: 3000 # Port for REST API (set to enable the API) log_level: "info" # Log level: info, debug, warn, error default_timeout: 300 # Global default timeout for graph sessions (seconds) # Action Catalog — reusable actions that graphs reference by id # Actions are universal: not tied to any specific bot or graph actions: # Simple message action greet: steps: - message: body: "Hello! Welcome to our support chat. How can I help you today?" # Menu action with options menu: steps: - message: body: "Main menu:\n1. Hours & schedule\n2. Product catalog\n3. Talk to a human\n4. Pricing\n0. Exit" # Action with cooldown — same sender can't re-trigger within cooldown period escalate: guards: cooldown: duration: 120 # Seconds before same sender can trigger this again on_blocked: - message: body: "You already requested a human agent. Please wait, one will connect shortly." steps: - message: body: "Connecting you to a human agent. One moment please." - request: name: escalate-human url: "https://api.example.com/support/escalate" method: POST headers: Authorization: "Bearer your-api-token" timeout: 10000 retry: 3 # request-only action lead-notify: steps: - request: name: lead-capture url: "https://crm.example.com/leads" method: POST headers: X-API-Key: "your-crm-key" timeout: 5000 retry: 2 hours: steps: - message: body: "Our support hours:\n• Monday-Friday: 9:00 AM - 6:00 PM\n• Saturday: 10:00 AM - 2:00 PM\n• Sunday: Closed" catalog: steps: - message: body: "Here's our product catalog: https://example.com/catalog.pdf" pricing: steps: - message: body: "Our pricing starts at $29/month for the basic plan. Would you like more details?" invalid: steps: - message: body: "That option is not valid. Please choose a number from the menu." farewell: steps: - message: body: "Thank you! Have a great day. If you need anything else, just write 'menu'." pong: steps: - message: body: "pong!" # Send a WhatsApp location pin (combined with a text message) send-office: steps: - message: body: "Here is our office." - location: latitude: 19.4326 longitude: -99.1332 name: "Main Office" address: "Av. Reforma 123, CDMX" # Graph Catalog — conversation state machines owned by a single bot # Each graph has a root node, optional timeout, optional fallback, and a map of nodes graphs: # FAQ support graph with navigation menu faq-support: root: menu timeout: 300 # Session TTL (seconds) — session dies after inactivity fallback: invalid # Where to go if user sends an unexpected response nodes: menu: action: menu edges: - match: "1, hours, schedule, time, hours" fuzzy_threshold: 0.3 # 0.3=strict, 0.6=moderate (default), 0.9=loose goto: hours - match: "2, catalog, product, brochure" goto: catalog - match: "3, human, agent, person, talk, speak" goto: escalate - match: "4, price, pricing, cost" goto: pricing - match: "0, exit, bye, goodbye, end" goto: farewell - goto: invalid # Default edge (no 'match'): catches everything else hours: action: hours edges: - match: "menu, back, return, volver" goto: menu - match: "0, exit" goto: farewell - goto: invalid catalog: action: catalog edges: - match: "menu, back" goto: menu - match: "0, exit" goto: farewell - goto: invalid escalate: action: escalate # This action has cooldown edges: - match: "menu, back" goto: menu - match: "0, exit" goto: farewell - goto: invalid pricing: action: pricing edges: - match: "menu, back" goto: menu - match: "0, exit" goto: farewell - match: "interested, buy, order, quote" goto: lead - goto: invalid lead: action: lead-notify edges: - match: "menu, back" goto: menu - goto: farewell invalid: action: invalid edges: - goto: menu # Always return to menu after invalid input farewell: action: farewell edges: [] # No edges — session stays alive until timeout # Minimal single-node graph ping-pong: root: ping nodes: ping: action: pong edges: [] # Bot definitions — keys are the bot IDs, each bot references exactly one graph bots: # Support bot using the faq-support graph support-bot: graph: faq-support settings: queue_delay: 1500 ignore_groups: true # Ignore group messages ignored_senders: # Senders to ignore entirely - "status@broadcast" # WhatsApp status broadcasts # Sales bot reusing the same faq-support graph sales-bot: graph: faq-support settings: queue_delay: 1000 ignore_groups: false # Sales bot might engage in groups ignored_senders: [] # Actions can also be loaded from separate files in the actions/ directory: # ~/.config/wweb-botforge/actions/greet.yml # # Graphs can also be loaded from separate files in the graphs/ directory: # ~/.config/wweb-botforge/graphs/faq-support.yml # # File name becomes the action/graph ID. # Inline definitions in this file take precedence over directory files. # Notes: # - Actions, graphs, and bots all use the same map format: key = ID, value = definition # - Bot IDs are the keys in the bots map; they're auto-generated but you can customize them # - Each bot references exactly one graph by ID # - IDs can only contain lowercase letters, numbers, and hyphens (no start/end hyphens, no consecutive) # - Phone numbers are filled after WhatsApp QR code authentication # - Edge match phrases are comma-separated, fuzzy-matched (no regex needed) # - fuzzy_threshold: 0.3=strict, 0.6=moderate (default), 0.9=loose # - Action cooldowns prevent spam (per sender per action) # - Graph sessions automatically expire after timeout seconds of inactivity # - fallback handles unexpected user responses without breaking the graph # - Action reply templates support {{sender}}, {{message}}, {{bot.id}}, {{variables.name}} # - Location actions send a WhatsApp location pin; fields: latitude, longitude, name, address, url, description