{
  "name": "Daily Email Summary Workflow",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hours": 9
            }
          ]
        }
      },
      "id": "cron-trigger",
      "name": "Daily at 9 AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "url": "http://host.docker.internal:8000/api/users",
        "options": {
          "timeout": 10000
        }
      },
      "id": "http-get-users",
      "name": "Get All Users",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "batchSize": 1
      },
      "id": "loop-users",
      "name": "Loop Over Users",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        650,
        300
      ]
    },
    {
      "parameters": {
        "url": "=http://host.docker.internal:8000/webhook/summarize-user-docs?user_id={{$json.id}}",
        "options": {
          "timeout": 120000
        }
      },
      "id": "http-summarize",
      "name": "Summarize User Docs",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        850,
        300
      ]
    },
    {
      "parameters": {
        "from": "susandhungana090@gmail.com",
        "to": "={{$json.email}}",
        "subject": "Daily Document Summary",
        "emailFormat": "html",
        "options": {}
      },
      "id": "email-node",
      "name": "Send Email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 1,
      "position": [
        1050,
        300
      ]
    }
  ],
  "connections": {
    "Daily at 9 AM": {
      "main": [
        [
          {
            "node": "Get All Users",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get All Users": {
      "main": [
        [
          {
            "node": "Loop Over Users",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Users": {
      "main": [
        [
          {
            "node": "Summarize User Docs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize User Docs": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "id": "daily-email-summary-workflow"
}