{
  "schema_version": "1.0.0",
  "flow_uid": "book-appt-001",
  "entry_node_id": "n_11000_1",
  "meta": {
    "name": "Appointment Booking Flow",
    "description": "Schedule appointments"
  },
  "nodes": [
    {
      "id": "n_11000_1",
      "type": "trigger.inbound_message",
      "position": { "x": 100, "y": 50 },
      "data": {
        "label": "Inbound Message",
        "config": {
          "match_mode": "keyword",
          "keywords": ["book", "appointment", "schedule", "meeting"],
          "case_sensitive": false
        },
        "outputs": [{ "key": "out", "label": "Match" }]
      }
    },
    {
      "id": "n_11000_2",
      "type": "message.compose",
      "position": { "x": 100, "y": 200 },
      "data": {
        "label": "Select Service",
        "config": {
          "body_text": "What would you like to book?",
          "header_text": "Book Appointment",
          "footer_text": "Select service",
          "interactive_type": "button",
          "buttons": [
            { "id": "btn_consult", "title": "Consultation" },
            { "id": "btn_demo", "title": "Demo" },
            { "id": "btn_support", "title": "Support Call" }
          ],
          "list_data": null,
          "media_url": "",
          "media_type": "",
          "media_filename": ""
        },
        "outputs": [
          { "key": "btn_consult", "label": "Consultation" },
          { "key": "btn_demo", "label": "Demo" },
          { "key": "btn_support", "label": "Support" }
        ]
      }
    },
    {
      "id": "n_11000_3",
      "type": "message.compose",
      "position": { "x": 100, "y": 400 },
      "data": {
        "label": "Select Time",
        "config": {
          "body_text": "Select your preferred time slot:",
          "header_text": "Choose Time",
          "footer_text": "Select slot",
          "interactive_type": "button",
          "buttons": [
            { "id": "btn_morning", "title": "10:00 AM" },
            { "id": "btn_afternoon", "title": "2:00 PM" },
            { "id": "btn_evening", "title": "5:00 PM" }
          ],
          "list_data": null,
          "media_url": "",
          "media_type": "",
          "media_filename": ""
        },
        "outputs": [
          { "key": "btn_morning", "label": "Morning" },
          { "key": "btn_afternoon", "label": "Afternoon" },
          { "key": "btn_evening", "label": "Evening" }
        ]
      }
    },
    {
      "id": "n_11000_4",
      "type": "message.compose",
      "position": { "x": 100, "y": 580 },
      "data": {
        "label": "Confirmation",
        "config": {
          "body_text": "Your appointment has been scheduled! You'll receive a reminder 1 hour before. To reschedule, reply with 'RESCHEDULE'.",
          "header_text": "Booked!",
          "footer_text": "",
          "interactive_type": "none",
          "buttons": [],
          "list_data": null,
          "media_url": "",
          "media_type": "",
          "media_filename": ""
        },
        "outputs": [{ "key": "out", "label": "Next" }]
      }
    },
    {
      "id": "n_11000_5",
      "type": "action.tag_contact",
      "position": { "x": 100, "y": 750 },
      "data": {
        "label": "Tag Booked",
        "config": { "tag": "appointment-booked" },
        "outputs": [{ "key": "out", "label": "Next" }]
      }
    },
    {
      "id": "n_11000_6",
      "type": "control.end",
      "position": { "x": 100, "y": 900 },
      "data": {
        "label": "End",
        "config": { "result": "completed" },
        "outputs": []
      }
    }
  ],
  "edges": [
    { "id": "e_12000_1", "source": "n_11000_1", "target": "n_11000_2", "sourceHandle": "out", "targetHandle": "in", "condition": { "type": "always" }, "priority": 0 },
    { "id": "e_12000_2", "source": "n_11000_2", "target": "n_11000_3", "sourceHandle": "btn_consult", "targetHandle": "in", "condition": { "type": "always" }, "priority": 0 },
    { "id": "e_12000_3", "source": "n_11000_2", "target": "n_11000_3", "sourceHandle": "btn_demo", "targetHandle": "in", "condition": { "type": "always" }, "priority": 0 },
    { "id": "e_12000_4", "source": "n_11000_2", "target": "n_11000_3", "sourceHandle": "btn_support", "targetHandle": "in", "condition": { "type": "always" }, "priority": 0 },
    { "id": "e_12000_5", "source": "n_11000_3", "target": "n_11000_4", "sourceHandle": "btn_morning", "targetHandle": "in", "condition": { "type": "always" }, "priority": 0 },
    { "id": "e_12000_6", "source": "n_11000_3", "target": "n_11000_4", "sourceHandle": "btn_afternoon", "targetHandle": "in", "condition": { "type": "always" }, "priority": 0 },
    { "id": "e_12000_7", "source": "n_11000_3", "target": "n_11000_4", "sourceHandle": "btn_evening", "targetHandle": "in", "condition": { "type": "always" }, "priority": 0 },
    { "id": "e_12000_8", "source": "n_11000_4", "target": "n_11000_5", "sourceHandle": "out", "targetHandle": "in", "condition": { "type": "always" }, "priority": 0 },
    { "id": "e_12000_9", "source": "n_11000_5", "target": "n_11000_6", "sourceHandle": "out", "targetHandle": "in", "condition": { "type": "always" }, "priority": 0 }
  ],
  "variables": {},
  "settings": {
    "max_hops_per_message": 20,
    "fallback_behavior": "legacy_advance_bot",
    "timezone": "Asia/Kolkata"
  },
  "ui": {
    "viewport": { "x": 0, "y": 0, "zoom": 1 }
  }
}
