{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "13b60faa-76f3-4187-bb4f-31b0d35aa67e",
      "name": "Schedule Reel Posting",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        224,
        272
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "78a18cfd-ddb3-4e3e-918b-d054540e6a84",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        448,
        272
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "videoTopic",
              "type": "string",
              "value": "Create an engaging short video about daily motivation"
            },
            {
              "id": "id-2",
              "name": "caption",
              "type": "string",
              "value": "Daily motivation to inspire your day! #motivation #inspiration #reels"
            },
            {
              "id": "id-3",
              "name": "aspectRatio",
              "type": "string",
              "value": "9:16"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "811cbf4b-04fd-46b3-b447-333dd082f50e",
      "name": "Generate Video Prompt",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        672,
        272
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "={{ 'Generate a detailed video prompt for a short-form vertical video (9:16 aspect ratio) about: ' + $json.videoTopic + '. The prompt should describe visual scenes, camera movements, and mood in detail for video generation AI. Keep it under 200 words and focus on visual storytelling.' }}"
            }
          ]
        },
        "builtInTools": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "daf8aa14-018a-4956-8035-516c49b5e1a9",
      "name": "Generate Video with Veo",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        1024,
        272
      ],
      "parameters": {
        "prompt": "={{ $json.message.content }}",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "options": {
          "aspectRatio": "={{ $('Workflow Configuration').item.json.aspectRatio }}"
        },
        "resource": "video",
        "returnAs": "url"
      },
      "typeVersion": 1.1
    },
    {
      "id": "c8cd9db7-2cdf-4512-855f-ed28d6b76eda",
      "name": "Publish to Instagram",
      "type": "@mookielianhd/n8n-nodes-instagram.instagram",
      "position": [
        1248,
        272
      ],
      "parameters": {
        "node": "<__PLACEHOLDER_VALUE__Instagram Business Account ID__>",
        "caption": "={{ $('Workflow Configuration').item.json.caption }}",
        "resource": "reels",
        "videoUrl": "={{ $('Generate Video with Veo').item.json.url }}",
        "operation": "publish",
        "graphApiVersion": "v22.0"
      },
      "typeVersion": 1
    },
    {
      "id": "646164a1-78c2-4b51-bedb-5f9d5a17cfd6",
      "name": "\ud83d\udccb Setup Guide & How It Works",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        -160
      ],
      "parameters": {
        "color": 4,
        "width": 520,
        "height": 1376,
        "content": "## \ud83c\udfac Automated Instagram Reel Generator\n\n### \ud83d\udcd6 HOW IT WORKS\n\n**Flow Overview:**\n1. **Schedule Trigger** - Runs daily at 9 AM (customizable)\n2. **Workflow Configuration** - Defines video topic, caption, and aspect ratio\n3. **Generate Video Prompt** - Gemini AI creates detailed visual prompt for video generation\n4. **Generate Video with Veo** - Google Veo generates the actual video from prompt\n5. **Publish to Instagram** - Posts the reel directly to your Instagram account\n\n**Processing Time:** 2-5 minutes per video (Veo generation)\n\n---\n\n### \u2699\ufe0f SETUP GUIDE\n\n**Step 1: Google Gemini Credentials**\n- Get API key: https://ai.google.dev/\n- Add credentials to both \"Generate Video Prompt\" and \"Generate Video with Veo\" nodes\n- Select model: gemini-2.0-flash recommended for prompt generation\n- Select Veo model for video generation\n\n**Step 2: Instagram Credentials**\n- Requires Facebook Graph API access token\n- Needed permissions: instagram_content_publish, pages_read_engagement\n- Get started: https://developers.facebook.com/docs/instagram-platform/instagram-graph-api/get-started\n- Add credentials to \"Publish to Instagram\" node\n\n**Step 3: Configure Content**\n- Edit \"Workflow Configuration\" node\n- Set **videoTopic**: Your content theme (e.g., \"daily motivation\", \"tech tips\")\n- Set **caption**: Instagram caption with hashtags\n- Set **aspectRatio**: 9:16 for Reels (default)\n\n**Step 4: Adjust Schedule**\n- Edit \"Schedule Reel Posting\" trigger\n- Change time/frequency as needed\n- Consider API rate limits (don't post too frequently)\n\n**Step 5: Test Before Activating**\n- Click \"Test workflow\" to run manually\n- Verify credentials work\n- Check video quality and Instagram post\n- Activate workflow when ready\n\n---\n\n\n### \u26a0\ufe0f IMPORTANT NOTES\n\n- Check Google Gemini API quotas and pricing\n- Instagram has daily posting limits\n- Ensure workflow timeout > 5 minutes for video generation\n- Test thoroughly before scheduling\n\nDocs: https://docs.n8n.io/"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Generate Video Prompt": {
      "main": [
        [
          {
            "node": "Generate Video with Veo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Reel Posting": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Generate Video Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Video with Veo": {
      "main": [
        [
          {
            "node": "Publish to Instagram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}