{
  "id": "yjW8e13sgz8fb9PJ",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Instagram Auto Liking (Profile Post Extractor) - Creators Hub",
  "tags": [
    {
      "id": "Tl9QVfvwkdFQyffg",
      "name": "n8n Creators Hub",
      "createdAt": "2025-08-01T09:19:22.310Z",
      "updatedAt": "2025-08-01T09:19:22.310Z"
    }
  ],
  "nodes": [
    {
      "id": "7baf316f-9de7-4919-bbf2-4a494d0e4ee1",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        -880,
        -1872
      ],
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "d0421508-f235-4db1-819a-87af7151fa59",
      "name": "Wait1",
      "type": "n8n-nodes-base.wait",
      "position": [
        352,
        -1440
      ],
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "f1eb23c4-266b-4dca-86b9-ff14e39978d4",
      "name": "Get Random Post",
      "type": "n8n-nodes-base.code",
      "position": [
        -2128,
        -1440
      ],
      "parameters": {
        "jsCode": "const data = $input.all().map(item => item.json);\n\nif (!data || data.length === 0) {\n  throw new Error('No Instagram posts data found');\n}\n\n// Get a random post\nconst randomPost = data[Math.floor(Math.random() * data.length)];\n\n// Return only postUrl and description\nreturn {\n  json: {\n    postUrl: randomPost.postUrl\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "402107d7-6935-4304-b7d6-447aa70042a8",
      "name": "Create CSV Binary",
      "type": "n8n-nodes-base.code",
      "position": [
        -688,
        -1440
      ],
      "parameters": {
        "jsCode": "// Extract correct values\nconst postUrl = $('Get Random Post').first().json.postUrl;\n\n// Clean utility\nconst clean = str => String(str || \"\").replace(/[\\u200B-\\u200D\\uFEFF]/g, \"\").trim();\n\n// Escape and quote single data row\nconst row = [\n  `\"${clean(postUrl).replace(/\"/g, '\"\"')}\"`\n];\n\n// Convert to buffer without header or BOM\nconst csvBuffer = Buffer.from(row.join(\",\") + \"\\n\", \"utf8\");\n\n// Return binary file\nreturn [\n  {\n    binary: {\n      data: {\n        data: csvBuffer,\n        mimeType: \"text/csv\",\n        fileName: \"phantombuster_clean.csv\"\n      }\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "bcf735a0-3262-40d9-9f1f-bf740e75a94f",
      "name": "Upload CSV",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        -496,
        -1440
      ],
      "parameters": {
        "site": {
          "__rl": true,
          "mode": "list",
          "value": "plemeo.sharepoint.com,f304c34c-1252-4b99-a852-059c2036c718,c3bf26ab-bf44-4334-8e5b-e8b680bb9e1d",
          "cachedResultName": "plemeo"
        },
        "folder": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWAY4RSXX7PGSC5CL27V2Y7XYSNQZ",
          "cachedResultName": "Phantombuster"
        },
        "fileName": "instagram_posts_to_like.csv",
        "operation": "upload",
        "fileContents": "data",
        "requestOptions": {}
      },
      "credentials": {
        "microsoftSharePointOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6b75ce32-6c2c-4bcb-aad1-69f9068e8d74",
      "name": "Get Response",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        576,
        -1440
      ],
      "parameters": {
        "agentId": "7281446865767808",
        "operation": "getOutput",
        "additionalFields": {}
      },
      "credentials": {
        "phantombusterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "780a8a6b-db44-4128-8350-5910b3ea5144",
      "name": "Get Autoliking Agent",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        -80,
        -1440
      ],
      "parameters": {
        "agentId": "1308386990292658",
        "operation": "get"
      },
      "credentials": {
        "phantombusterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "818fb213-0de9-43ec-b586-5a5abe4cc2b1",
      "name": "Launch AL Agent",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        144,
        -1440
      ],
      "parameters": {
        "agentId": "1308386990292658",
        "jsonParameters": true,
        "additionalFields": {
          "argumentsJson": "={\n  \"numberOfPostsPerLaunch\": 1,\n  \"sessionCookie\": \"{{ $('Set ENV Variables').first().json.ENV_SESSION_COOKIE }}\",\n  \"spreadsheetUrl\": \"{{ $('Upload CSV').item.json['@content.downloadUrl'] }}\"\n}"
        }
      },
      "credentials": {
        "phantombusterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "93179ea9-ce10-48ef-bce7-33d67363e3f7",
      "name": "Set ENV Variables",
      "type": "n8n-nodes-base.set",
      "position": [
        -416,
        -2288
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "debcbe7a-3298-46ec-a8ab-96e8dc0184a7",
              "name": "ENV_SESSION_COOKIE",
              "type": "string",
              "value": "={{ $('Select Cookie').first().json.output.parseJson().session_cookie }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "35b0afa6-e833-4f21-bf6c-48e904550517",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1328,
        -2288
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 2,
              "triggerAtMinute": 15
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9546e366-42f6-42bc-a473-2db71c555a89",
      "name": "Update file",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        -880,
        -1440
      ],
      "parameters": {
        "file": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWAZQIMNOGWOEPZBJXCNUHQ2W5JEC",
          "cachedResultName": "instagram_posts_already_liked.csv"
        },
        "site": {
          "__rl": true,
          "mode": "list",
          "value": "plemeo.sharepoint.com,f304c34c-1252-4b99-a852-059c2036c718,c3bf26ab-bf44-4334-8e5b-e8b680bb9e1d",
          "cachedResultName": "plemeo"
        },
        "folder": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWAY4RSXX7PGSC5CL27V2Y7XYSNQZ",
          "cachedResultName": "Phantombuster"
        },
        "fileName": "instagram_posts_already_liked.csv",
        "operation": "update",
        "fileContents": "data",
        "requestOptions": {},
        "changeFileContent": true
      },
      "credentials": {
        "microsoftSharePointOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f3b26a48-6428-4d18-8ec2-c70fd0dcdbd1",
      "name": "Download file",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        -1952,
        -1440
      ],
      "parameters": {
        "file": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWAZQIMNOGWOEPZBJXCNUHQ2W5JEC",
          "cachedResultName": "instagram_posts_already_liked.csv"
        },
        "site": {
          "__rl": true,
          "mode": "list",
          "value": "plemeo.sharepoint.com,f304c34c-1252-4b99-a852-059c2036c718,c3bf26ab-bf44-4334-8e5b-e8b680bb9e1d",
          "cachedResultName": "plemeo"
        },
        "folder": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWAY4RSXX7PGSC5CL27V2Y7XYSNQZ",
          "cachedResultName": "Phantombuster"
        },
        "requestOptions": {}
      },
      "credentials": {
        "microsoftSharePointOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a695afe0-f563-4dce-bee2-ca370e8f27f3",
      "name": "Check if in List",
      "type": "n8n-nodes-base.code",
      "position": [
        -1584,
        -1440
      ],
      "parameters": {
        "jsCode": "const randomPost = normalizeUrl($('Get Random Post').first().json.postUrl);\nconst allItems = $('Extract from File').all();\n\nif (!allItems || allItems.length === 0) {\n  return [{ json: { isDuplicate: false } }];\n}\n\nfunction normalizeUrl(url) {\n  if (typeof url !== 'string') {\n    console.log(\"\ud83d\udea8 NOT A STRING:\", url);\n    return '';\n  }\n  return url.trim().toLowerCase().replace(/\\/$/, '');\n}\n\n// Helper function to get postUrl value regardless of BOM\nfunction getPostUrl(item) {\n  const json = item.json;\n  // Try normal field name first\n  if (json.postUrl) return json.postUrl;\n  \n  // Look for any field containing \"postUrl\"\n  const postUrlKey = Object.keys(json).find(key => key.includes('postUrl'));\n  return postUrlKey ? json[postUrlKey] : null;\n}\n\nconsole.log(\"\u2705 randomPost:\", randomPost);\nconsole.log(\"\u2705 allItems:\", allItems);\n\nlet isDuplicate = false;\n\nfor (const item of allItems) {\n  const candidateRaw = getPostUrl(item);\n  const candidate = normalizeUrl(candidateRaw);\n\n  console.log(`\ud83d\udfe0 Comparing:\\n\u2192 raw: ${candidateRaw}\\n\u2192 normalized: ${candidate}\\n\u2192 target: ${randomPost}`);\n\n  if (candidate === randomPost) {\n    isDuplicate = true;\n    break;\n  }\n}\n\nreturn [{ json: { isDuplicate } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "b49359a7-1ac7-4e13-b219-d8e4bbce277a",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -1408,
        -1440
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "bcef43b3-e773-45ba-b245-19ab3fc1e508",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $('Check if in List').first().json.isDuplicate }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "4558e24d-53c7-48ba-8ce5-c68550cc15e6",
      "name": "Wait2",
      "type": "n8n-nodes-base.wait",
      "position": [
        -2288,
        -1440
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "a97ea279-eeb5-4bf2-9521-e9eabd12c136",
      "name": "Prepare Updated Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -1232,
        -1440
      ],
      "parameters": {
        "jsCode": "const existingUrls = $('Extract from File').all().map(item => {\n  // Get the first key (which has the BOM) and use its value\n  const firstKey = Object.keys(item.json)[0];\n  return { postUrl: item.json[firstKey] };\n});\n\nconsole.log(\"existingUrls: \", existingUrls);\n\nconst randomPost = $('Get Random Post').first().json.postUrl;\nconsole.log(\"randomPost: \", randomPost);\n\nreturn [\n  ...existingUrls,\n  { postUrl: randomPost }\n].map(entry => ({ json: entry }));"
      },
      "typeVersion": 2
    },
    {
      "id": "b0a7d1e4-eb62-4720-80cc-4a5dd7f19235",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -1760,
        -1440
      ],
      "parameters": {
        "options": {
          "headerRow": true
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "f64adee4-8775-42c2-8e52-0c044ad3441d",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        -1056,
        -1440
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "6d744136-7257-4cd0-b874-372d204a6099",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -784,
        -2096
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "chatgpt-4o-latest"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f74219a2-c747-423d-9ed0-57f1eccf3bd6",
      "name": "Get Available Session Cookies",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        -1168,
        -2288
      ],
      "parameters": {
        "file": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWA5FHBKEDCMCXRBJK64QFIFWOCQE",
          "cachedResultName": "instagram_session_cookies.txt"
        },
        "site": {
          "__rl": true,
          "mode": "list",
          "value": "plemeo.sharepoint.com,f304c34c-1252-4b99-a852-059c2036c718,c3bf26ab-bf44-4334-8e5b-e8b680bb9e1d",
          "cachedResultName": "plemeo"
        },
        "folder": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWAY4RSXX7PGSC5CL27V2Y7XYSNQZ",
          "cachedResultName": "Phantombuster"
        },
        "requestOptions": {}
      },
      "credentials": {
        "microsoftSharePointOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d1d4fc06-0035-4397-a955-a4c54d3db0e0",
      "name": "Extract Cookies",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -960,
        -2288
      ],
      "parameters": {
        "options": {},
        "operation": "text"
      },
      "typeVersion": 1
    },
    {
      "id": "11c37cd5-f76a-4f96-b724-88e07bf59946",
      "name": "Select Cookie",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -752,
        -2288
      ],
      "parameters": {
        "text": "=##################  PROMPT  ##################\n\n**ROLE:**  You are a session-cookie selector.\n\n**CURRENT BERLIN TIME**  \nDate\u2009&\u2009time : {{ $now.setZone('Europe/Berlin').format('DD HH:mm:ss') }}  \nHour (00-23): {{ $now.setZone('Europe/Berlin').format('HH') }}\n\n**SESSION COOKIES (keep order):**  \n{{ $json.data }}\n\n**SELECTION LOGIC**\n\n1. Let  \n   \u2022 N = number of cookies in the list (2 \u2264 N \u2264 4).  \n   \u2022 H = current hour as an integer (0\u201323).  \n   \u2022 W = 24 \u00f7 N \u2003(the width of each time slice in hours, always an integer).\n\n2. Determine the slice index:  \n   sliceIndex = floor(H \u00f7 W)\u2003\u2003// 0-based\n\n3. Choose the cookie at position *(sliceIndex + 1)* in the list.  \n   \u2022 Example when N = 4 (W = 6):  \n     00-05 \u2192 1st, 06-11 \u2192 2nd, 12-17 \u2192 3rd, 18-23 \u2192 4th  \n   \u2022 Example when N = 3 (W = 8):  \n     00-07 \u2192 1st, 08-15 \u2192 2nd, 16-23 \u2192 3rd  \n   \u2022 Example when N = 2 (W = 12):  \n     00-11 \u2192 1st, 12-23 \u2192 2nd\n\n**OUTPUT FORMAT**  \nReturn only the selected session cookie value in a valid JSON-Field called \"session_cookie\", nothing else.\n\n##############################################",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "1ebe586f-d24f-4342-bef0-fcba2bef43bc",
      "name": "Launch Agent",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        -1024,
        -1872
      ],
      "parameters": {
        "agentId": "={{ $('Get Profile Extractor Agent').item.json.id }}",
        "jsonParameters": true,
        "additionalFields": {
          "argumentsJson": "={\n  \"numberOfPostsPerProfile\": 20,\n  \"filters\": \"postUrl\",\n  \"spreadsheetUrl\": \"{{$('Get List of Accounts').item.json['@content.downloadUrl']}}\",\n  \"sessionCookie\": \"{{$('Set ENV Variables').item.json.ENV_SESSION_COOKIE}}\"\n}"
        }
      },
      "credentials": {
        "phantombusterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ebe727e3-4e01-4345-91ba-6b546aa9dc66",
      "name": "Get Profile Extractor Agent",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        -1344,
        -1872
      ],
      "parameters": {
        "agentId": "7569425938663423",
        "operation": "get"
      },
      "credentials": {
        "phantombusterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5e170ac0-e10a-49dd-ab23-c2b2856f9988",
      "name": "Get List of Accounts",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        -1184,
        -1872
      ],
      "parameters": {
        "file": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWA5UGUOGJDHZDVEJOKYNQFNF4ERC",
          "cachedResultName": "instagram_profiles_to_scrape.csv"
        },
        "site": {
          "__rl": true,
          "mode": "list",
          "value": "plemeo.sharepoint.com,f304c34c-1252-4b99-a852-059c2036c718,c3bf26ab-bf44-4334-8e5b-e8b680bb9e1d",
          "cachedResultName": "plemeo"
        },
        "folder": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWAY4RSXX7PGSC5CL27V2Y7XYSNQZ",
          "cachedResultName": "Phantombuster"
        },
        "fileName": "instagram_profiles_to_scrape.csv",
        "operation": "update",
        "requestOptions": {}
      },
      "credentials": {
        "microsoftSharePointOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5d11ec57-9af0-471a-8e36-2889b87b4050",
      "name": "If Empty",
      "type": "n8n-nodes-base.if",
      "position": [
        -320,
        -1872
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "77805c7a-32a4-492e-9084-6a459e8d6b65",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.isEmpty() }}",
              "rightValue": "true"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "187077fc-7cf7-4a1e-85b1-fbea041b44e8",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -736,
        -1872
      ],
      "parameters": {
        "url": "https://api.phantombuster.com/api/v2/agents/fetch?id=7569425938663423",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "phantombusterApi"
      },
      "credentials": {
        "phantombusterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "b78ecdb0-8827-4bc0-942b-35aba3ff5341",
      "name": "HTTP Request1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -592,
        -1872
      ],
      "parameters": {
        "url": "=https://phantombuster.s3.amazonaws.com/{{ $json.data?.orgS3Folder || $json.orgS3Folder }}/{{ $json.data?.s3Folder || $json.s3Folder }}/filtered_result.csv\n",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "phantombusterApi"
      },
      "credentials": {
        "phantombusterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "bd08f58a-8cf6-4bbb-a26f-b10b23bfba6e",
      "name": "Prepare Posts",
      "type": "n8n-nodes-base.code",
      "position": [
        -448,
        -1872
      ],
      "parameters": {
        "jsCode": "// Split the \"data\" field into lines\nconst raw = $json[\"data\"] || \"\";\nconst lines = raw.split(\"\\n\").map(l => l.trim()).filter(Boolean);\n\n// First line is the header (\"postUrl\")\nconst header = lines.shift();\n\n// Build an array of { postUrl } objects\nreturn lines.map(url => {\n  return {\n    json: {\n      postUrl: url\n    }\n  };\n});\n"
      },
      "typeVersion": 2
    },
    {
      "id": "8da474d3-5d18-46bd-ba6f-4525125bbb9d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1392,
        -2000
      ],
      "parameters": {
        "color": 5,
        "width": 1180,
        "height": 400,
        "content": "## Get Instagram Posts By Custom Hashtag\n"
      },
      "typeVersion": 1
    },
    {
      "id": "33cf094c-3706-493f-bdcd-8168b3f4461d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2336,
        -1584
      ],
      "parameters": {
        "color": 3,
        "width": 2124,
        "height": 404,
        "content": "## Process Posts and Check if not already processed\n"
      },
      "typeVersion": 1
    },
    {
      "id": "92d47a96-3211-4a26-a851-ffd90cb9b5bc",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        -1584
      ],
      "parameters": {
        "width": 992,
        "height": 404,
        "content": "## Launch Autoliking Agent to Like Post\n"
      },
      "typeVersion": 1
    },
    {
      "id": "59e1a490-3b79-43d8-8e0f-fcd8aeb96392",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1392,
        -2416
      ],
      "parameters": {
        "color": 6,
        "width": 1180,
        "height": 400,
        "content": "## Start Workflow and Retrieve Session Cookie\n"
      },
      "typeVersion": 1
    },
    {
      "id": "5c727010-1bcf-4ed7-9597-f4026bba2cfa",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        -2416
      ],
      "parameters": {
        "width": 448,
        "height": 272,
        "content": "### 1) Cookie & Hashtag Selection  \n**What it does**  \n\u2022 Downloads cookie list \u279c **Select Cookie** picks one by time slice.  \n\n**Credentials**  \nOpenAI + SharePoint OAuth2.\n\n**Tweaks**  \n\u2022 Add/remove cookies in SharePoint file."
      },
      "typeVersion": 1
    },
    {
      "id": "922c64a6-4ae5-46fa-9f6c-e025187e6110",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        -2000
      ],
      "parameters": {
        "width": 464,
        "height": 240,
        "content": "### 2) Scrape Instagram Posts  \n**What it does**  \n\u2022 **Profile Extractor Agent** fetches 20 posts for each defined profile in the CSV.  \n\u2022 **Get Posts** forwards raw results.\n\n**Credentials**  \nPhantombuster API.\n\n**Tweaks**  \n\u2022 Adjust scrape depth in the agent UI."
      },
      "typeVersion": 1
    },
    {
      "id": "3b02aab2-7285-4b5d-9286-536f4d7be19e",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2336,
        -1168
      ],
      "parameters": {
        "width": 432,
        "height": 256,
        "content": "### 3) Duplicate Check  \n**What it does**  \n\u2022 Downloads `instagram_posts_already_liked.csv`.  \n\u2022 **Check if in List** skips URLs already liked.  \n\u2022 On success, appends the new URL and re-uploads the file.\n\n**Credentials**  \nSharePoint OAuth2.\n\n**Tweaks**  \n\u2022 Modify duplicate logic if you store extra columns."
      },
      "typeVersion": 1
    },
    {
      "id": "49ef0839-42d9-4d40-9259-a522438323e3",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        816,
        -1584
      ],
      "parameters": {
        "width": 320,
        "height": 256,
        "content": "### 5) Rate Limiting & Scheduling  \n**What it does**  \n\u2022 2-hour cron + **Wait** nodes keep likes to ~12 per day.\n\n**Credentials**  \nNone\n\n**Tweaks**  \n\u2022 Edit cron rule or wait durations.  \n\u2022 Increase likes/day by raising limits and frequency."
      },
      "typeVersion": 1
    },
    {
      "id": "ffc63ccc-b097-40ef-8293-968dc2f70281",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        -1168
      ],
      "parameters": {
        "width": 416,
        "height": 272,
        "content": "### 4) CSV Upload & Auto-like  \n**What it does**  \n\u2022 Creates one-row CSV with the target post URL.  \n\u2022 Uploads to SharePoint.  \n\u2022 **Auto-like Agent** uses the CSV link to like the post.\n\n**Credentials**  \nSharePoint OAuth2 + Phantombuster API.\n\n**Tweaks**  \n\u2022 Rename files/folders in the upload node.  \n\u2022 Replace SharePoint with Drive/Dropbox if preferred."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "3a24d44c-9ffd-4341-af08-2625b65d47a0",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Wait2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare Updated Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "Get Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait2": {
      "main": [
        [
          {
            "node": "Get Random Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Empty": {
      "main": [
        [],
        [
          {
            "node": "Wait2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload CSV": {
      "main": [
        [
          {
            "node": "Get Autoliking Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update file": {
      "main": [
        [
          {
            "node": "Create CSV Binary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Launch Agent": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "Prepare Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Posts": {
      "main": [
        [
          {
            "node": "If Empty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Cookie": {
      "main": [
        [
          {
            "node": "Set ENV Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Update file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Cookies": {
      "main": [
        [
          {
            "node": "Select Cookie",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Random Post": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Launch AL Agent": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if in List": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Available Session Cookies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create CSV Binary": {
      "main": [
        [
          {
            "node": "Upload CSV",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Check if in List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set ENV Variables": {
      "main": [
        [
          {
            "node": "Get Profile Extractor Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Select Cookie",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get Autoliking Agent": {
      "main": [
        [
          {
            "node": "Launch AL Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get List of Accounts": {
      "main": [
        [
          {
            "node": "Launch Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Updated Data": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Profile Extractor Agent": {
      "main": [
        [
          {
            "node": "Get List of Accounts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Available Session Cookies": {
      "main": [
        [
          {
            "node": "Extract Cookies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}