{
  "name": "Daily 8:00 report (catch-up safe)",
  "settings": {
    "executionOrder": "v1",
    "timezone": "America/Los_Angeles"
  },
  "nodes": [
    {
      "id": "a1b2c3d4-0001-4000-8000-000000000001",
      "name": "Daily 8:00 report",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.4,
      "position": [
        0,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "days",
              "daysInterval": 1,
              "triggerAtHour": 8,
              "triggerAtMinute": 0
            }
          ]
        },
        "misfirePolicy": "coalesce_owner",
        "misfireGraceSeconds": 900
      }
    },
    {
      "id": "a1b2c3d4-0002-4000-8000-000000000002",
      "name": "How late is this run?",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        260,
        0
      ],
      "parameters": {
        "mode": "manual",
        "assignments": {
          "assignments": [
            {
              "id": "f1",
              "name": "scheduled_for",
              "value": "={{ $('Daily 8:00 report').item.json.timestamp }}",
              "type": "string"
            },
            {
              "id": "f2",
              "name": "started_at",
              "value": "={{ $now.toISO() }}",
              "type": "string"
            },
            {
              "id": "f3",
              "name": "minutes_late",
              "value": "={{ Math.max(0, Math.round($now.diff(DateTime.fromISO($('Daily 8:00 report').item.json.timestamp), 'minutes').minutes)) }}",
              "type": "number"
            },
            {
              "id": "f4",
              "name": "report_note",
              "value": "={{ $now.diff(DateTime.fromISO($('Daily 8:00 report').item.json.timestamp), 'minutes').minutes > 2 ? 'Late run: this report was due at ' + DateTime.fromISO($('Daily 8:00 report').item.json.timestamp).toFormat('ccc d LLL, h:mm a') + ' and ran at ' + $now.toFormat('h:mm a') + ' because n8n was offline.' : '' }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "a1b2c3d4-0003-4000-8000-000000000003",
      "name": "Build and send your report here",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        520,
        0
      ],
      "parameters": {}
    }
  ],
  "connections": {
    "Daily 8:00 report": {
      "main": [
        [
          {
            "node": "How late is this run?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "How late is this run?": {
      "main": [
        [
          {
            "node": "Build and send your report here",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": true
  }
}