{
  "SessionId": null,
  "CurrentStepId": 0,
  "Context": {},
  "DefaultFallbackMessage": "Sorry, I did not understand that. Please reply with one of the available options or type MAIN MENU.",
  "Triggers": [
    {
      "Keywords": [ "HI", "hi", "HELLO", "hello", "HEY", "hey", "START", "start", "MAIN MENU", "main menu" ],
      "StartStepId": 0
    },
    {
      "Keywords": [ "HELP", "help", "SUPPORT", "support" ],
      "StartStepId": 50
    }
  ],
  "Steps": [
    {
      "StepId": 0,
      "Type": "MESSAGE",
      "Message": "Hello! Welcome to GoodBooks ERP.",
      "NextStepId": 1,
      "AutoAdvance": true
    },
    {
      "StepId": 1,
      "Type": "INPUT",
      "Message": "Please enter your contact number:",
      "NextStepId": 2,
      "Validation": {
        "Required": true,
        "Regex": "^[0-9]{10}$",
        "ErrorMessage": "Please enter a valid 10-digit phone number."
      },
      "ContextKey": "PhoneNumber"
    },
    {
      "StepId": 2,
      "Type": "ACTION",
      "ActionType": "CALL_API",
      "Message": "Fetching your contact details...",
      "NextStepId": 3,
      "ContextKey": "ContactResponse",
      "ApiConfig": {
        "Url": "http://localhost:5000/EIPContact/GetEIPContact/?PhoneNumber={PhoneNumber}",
        "Method": "GET",
        "Headers": {}
      },
      "AutoAdvance": true
    },
    {
      "StepId": 3,
      "Type": "CONDITIONAL",
      "Message": "Checking contact info...",
      "ConditionKey": "ContactResponse.Body[0].Name",
      "Conditions": [
        {
          "Operator": "EXISTS",
          "NextStepId": 4
        }
      ],
      "DefaultNextStepId": 5
    },
    {
      "StepId": 4,
      "Type": "MESSAGE",
      "Message": "Hi {ContactResponse.Body[0].Name} — How are you?",
      "NextStepId": 6,
      "AutoAdvance": true
    },
    {
      "StepId": 5,
      "Type": "MESSAGE",
      "Message": "Hi! We couldn’t fetch your name. How are you?",
      "NextStepId": 6,
      "AutoAdvance": true
    },
    {
      "StepId": 6,
      "Type": "CHOICE",
      "Message": "What would you like to do today?",
      "Choices": {
        "Check Modules": 10,
        "Visit Website": 20,
        "Contact Support": 50
      }
    },
    {
      "StepId": 10,
      "Type": "MESSAGE",
      "Message": "Available modules:\n1. Accounting\n2. Inventory\n3. HR\n4. Sales",
      "NextStepId": 11,
      "AutoAdvance": true
    },
    {
      "StepId": 11,
      "Type": "INPUT",
      "Message": "Enter the module number to see details:",
      "NextStepId": 12,
      "Validation": {
        "Required": true,
        "Regex": "^[1-4]$",
        "ErrorMessage": "Please enter a valid module number (1-4)."
      },
      "ContextKey": "SelectedModule"
    },
    {
      "StepId": 12,
      "Type": "CONDITIONAL",
      "Message": "Checking module selection...",
      "ConditionKey": "SelectedModule",
      "Conditions": [
        {
          "Operator": "IN",
          "Value": [ "1", "2", "3", "4" ],
          "NextStepId": 13
        }
      ],
      "DefaultNextStepId": 14
    },
    {
      "StepId": 13,
      "Type": "MESSAGE",
      "Message": "Module details displayed successfully!",
      "NextStepId": 6,
      "AutoAdvance": true
    },
    {
      "StepId": 14,
      "Type": "MESSAGE",
      "Message": "Invalid module selection. Please try again.",
      "NextStepId": 11,
      "AutoAdvance": false
    },
    {
      "StepId": 20,
      "Type": "ACTION",
      "ActionType": "CALL_API",
      "Message": "Redirecting you to the official GoodBooks ERP website...",
      "NextStepId": 6
    },
    {
      "StepId": 50,
      "Type": "MESSAGE",
      "Message": "Support options:\n1. Technical\n2. Billing\n3. General Inquiry",
      "NextStepId": 51
    },
    {
      "StepId": 51,
      "Type": "CHOICE",
      "Choices": {
        "Technical": 52,
        "Billing": 53,
        "General Inquiry": 54,
        "Return to Main Menu": 6
      }
    },
    {
      "StepId": 52,
      "Type": "ACTION",
      "ActionType": "CALL_API",
      "Message": "A technical ticket has been created.",
      "NextStepId": 6
    },
    {
      "StepId": 53,
      "Type": "ACTION",
      "ActionType": "CALL_API",
      "Message": "A billing ticket has been created.",
      "NextStepId": 6
    },
    {
      "StepId": 54,
      "Type": "ACTION",
      "ActionType": "CALL_API",
      "Message": "A general inquiry ticket has been created.",
      "NextStepId": 6
    },
    {
      "StepId": 99,
      "Type": "END",
      "Message": "Thank you for using GoodBooks ERP. Have a great day!"
    }
  ]
}