{
  "name": "Instagram finder",
  "nodes": [
    {
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "Query"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1.1,
      "position": [
        0,
        0
      ],
      "id": "633e89ef-79f1-4425-9906-1f19a4512574",
      "name": "When Executed by Another Workflow"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4.1-mini-2025-04-14",
          "mode": "list",
          "cachedResultName": "GPT-4.1-MINI-2025-04-14"
        },
        "messages": {
          "values": [
            {
              "content": "I want you to search through this scraped google search data and find the URL that is most likely a valid, profile URL for Instagram.\n\nIt must be a profile URL.\n\nOnly output the URL and nothing else\n\nData: "
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        360,
        0
      ],
      "id": "dc534d90-467d-41f7-b974-bf49dc67009a",
      "name": "Validate",
      "credentials": {
        "openAiApi": {
          "id": "xX6Qn7dUJHcs40V9",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4.1-mini-2025-04-14",
          "mode": "list",
          "cachedResultName": "GPT-4.1-MINI-2025-04-14"
        },
        "messages": {
          "values": [
            {
              "content": "=Your job is to go through scraped instagram profile data and create me a summary of the key points aswell as a general overview.\n\ndata\nUrl:  {{ $json.URL }}\nUsername: {{ $json.username }}\nFollowers: {{ $json.followers }}"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        860,
        0
      ],
      "id": "7bf5fc85-bf51-484a-bf51-ec61600af6d3",
      "name": "Summarise",
      "credentials": {
        "openAiApi": {
          "id": "xX6Qn7dUJHcs40V9",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.tavily.com/search",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <api key>"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"query\": \"{{ $json.Query }}'s instagram profile URL'\",\n  \"topic\": \"general\",\n  \"search_depth\": \"basic\",\n  \"chunks_per_source\": 3,\n  \"max_results\": 1,\n  \"time_range\": null,\n  \"days\": 7,\n  \"include_answer\": true,\n  \"include_raw_content\": false,\n  \"include_images\": false,\n  \"include_image_descriptions\": false,\n  \"include_domains\": [],\n  \"exclude_domains\": []\n} ",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        180,
        0
      ],
      "id": "a537d79c-7d27-4094-a830-8cb833dab2bd",
      "name": "Get Instagram"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "<url>",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n    \"directUrls\": [\n        \"{{ $json.message.content }}\"\n    ],\n    \"proxy\": {\n        \"useApifyProxy\": true,\n        \"groups\": [\n            \"RESIDENTIAL\"\n        ]\n    }\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        680,
        0
      ],
      "id": "a307a539-7ccf-4a1a-b636-9e951b30e68a",
      "name": "Scrape Instagram"
    }
  ],
  "pinData": {},
  "connections": {
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Get Instagram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate": {
      "main": [
        [
          {
            "node": "Scrape Instagram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Instagram": {
      "main": [
        [
          {
            "node": "Validate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Instagram": {
      "main": [
        [
          {
            "node": "Summarise",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "3c004946-e24e-4ca4-86b7-05f273f1ac3d",
  "meta": {
    "instanceId": "8711ef6aba5ff6781b8ed3c0d9d8ad1fb3b9e4be41f1c9a056c02209236d4a91"
  },
  "id": "ByQErAGwNjJyPOCn",
  "tags": [
    {
      "createdAt": "2025-05-05T18:28:14.726Z",
      "updatedAt": "2025-05-05T18:28:14.726Z",
      "id": "5l1iny0IJjZ0zdzn",
      "name": "Research agent"
    }
  ]
}