{
  "name": "Daily Cold Mailer + Follow-ups",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 8 * * *"
            }
          ]
        }
      },
      "id": "schedule-trigger",
      "name": "Every Morning 8 AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {},
      "id": "manual-trigger",
      "name": "Manual Run",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        240,
        480
      ]
    },
    {
      "parameters": {
        "jsCode": "// Merge both triggers \u2014 pass through unchanged\nreturn $input.all();"
      },
      "id": "merge-triggers",
      "name": "Start",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        460,
        380
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://followup-api:5050/run",
        "options": {
          "timeout": 200000
        }
      },
      "id": "run-emails",
      "name": "Run Email Runner",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        680,
        380
      ]
    },
    {
      "parameters": {
        "jsCode": "const item = $input.first().json;\nconst exitCode = item.exitCode ?? 0;\n\nconsole.log('\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550');\nconsole.log('Cold Mailer + Follow-up Runner output:');\nconsole.log(item.output || '(no output)');\nconsole.log('Exit code:', exitCode);\nconsole.log('\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550');\n\nif (exitCode !== 0) {\n  throw new Error('Email runner failed (exit ' + exitCode + '):\\n' + (item.output || item.error || ''));\n}\n\nreturn $input.all();"
      },
      "id": "log-results",
      "name": "Log Results",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        900,
        380
      ]
    }
  ],
  "connections": {
    "Every Morning 8 AM": {
      "main": [
        [
          {
            "node": "Start",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Run": {
      "main": [
        [
          {
            "node": "Start",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start": {
      "main": [
        [
          {
            "node": "Run Email Runner",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Email Runner": {
      "main": [
        [
          {
            "node": "Log Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "callerPolicy": "workflowsFromSameOwner"
  },
  "staticData": null,
  "tags": [
    "cold-mail",
    "follow-up"
  ]
}