{
  "name": "Influencer Content Pipeline - MVP",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 9 * * 1"
            }
          ]
        }
      },
      "id": "schedule-trigger",
      "name": "Weekly Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://strategist:8000/execute",
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "={\n  \"persona_id\": \"{{ $json.persona_id }}\",\n  \"persona_name\": \"Luna Vibe\",\n  \"niche\": \"Fitness & Wellness\",\n  \"weeks\": 12\n}"
      },
      "id": "strategist-agent",
      "name": "Strategist Agent",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// Extract this week's plan from strategy\nconst strategyData = $input.first().json;\nconst weeklyPlans = strategyData.weekly_plans || [];\nconst currentWeek = weeklyPlans[0] || {};\n\nreturn {\n  persona_id: strategyData.persona_id,\n  persona_name: \"Luna Vibe\",\n  niche: \"Fitness & Wellness\",\n  week_plan: currentWeek,\n  content_ideas: currentWeek.content_ideas || []\n};"
      },
      "id": "process-strategy",
      "name": "Process Strategy",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        650,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://creative-generator:8000/execute",
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "={\n  \"persona_id\": \"{{ $json.persona_id }}\",\n  \"persona_name\": \"{{ $json.persona_name }}\",\n  \"niche\": \"{{ $json.niche }}\",\n  \"theme\": \"{{ $json.week_plan.primary_theme }}\",\n  \"content_type\": \"reel\",\n  \"platform\": \"instagram\"\n}"
      },
      "id": "creative-generator",
      "name": "Creative Generator",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        850,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://scheduler-publisher:8000/schedule",
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "={\n  \"persona_id\": \"{{ $json.persona_id }}\",\n  \"content_batch\": [{{ $json.content }}],\n  \"platforms\": [\"instagram\", \"tiktok\"]\n}"
      },
      "id": "scheduler",
      "name": "Schedule Content",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        1050,
        300
      ]
    },
    {
      "parameters": {
        "operation": "insert",
        "schema": "public",
        "table": "content_calendar",
        "columns": "persona_id,scheduled_date,platform,content_type,status,caption,content_data",
        "options": {}
      },
      "id": "save-to-supabase",
      "name": "Save to Supabase",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        1250,
        300
      ],
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Weekly Trigger": {
      "main": [
        [
          {
            "node": "Strategist Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Strategist Agent": {
      "main": [
        [
          {
            "node": "Process Strategy",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Strategy": {
      "main": [
        [
          {
            "node": "Creative Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Creative Generator": {
      "main": [
        [
          {
            "node": "Schedule Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Content": {
      "main": [
        [
          {
            "node": "Save to Supabase",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {},
  "staticData": null,
  "tags": [],
  "triggerCount": 1,
  "updatedAt": "2025-11-14T00:00:00.000Z",
  "versionId": "1"
}