{
  "name": "Send multi-channel medication reminders to patients",
  "nodes": [
    {
      "id": "9d32e6a7-23c6-4b7f-962f-0c89922dab7d",
      "name": "New Sent Prescriptions",
      "type": "n8n-nodes-base.filter",
      "position": [
        80,
        0
      ]
    },
    {
      "id": "5d442586-a4b6-4598-a18a-b37b0df3c937",
      "name": "Create Reminder Schedule",
      "type": "n8n-nodes-base.code",
      "position": [
        300,
        0
      ]
    },
    {
      "id": "cf6ec37b-dc06-4b43-9c3d-710e0fc6559c",
      "name": "Save Reminders",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        520,
        0
      ]
    },
    {
      "id": "90bc4f7d-a268-401b-a396-a558cd1b69c9",
      "name": "Mark as Processed",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        740,
        0
      ]
    },
    {
      "id": "6c79fccb-2341-4691-883d-bb15cd535c7a",
      "name": "Check Every 10 Minutes",
      "type": "n8n-nodes-base.cron",
      "position": [
        -140,
        360
      ]
    },
    {
      "id": "5f7038d6-ee04-405a-8fe8-56ed35788e48",
      "name": "Get All Reminders",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        80,
        360
      ]
    },
    {
      "id": "5f896001-4438-45f5-836d-f64f1db05ad4",
      "name": "Find Due Reminders",
      "type": "n8n-nodes-base.code",
      "position": [
        300,
        360
      ]
    },
    {
      "id": "5b988a29-b3c0-49c6-8945-f88c4aab8226",
      "name": "Send WhatsApp",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        520,
        260
      ]
    },
    {
      "id": "7bef3271-5c4e-4762-bf33-37934232553b",
      "name": "Mark as Sent",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        740,
        360
      ]
    },
    {
      "id": "71ac37e9-cc85-486b-a4c9-3602a348ccc2",
      "name": "Watch Sheet For Trigger",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -140,
        0
      ]
    },
    {
      "id": "8a3e2ccf-311c-49b4-bf70-c09bab6960ee",
      "name": "Send email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        520,
        460
      ]
    },
    {
      "id": "e99dc597-81f4-4d4d-80db-39d7978ab3cd",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -660,
        -40
      ],
      "parameters": {
        "width": 600,
        "height": 180,
        "content": "### **Part 1: Schedule Creation**\n1. **Watch Sheet** → Monitors for \"sent\" prescriptions\n2. **Filter New** → Only processes unscheduled prescriptions  \n3. **Create Schedule** → Generates reminder time"
      }
    },
    {
      "id": "8df6854b-7213-45a4-88b0-f2c0d456c313",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -660,
        320
      ],
      "parameters": {
        "width": 540,
        "height": null,
        "content": "### **Part 2: Send Reminders** \n6. **Cron Timer** → Checks every 10 minutes\n7. **Get Reminders** → Retrieves all scheduled reminders\n8. **Find Due** → Identifies reminders due now\n9. **Send Messages**"
      }
    }
  ],
  "connections": {
    "Send email": {
      "main": [
        [
          {
            "node": "Mark as Sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send WhatsApp": {
      "main": [
        [
          {
            "node": "Mark as Sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Reminders": {
      "main": [
        [
          {
            "node": "Mark as Processed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get All Reminders": {
      "main": [
        [
          {
            "node": "Find Due Reminders",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Due Reminders": {
      "main": [
        [
          {
            "node": "Send WhatsApp",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Every 10 Minutes": {
      "main": [
        [
          {
            "node": "Get All Reminders",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Sent Prescriptions": {
      "main": [
        [
          {
            "node": "Create Reminder Schedule",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Watch Sheet For Trigger": {
      "main": [
        [
          {
            "node": "New Sent Prescriptions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Reminder Schedule": {
      "main": [
        [
          {
            "node": "Save Reminders",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}