{
  "name": "Daily Govt Exam Quiz Delivery",
  "nodes": [
    {
      "name": "Daily Trigger",
      "type": "n8n-nodes-base.cron",
      "position": [
        250,
        300
      ],
      "parameters": {
        "cronExpression": "0 6 * * *"
      },
      "typeVersion": 1
    },
    {
      "name": "Fetch Question",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        450,
        300
      ],
      "parameters": {
        "range": "Sheet1!A2:F",
        "sheetId": "YOUR_GOOGLE_SHEET_ID",
        "valueRenderMode": "FORMATTED_VALUE"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "name": "Format Quiz",
      "type": "n8n-nodes-base.function",
      "position": [
        650,
        300
      ],
      "parameters": {
        "functionCode": "\nconst data = items[Math.floor(Math.random() * items.length)].json;\nreturn [{\n  json: {\n    question: data.question,\n    options: `A. ${data.optionA}\\nB. ${data.optionB}\\nC. ${data.optionC}\\nD. ${data.optionD}`,\n    correct: data.correctAnswer,\n    explanation: data.explanation || \"No explanation provided.\",\n    fullText: `\ud83e\udde0 *Daily Quiz Question*\\n\\n*Q:* ${data.question}\\n\\n${data.optionA ? \"A. \" + data.optionA : \"\"}\\n${data.optionB ? \"B. \" + data.optionB : \"\"}\\n${data.optionC ? \"C. \" + data.optionC : \"\"}\\n${data.optionD ? \"D. \" + data.optionD : \"\"}\\n\\n*Answer:* ${data.correctAnswer}\\n\ud83d\udcd8 Explanation: ${data.explanation || \"N/A\"}`\n  }\n}];"
      },
      "typeVersion": 1
    },
    {
      "name": "Send Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        850,
        100
      ],
      "parameters": {
        "text": "={{$json[\"fullText\"]}}",
        "subject": "Your Daily Govt Exam Quiz",
        "toEmail": "user@example.com",
        "fromEmail": "user@example.com"
      },
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "name": "Send to Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        850,
        300
      ],
      "parameters": {
        "text": "={{$json[\"fullText\"]}}",
        "chatId": "YOUR_TELEGRAM_CHAT_ID"
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "name": "Send via Twilio",
      "type": "n8n-nodes-base.twilio",
      "position": [
        850,
        500
      ],
      "parameters": {
        "to": "+1234567890",
        "from": "+1234567890",
        "message": "={{$json[\"fullText\"]}}"
      },
      "credentials": {
        "twilioApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "connections": {
    "Format Quiz": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send to Telegram",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send via Twilio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Trigger": {
      "main": [
        [
          {
            "node": "Fetch Question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Question": {
      "main": [
        [
          {
            "node": "Format Quiz",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}