Automatische Instagram-Kommentare - Creator Center

Experte

Dies ist ein Social Media, Multimodal AI-Bereich Automatisierungsworkflow mit 39 Nodes. Hauptsächlich werden If, Set, Code, Wait, ConvertToFile und andere Nodes verwendet. Automatisches Kommentieren von Instagram-Posts mit GPT-4o, Phantombuster und SharePoint

Voraussetzungen
  • OpenAI API Key
Workflow-Vorschau
Visualisierung der Node-Verbindungen, mit Zoom und Pan
Workflow exportieren
Kopieren Sie die folgende JSON-Konfiguration und importieren Sie sie in n8n
{
  "id": "LNR9VPUbFEajd57v",
  "meta": {
    "instanceId": "2cf742429c2e3ee4e5a20069d3d8a75208519303b864f026a79464efa726bd95",
    "templateCredsSetupCompleted": true
  },
  "name": "Instagram Auto Commenting - Creators Hub",
  "tags": [],
  "nodes": [
    {
      "id": "91bc557b-028a-4778-8e51-8b69590ff2bd",
      "name": "Warten",
      "type": "n8n-nodes-base.wait",
      "position": [
        -256,
        -1776
      ],
      "webhookId": "50266a01-aebd-4ad8-bd74-feed09568209",
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "700968b7-51ba-4ffa-919d-f0da43e3743a",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -512,
        -1184
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "chatgpt-4o-latest"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "E4PFATctY0kV00hl",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "680e81c7-5219-4117-b084-ba951e61ca56",
      "name": "Warten1",
      "type": "n8n-nodes-base.wait",
      "position": [
        656,
        -1360
      ],
      "webhookId": "653c31a2-712e-4adb-ac74-f4115c0fe895",
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "132707b5-b634-4ada-9c49-43c6e8a227a7",
      "name": "Agent starten",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        -416,
        -1776
      ],
      "parameters": {
        "agentId": "={{ $json.id }}",
        "jsonParameters": true,
        "additionalFields": {
          "argumentsJson": "={\n  \"maxPosts\": {{ $('Set ENV Variables').item.json.ENV_MAX_POSTS_PER_HASHTAG }},\n  \"sessionCookie\": \"{{ $('Set ENV Variables').item.json.ENV_SESSION_COOKIE }}\",\n  \"spreadsheetUrl\": \"{{ $('Set ENV Variables').item.json.ENV_SEARCH_HASHTAGS }}\"\n} "
        }
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a9e108c7-efb3-488b-9ba8-901c0994093b",
      "name": "Zufälligen Beitrag abrufen",
      "type": "n8n-nodes-base.code",
      "position": [
        -1840,
        -1360
      ],
      "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    description: randomPost.description\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "10116cd5-806c-4604-9447-ed8d8e140ca2",
      "name": "Kommentar erstellen",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -512,
        -1360
      ],
      "parameters": {
        "text": "=Du bist ein spezialisierter Social Media Content Creator.\n\n**AUFGABE:** {{ $('Set ENV Variables').first().json.ENV_COMMENT_PROMPT }}\n\n**KOMMENTAR RICHTLINIEN:**\n- Antworte NUR auf {{ $('Set ENV Variables').first().json.ENV_COMMENT_LANGUAGE }}\n- Maximal 150 Zeichen (Instagram-optimiert)\n- Beziehe dich subtil auf den Original-Post Inhalt\n\n**POST-INHALT FÜR KOMMENTAR:**\n{{ $('Get Random Post').first().json.description }} \n\nErstelle einen perfekten Instagram-Kommentar.",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "fa623878-40ab-45f0-8685-726816927c75",
      "name": "CSV Binary erstellen",
      "type": "n8n-nodes-base.code",
      "position": [
        -176,
        -1360
      ],
      "parameters": {
        "jsCode": "// Extract correct values\nconst postUrl = $('Get Random Post').first().json.postUrl;\nconsole.log(\"postUrl: \", postUrl)\nconst commentText = $input.first().json.output;\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  `\"${clean(commentText).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": "93d4a1b3-1b51-4b8e-b2bb-abad737b6d90",
      "name": "CSV hochladen",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        -16,
        -1360
      ],
      "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_post_to_comment.csv",
        "operation": "upload",
        "fileContents": "data",
        "requestOptions": {}
      },
      "credentials": {
        "microsoftSharePointOAuth2Api": {
          "id": "jZkLTQXyVEzxtmp3",
          "name": "Microsoft SharePoint account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5113c291-24e0-4a4c-ba45-fea45693a99d",
      "name": "Autokommentar-Agent abrufen",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        240,
        -1360
      ],
      "parameters": {
        "agentId": "5533276466709830",
        "operation": "get"
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2f8df366-546b-45b8-affa-2eec0419451f",
      "name": "Hashtag-Agent abrufen",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        -576,
        -1776
      ],
      "parameters": {
        "agentId": "4031886542434447",
        "operation": "get"
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b6fe5490-11df-4875-bd46-3ead76bb803c",
      "name": "Beiträge abrufen",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        -96,
        -1776
      ],
      "parameters": {
        "agentId": "4031886542434447",
        "operation": "getOutput",
        "additionalFields": {}
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f1213cad-f240-42fe-a02c-7d23949f8e1b",
      "name": "AC-Agent starten",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        448,
        -1360
      ],
      "parameters": {
        "agentId": "5533276466709830",
        "jsonParameters": true,
        "additionalFields": {
          "argumentsJson": "={\n  \"sessionCookie\": \"{{ $('Set ENV Variables').first().json.ENV_SESSION_COOKIE }}\",\n  \"spreadsheetUrl\": \"{{ $('Upload CSV').item.json['@content.downloadUrl'] }}\"\n}"
        }
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "73f3edd0-6339-48a1-8048-249419c7dfd3",
      "name": "Antwort abrufen",
      "type": "n8n-nodes-base.phantombuster",
      "position": [
        848,
        -1360
      ],
      "parameters": {
        "agentId": "5533276466709830",
        "operation": "getOutput",
        "additionalFields": {}
      },
      "credentials": {
        "phantombusterApi": {
          "id": "Zf0AAqqdjBFfyW4W",
          "name": "Phantombuster account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "dbb2757c-fee3-4b76-a139-cde54ae6c3b1",
      "name": "Notizzettel",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        -1888
      ],
      "parameters": {
        "color": 5,
        "width": 1260,
        "height": 400,
        "content": "## Get Instagram Posts By Custom Hashtag\n"
      },
      "typeVersion": 1
    },
    {
      "id": "62f0a062-4794-4dd6-8b83-2d5d38b104d8",
      "name": "Notizzettel1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2080,
        -1472
      ],
      "parameters": {
        "color": 3,
        "width": 2192,
        "height": 400,
        "content": "## Process Posts and Generate Comment \n"
      },
      "typeVersion": 1
    },
    {
      "id": "e128e19c-0341-4c86-adab-1fd9d8add971",
      "name": "Notizzettel2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        -1472
      ],
      "parameters": {
        "width": 928,
        "height": 400,
        "content": "## Launch Autocomment Agent to Post Comment\n"
      },
      "typeVersion": 1
    },
    {
      "id": "770e3a45-8d4c-4cc1-aadd-fcf3dce2f40c",
      "name": "ENV-Variablen setzen",
      "type": "n8n-nodes-base.set",
      "position": [
        -736,
        -1776
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "7812dbc7-e492-42c4-96a6-71cfbdc71a6d",
              "name": "ENV_SEARCH_HASHTAGS",
              "type": "string",
              "value": "={{ $json.output.parseJson().hashtag }}"
            },
            {
              "id": "debcbe7a-3298-46ec-a8ab-96e8dc0184a7",
              "name": "ENV_SESSION_COOKIE",
              "type": "string",
              "value": "={{ $('Select Cookie').first().json.output.parseJson().session_cookie }}"
            },
            {
              "id": "261b0667-0cbd-4df1-8f3d-4e49a99f4cb1",
              "name": "ENV_MAX_POSTS_PER_HASHTAG",
              "type": "string",
              "value": "10"
            },
            {
              "id": "32531b3f-d01e-4764-9cc5-1f9f37979a3a",
              "name": "ENV_COMMENT_PROMPT",
              "type": "string",
              "value": "Erstelle einen ansprechenden Instagram-Kommentar basierend auf dem gegebenen Post-Inhalt."
            },
            {
              "id": "6e0bf007-ebce-4b39-9920-2f523b5bfe70",
              "name": "ENV_COMMENT_LANGUAGE",
              "type": "string",
              "value": "Deutsch"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "77379241-7ac0-4764-a84e-fdcad65b9261",
      "name": "Zufälligen Hashtag generieren",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1056,
        -1776
      ],
      "parameters": {
        "text": "=Can you generate a single random hashtag related to Artificial Intelligence and Business Process Automation, suitable for fetching Instagram posts?\nThe hashtag should be human like and realistic to appear in posts. Something like \"AIBizAutomation\" is not realistic. The hashtag should not be a combination of multiple words, for example \"smartautomation\" or \"intelligentworkflows\".\nYou can be very vague and also use IT companies as hashtag.\n\nPlease respond only with a **valid, raw JSON object**, like this:\n{\n  \"hashtag\": \"#Automation\"\n}",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "523432df-f776-46b9-a1d7-fccbd3bd8f64",
      "name": "Zeitplan-Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -992,
        -2208
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 2,
              "triggerAtMinute": 30
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7043f25d-3dca-40b5-9f25-b07c86c4dc36",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1072,
        -1616
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "chatgpt-4o-latest"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "E4PFATctY0kV00hl",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e0074e8b-8138-4fd6-b139-d764746984ff",
      "name": "Datei aktualisieren",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        -672,
        -1360
      ],
      "parameters": {
        "file": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWA37FQNX5XDRVVCYAT6XSISPVTCM",
          "cachedResultName": "instagram_posts_already_commented.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_commented.csv",
        "operation": "update",
        "fileContents": "data",
        "requestOptions": {},
        "changeFileContent": true
      },
      "credentials": {
        "microsoftSharePointOAuth2Api": {
          "id": "jZkLTQXyVEzxtmp3",
          "name": "Microsoft SharePoint account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d423679a-dcad-4c70-8bce-6b479503c07c",
      "name": "Datei herunterladen",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        -1664,
        -1360
      ],
      "parameters": {
        "file": {
          "__rl": true,
          "mode": "list",
          "value": "01M45PWA37FQNX5XDRVVCYAT6XSISPVTCM",
          "cachedResultName": "instagram_posts_already_commented.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": {
          "id": "jZkLTQXyVEzxtmp3",
          "name": "Microsoft SharePoint account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "edef95e3-c2e4-4e11-aee4-ace49b4608d1",
      "name": "Prüfen ob in Liste",
      "type": "n8n-nodes-base.code",
      "position": [
        -1312,
        -1360
      ],
      "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(\"🚨 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(\"✅ randomPost:\", randomPost);\nconsole.log(\"✅ 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(`🟠 Comparing:\\n→ raw: ${candidateRaw}\\n→ normalized: ${candidate}\\n→ target: ${randomPost}`);\n\n  if (candidate === randomPost) {\n    isDuplicate = true;\n    break;\n  }\n}\n\nreturn [{ json: { isDuplicate } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "afb29b9c-cb02-47fb-bf31-bae6a77c54ce",
      "name": "Wenn",
      "type": "n8n-nodes-base.if",
      "position": [
        -1152,
        -1360
      ],
      "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": "af4ff58e-bc3c-4b80-9bd9-e9dc479de3ee",
      "name": "Warten2",
      "type": "n8n-nodes-base.wait",
      "position": [
        -2000,
        -1360
      ],
      "webhookId": "d78bfa64-04a7-4487-89a6-eb177c518356",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "728c2193-b301-40d8-b327-1de92cfe99a9",
      "name": "Aktualisierte Daten vorbereiten",
      "type": "n8n-nodes-base.code",
      "position": [
        -992,
        -1360
      ],
      "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": "95e7013e-461f-4f4e-87e1-c409c03a9980",
      "name": "Aus Datei extrahieren",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -1488,
        -1360
      ],
      "parameters": {
        "options": {
          "headerRow": true
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "f67e2b1c-bee6-4740-a680-23412bf2ae9f",
      "name": "In Datei konvertieren",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        -832,
        -1360
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "e9405e7d-ae94-4737-bb6a-85e570293e9d",
      "name": "Verfügbare Session-Cookies abrufen",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        -784,
        -2208
      ],
      "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": {
          "id": "jZkLTQXyVEzxtmp3",
          "name": "Microsoft SharePoint account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "bea33381-e12f-4342-9ade-707fad72dac4",
      "name": "Cookies extrahieren",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -560,
        -2208
      ],
      "parameters": {
        "options": {},
        "operation": "text"
      },
      "typeVersion": 1
    },
    {
      "id": "58dc021e-1631-4068-94b9-9cfe7e1b35ec",
      "name": "Cookie auswählen",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -368,
        -2208
      ],
      "parameters": {
        "text": "=##################  PROMPT  ##################\n\n**ROLE:**  You are a session-cookie selector.\n\n**CURRENT BERLIN TIME**  \nDate & time : {{ $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   • N = number of cookies in the list (2 ≤ N ≤ 4).  \n   • H = current hour as an integer (0–23).  \n   • W = 24 ÷ N  (the width of each time slice in hours, always an integer).\n\n2. Determine the slice index:  \n   sliceIndex = floor(H ÷ W)  // 0-based\n\n3. Choose the cookie at position *(sliceIndex + 1)* in the list.  \n   • Example when N = 4 (W = 6):  \n     00-05 → 1st, 06-11 → 2nd, 12-17 → 3rd, 18-23 → 4th  \n   • Example when N = 3 (W = 8):  \n     00-07 → 1st, 08-15 → 2nd, 16-23 → 3rd  \n   • Example when N = 2 (W = 12):  \n     00-11 → 1st, 12-23 → 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": "e8ba7b3c-6ca5-4591-af86-886d4abe9bb8",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -384,
        -2048
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "chatgpt-4o-latest"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "E4PFATctY0kV00hl",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "93e2bae7-adcd-46f3-a818-b4e85329f407",
      "name": "Notizzettel4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        -2304
      ],
      "parameters": {
        "color": 6,
        "width": 1260,
        "height": 400,
        "content": "## Start Workflow and Retrieve Session Cookie\n"
      },
      "typeVersion": 1
    },
    {
      "id": "9272a99c-d2d4-4a8d-900c-7517e62ea201",
      "name": "Notizzettel5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        -2304
      ],
      "parameters": {
        "width": 432,
        "height": 288,
        "content": "### 1) Cookie & Hashtag Selection  \n**What it does**  \n• Downloads cookie list ➜ **Select Cookie** picks one by hour-slice.  \n• **Generate Random Hashtag** (GPT-4o) outputs a realistic tag.\n\n**Credentials**  \nOpenAI + SharePoint OAuth2.\n\n**Tweaks**  \n• Edit prompt for another niche.  \n• Add/remove cookies in SharePoint file."
      },
      "typeVersion": 1
    },
    {
      "id": "183dc623-a9aa-4479-bd8a-8717a7a710f9",
      "name": "Notizzettel6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1552,
        -1888
      ],
      "parameters": {
        "width": 384,
        "height": 256,
        "content": "### 2) Scrape Instagram Posts  \n**What it does**  \n• **Hashtag Agent** fetches recent posts for the tag.  \n• **Get Posts** forwards raw results downstream.\n\n**Credentials**  \nPhantombuster API.\n\n**Tweaks**  \n• Change `ENV_MAX_POSTS_PER_HASHTAG`.  \n• Adjust scrape depth in the agent UI."
      },
      "typeVersion": 1
    },
    {
      "id": "edbd080d-5225-49c1-889b-ed083272b8d0",
      "name": "Notizzettel7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2080,
        -1056
      ],
      "parameters": {
        "width": 384,
        "height": 272,
        "content": "### 3) Comment Generation  \n**What it does**  \n• **Get Random Post** selects one post + description.  \n• **Create Comment** (GPT-4o) returns a ≤150-char reply.\n\n**Credentials**  \nOpenAI.\n\n**Tweaks**  \n• Edit language or style via **Set ENV Variables** / prompt."
      },
      "typeVersion": 1
    },
    {
      "id": "ee36dd67-92fa-4456-b642-098848e9d6da",
      "name": "Notizzettel8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1088,
        -1056
      ],
      "parameters": {
        "width": 416,
        "height": 272,
        "content": "### 4) CSV Upload & Auto-comment  \n**What it does**  \n• Builds one-row CSV (post URL + comment).  \n• Uploads to SharePoint.  \n• **Auto-comment Agent** posts the reply.\n\n**Credentials**  \nSharePoint OAuth2 + Phantombuster API.\n\n**Tweaks**  \n• Rename files/folders in **Upload CSV**.  \n• Replace SharePoint with Drive/Dropbox if preferred."
      },
      "typeVersion": 1
    },
    {
      "id": "d6f2287b-2cda-44f8-af9e-00134abec388",
      "name": "Notizzettel9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        -1056
      ],
      "parameters": {
        "width": 400,
        "height": 288,
        "content": "### 5) Deduplication  \n**What it does**  \n• Downloads `instagram_posts_already_commented.csv`.  \n• **Check if in List** skips URLs already commented.  \n• On success, appends the new URL and re-uploads the file.\n\n**Credentials**  \nSharePoint OAuth2.\n\n**Tweaks**  \n• Modify duplicate logic if extra columns are stored."
      },
      "typeVersion": 1
    },
    {
      "id": "edfe9418-4ffa-48a8-920e-d2c298204fef",
      "name": "Notizzettel10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        -1472
      ],
      "parameters": {
        "width": 384,
        "height": 304,
        "content": "### 6) Rate Limiting & Scheduling  \n**What it does**  \n• 2-hour cron + **Wait** nodes keep totals near 80 comments/day\n  (8 runs × 10 posts).\n\n**Credentials**  \nNone\n\n**Tweaks**  \n• Edit cron rule or wait durations.  \n• Increase comments/day by raising limits and frequency."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "a66471bb-ceb1-4560-97eb-f4afa2b11569",
  "connections": {
    "afb29b9c-cb02-47fb-bf31-bae6a77c54ce": {
      "main": [
        [
          {
            "node": "af4ff58e-bc3c-4b80-9bd9-e9dc479de3ee",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "728c2193-b301-40d8-b327-1de92cfe99a9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "91bc557b-028a-4778-8e51-8b69590ff2bd": {
      "main": [
        [
          {
            "node": "b6fe5490-11df-4875-bd46-3ead76bb803c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "680e81c7-5219-4117-b084-ba951e61ca56": {
      "main": [
        [
          {
            "node": "73f3edd0-6339-48a1-8048-249419c7dfd3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "af4ff58e-bc3c-4b80-9bd9-e9dc479de3ee": {
      "main": [
        [
          {
            "node": "a9e108c7-efb3-488b-9ba8-901c0994093b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b6fe5490-11df-4875-bd46-3ead76bb803c": {
      "main": [
        [
          {
            "node": "af4ff58e-bc3c-4b80-9bd9-e9dc479de3ee",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "93d4a1b3-1b51-4b8e-b2bb-abad737b6d90": {
      "main": [
        [
          {
            "node": "5113c291-24e0-4a4c-ba45-fea45693a99d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e0074e8b-8138-4fd6-b139-d764746984ff": {
      "main": [
        [
          {
            "node": "10116cd5-806c-4604-9447-ed8d8e140ca2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "132707b5-b634-4ada-9c49-43c6e8a227a7": {
      "main": [
        [
          {
            "node": "91bc557b-028a-4778-8e51-8b69590ff2bd",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d423679a-dcad-4c70-8bce-6b479503c07c": {
      "main": [
        [
          {
            "node": "95e7013e-461f-4f4e-87e1-c409c03a9980",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "58dc021e-1631-4068-94b9-9cfe7e1b35ec": {
      "main": [
        [
          {
            "node": "77379241-7ac0-4764-a84e-fdcad65b9261",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "10116cd5-806c-4604-9447-ed8d8e140ca2": {
      "main": [
        [
          {
            "node": "fa623878-40ab-45f0-8685-726816927c75",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f67e2b1c-bee6-4740-a680-23412bf2ae9f": {
      "main": [
        [
          {
            "node": "e0074e8b-8138-4fd6-b139-d764746984ff",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "bea33381-e12f-4342-9ade-707fad72dac4": {
      "main": [
        [
          {
            "node": "58dc021e-1631-4068-94b9-9cfe7e1b35ec",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a9e108c7-efb3-488b-9ba8-901c0994093b": {
      "main": [
        [
          {
            "node": "d423679a-dcad-4c70-8bce-6b479503c07c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f1213cad-f240-42fe-a02c-7d23949f8e1b": {
      "main": [
        [
          {
            "node": "680e81c7-5219-4117-b084-ba951e61ca56",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "edef95e3-c2e4-4e11-aee4-ace49b4608d1": {
      "main": [
        [
          {
            "node": "afb29b9c-cb02-47fb-bf31-bae6a77c54ce",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "523432df-f776-46b9-a1d7-fccbd3bd8f64": {
      "main": [
        [
          {
            "node": "e9405e7d-ae94-4737-bb6a-85e570293e9d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fa623878-40ab-45f0-8685-726816927c75": {
      "main": [
        [
          {
            "node": "93d4a1b3-1b51-4b8e-b2bb-abad737b6d90",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "95e7013e-461f-4f4e-87e1-c409c03a9980": {
      "main": [
        [
          {
            "node": "edef95e3-c2e4-4e11-aee4-ace49b4608d1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2f8df366-546b-45b8-affa-2eec0419451f": {
      "main": [
        [
          {
            "node": "132707b5-b634-4ada-9c49-43c6e8a227a7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "700968b7-51ba-4ffa-919d-f0da43e3743a": {
      "ai_languageModel": [
        [
          {
            "node": "10116cd5-806c-4604-9447-ed8d8e140ca2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "770e3a45-8d4c-4cc1-aadd-fcf3dce2f40c": {
      "main": [
        [
          {
            "node": "2f8df366-546b-45b8-affa-2eec0419451f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7043f25d-3dca-40b5-9f25-b07c86c4dc36": {
      "ai_languageModel": [
        [
          {
            "node": "77379241-7ac0-4764-a84e-fdcad65b9261",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "e8ba7b3c-6ca5-4591-af86-886d4abe9bb8": {
      "ai_languageModel": [
        [
          {
            "node": "58dc021e-1631-4068-94b9-9cfe7e1b35ec",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "728c2193-b301-40d8-b327-1de92cfe99a9": {
      "main": [
        [
          {
            "node": "f67e2b1c-bee6-4740-a680-23412bf2ae9f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5113c291-24e0-4a4c-ba45-fea45693a99d": {
      "main": [
        [
          {
            "node": "f1213cad-f240-42fe-a02c-7d23949f8e1b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "77379241-7ac0-4764-a84e-fdcad65b9261": {
      "main": [
        [
          {
            "node": "770e3a45-8d4c-4cc1-aadd-fcf3dce2f40c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e9405e7d-ae94-4737-bb6a-85e570293e9d": {
      "main": [
        [
          {
            "node": "bea33381-e12f-4342-9ade-707fad72dac4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Häufig gestellte Fragen

Wie verwende ich diesen Workflow?

Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.

Für welche Szenarien ist dieser Workflow geeignet?

Experte - Soziale Medien, Multimodales KI

Ist es kostenpflichtig?

Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.

Workflow-Informationen
Schwierigkeitsgrad
Experte
Anzahl der Nodes39
Kategorie2
Node-Typen12
Schwierigkeitsbeschreibung

Für fortgeschrittene Benutzer, komplexe Workflows mit 16+ Nodes

Autor
plemeo

plemeo

@plemeo

Hi, I'm Gerhard from Plemeo. At plemeo.ai, we focus on AI-driven automation and workflow optimization. Our deep expertise with n8n enables us to streamline processes and boost efficiency in software development. This allows us to deliver real, measurable improvements. Curious how plemeo.ai and n8n can benefit your business? Reach out at info@plemeo.de or visit plemeo.ai.

Externe Links
Auf n8n.io ansehen

Diesen Workflow teilen

Kategorien

Kategorien: 34