{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "5432b2ed-adde-4021-b6b3-e75e43bd102c",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1152,
        3984
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5c21dec6-09d2-427e-89bc-2a1b809a0d40",
      "name": "Scrape Details",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -400,
        3952
      ],
      "parameters": {
        "url": "=https://api.apify.com/v2/acts/apify~instagram-profile-scraper/run-sync-get-dataset-items\n",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"usernames\": [\n        \"{{ $json.User }}\"\n    ]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth"
      },
      "credentials": {
        "httpQueryAuth": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.2
    },
    {
      "id": "5dd0aa9e-2197-46e4-adcc-c4fed6e0b002",
      "name": "Get Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -928,
        3984
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1dgkznTbUYCi6bzX_K2qRQT0WvmgTtPISWP9iyiLouyA/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1dgkznTbUYCi6bzX_K2qRQT0WvmgTtPISWP9iyiLouyA",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1dgkznTbUYCi6bzX_K2qRQT0WvmgTtPISWP9iyiLouyA/edit?usp=drivesdk",
          "cachedResultName": "Instagram Analysis"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "f316f5b7-e4be-42fd-8eb4-730cd2a8759c",
      "name": "Filter",
      "type": "n8n-nodes-base.filter",
      "position": [
        -672,
        3616
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "33016bc5-0c17-48c0-b77a-67c9b74584ac",
              "operator": {
                "type": "number",
                "operation": "equals"
              },
              "leftValue": "={{ $json.row_number }}",
              "rightValue": 2
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "37cf43bb-4e6b-462f-a34f-e0b4651e033d",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        352,
        3568
      ],
      "parameters": {
        "text": "=image: data",
        "options": {
          "systemMessage": "to go the url provided. analyze what is in the image. output the analyis and the image",
          "passthroughBinaryImages": true
        },
        "promptType": "define"
      },
      "executeOnce": true,
      "typeVersion": 2.2
    },
    {
      "id": "a690587f-4d14-4087-b255-67a152cc75fa",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        192,
        4064
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5",
          "cachedResultName": "gpt-5"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ac29d89e-49f2-4bbf-ba23-5fd00aa689d6",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -176,
        3552
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "latestPosts"
      },
      "typeVersion": 1
    },
    {
      "id": "0ad175a5-c1c8-498e-b6b0-1c36aabacb8d",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        16,
        3568
      ],
      "parameters": {
        "url": "={{ $json.displayUrl }}",
        "options": {}
      },
      "executeOnce": true,
      "typeVersion": 4.2
    },
    {
      "id": "c5f57bab-6350-4bf0-8524-75cbbca86321",
      "name": "Sticky Note53",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1248,
        3312
      ],
      "parameters": {
        "color": 7,
        "width": 2144,
        "height": 1056,
        "content": "### Scrape Instagram images with Apify and analyze them using OpenAI in n8n for fast visual insights (Google Sheets + HTTP + OpenAI)\n\nPull recent Instagram post media for any username, fetch the image binaries, and run automated **visual analysis** with OpenAI \u2014 all orchestrated in n8n. Use a Google Sheet to supply target usernames and store results anywhere you like.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "38a41e2a-85bd-4e73-9513-1cc6b3277735",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1696,
        3312
      ],
      "parameters": {
        "width": 400,
        "height": 1056,
        "content": "\n\n## \u2699\ufe0f Setup (minimal credentials)\n### 1) Connect Google Sheets (OAuth2)\n1. In **n8n \u2192 Credentials \u2192 New \u2192 Google Sheets (OAuth2)**  \n2. Sign in with your Google account and grant access  \n3. In the **Get Google Sheet** node, select your **Spreadsheet** and **Worksheet** with a `user` column (the example uses the \u201cMulti Scraper\u201d sheet)\n\n### 2) Connect Apify (HTTP Query Auth)\n1. Get your **Apify API token** (Apify Console \u2192 *Integrations/API*)  \n2. In **n8n \u2192 Credentials \u2192 New \u2192 HTTP Query Auth**, add a query param `token=<YOUR_APIFY_TOKEN>`  \n3. In the **Scrape Details** node, pick that credential. The URL is set to  \n   `https://api.apify.com/v2/acts/apify~instagram-profile-scraper/run-sync-get-dataset-items`  \n   The body passes `usernames: [\"{{$json.user}}\"]` from the Google Sheet row.\n\n### 3) Connect OpenAI (API Key)\n1. In **n8n \u2192 Credentials \u2192 New \u2192 OpenAI API**  \n2. Paste your **OpenAI API key**  \n3. In **OpenAI Chat Model**, select your credential and a **vision-capable** chat model (e.g., `gpt-4o-mini`, `gpt-4o`, or your configured vision model)\n\n> That\u2019s it. No other services required.\n\n-\n\n## \ud83d\udcec Contact  \nNeed help customizing this (e.g., filtering by campaign, sending reports by email, or formatting your PDF)?  \n\n- \ud83d\udce7 **rbreen@ynteractive.com**  \n- \ud83d\udd17 **[Robert Breen](https://www.linkedin.com/in/robert-breen-29429625/)**  \n- \ud83c\udf10 **[ynteractive.com](https://ynteractive.com)**\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e8a37bc8-a2db-4eea-ae7f-3b13b647f6e5",
      "name": "Sticky Note61",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        3664
      ],
      "parameters": {
        "color": 3,
        "width": 224,
        "height": 496,
        "content": "### 1) Connect Google Sheets (OAuth2)\n1. In **n8n \u2192 Credentials \u2192 New \u2192 Google Sheets (OAuth2)**  \n2. Sign in with your Google account and grant access  \n3. In the **Get Google Sheet** node, select your **Spreadsheet** and **Worksheet** with a `user` column (the example uses the \u201cMulti Scraper\u201d sheet)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b24c1d5f-9070-4578-bd70-6c4711545818",
      "name": "Sticky Note63",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -464,
        3504
      ],
      "parameters": {
        "color": 3,
        "width": 224,
        "height": 640,
        "content": "### 2) Connect Apify (HTTP Query Auth)\n1. Get your **Apify API token** (Apify Console \u2192 *Integrations/API*)  \n2. In **n8n \u2192 Credentials \u2192 New \u2192 HTTP Query Auth**, add a query param `token=<YOUR_APIFY_TOKEN>`  \n3. In the **Scrape Details** node, pick that credential. The URL is set to  \n   `https://api.apify.com/v2/acts/apify~instagram-profile-scraper/run-sync-get-dataset-items`  \n   The body passes `usernames: [\"{{$json.user}}\"]` from the Google Sheet row.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "23416d72-b9e9-4ab1-8b57-8a8a1f0cfcfe",
      "name": "Sticky Note64",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        3776
      ],
      "parameters": {
        "color": 3,
        "width": 224,
        "height": 400,
        "content": "### 3) Connect OpenAI (API Key)\n1. In **n8n \u2192 Credentials \u2192 New \u2192 OpenAI API**  \n2. Paste your **OpenAI API key**  \n3. In **OpenAI Chat Model**, select your credential and a **vision-capable** chat model (e.g., `gpt-4o-mini`, `gpt-4o`, or your configured vision model)\n"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Filter": {
      "main": [
        [
          {
            "node": "Scrape Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Details": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Google Sheet": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Get Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}