{
  "name": "Generate Weekly Plan",
  "nodes": [
    {
      "id": "cron",
      "name": "Every Sunday 20:00",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        100,
        100
      ],
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "hour": 20,
              "minute": 0,
              "weekday": 0
            }
          ]
        }
      }
    },
    {
      "id": "http-build",
      "name": "Call Plan Endpoint",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        320,
        100
      ],
      "parameters": {
        "method": "POST",
        "url": "={{ $env.APP_URL + '/api/plan/generate' }}",
        "authentication": "headerAuth",
        "options": {
          "retryOnFail": true,
          "maxRetries": 3
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "slack",
      "name": "Notify Slack (optional)",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 1,
      "position": [
        540,
        100
      ],
      "parameters": {
        "channel": "fitness-notify",
        "text": "Weekly plan generation executed."
      },
      "disabled": true,
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "http-build": {
      "main": [
        [
          {
            "node": "Notify Slack (optional)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}