Erstellung von Instagram-Titeln aus Tag-Analyse mit Apify + GPT-4o-mini

Experte

Dies ist ein Content Creation, Multimodal AI-Bereich Automatisierungsworkflow mit 17 Nodes. Hauptsächlich werden Set, Code, Merge, SplitOut, Aggregate und andere Nodes verwendet. Instagram-Titel aus Tag-Analysen mit Apify + GPT-4o-mini generieren

Voraussetzungen
  • Möglicherweise sind Ziel-API-Anmeldedaten erforderlich
  • 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
{
  "meta": {
    "instanceId": "efb474b59b0341d7791932605bd9ff04a6c7ed9941fdd53dc4a2e4b99a6f9439"
  },
  "nodes": [
    {
      "id": "2ea0c49a-6706-4272-8990-06f578c5c5a7",
      "name": "Bei Klick auf 'Workflow ausführen'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -360,
        1080
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a889197b-b78d-4808-948c-6d57883ee34f",
      "name": "KI-Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        920,
        1060
      ],
      "parameters": {
        "text": "=posts: {{ $json.text }}",
        "options": {
          "systemMessage": "=I'm looking for ideas for posts about  {{ $('Create Search Term').item.json.Search_Term }}\n\nHere's the last 5 posts on instagram about the topic. Use those to help me generate a list of relevent captions to post on my instagram. \n\ndo not make up ideas that are not like the others in the list. \n\noutput like this. \n\n{\n\t\"Post Idea\": [\"Idea1\", \"Idea2\"], \n  \"Most Common Post\":  [\"common post 1\", \"common post 2\"]\n}"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2
    },
    {
      "id": "47f4b1cb-9361-4aff-a439-2c8979fe93f4",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        960,
        1280
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "ghJTvay8CvwXDsXz",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2b0f574d-7976-469a-bf84-00a37ef15def",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1140,
        1280
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"Post Idea\": [\"Idea1\", \"Idea2\"], \n  \"Most Common Post\":  [\"common post 1\", \"common post 2\"]\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "00910de9-80ba-41c9-8200-81fcb6d15f45",
      "name": "Find Recent Posts",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        140,
        1120
      ],
      "parameters": {
        "url": "=https://api.apify.com/v2/acts/apify~instagram-hashtag-scraper/run-sync-get-dataset-items\n",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"hashtags\": [\n        \"{{ $json.Search_Term }}\"\n    ],\n    \"resultsLimit\": 20,\n    \"resultsType\": \"posts\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth"
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "yLUXsSPePLOGnHmf",
          "name": "Query Auth account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5a62f897-74a6-4899-a8c9-a51a6d011373",
      "name": "Create Search Term",
      "type": "n8n-nodes-base.set",
      "position": [
        -140,
        1000
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ad5c9a23-7fe0-4ed4-b1e7-d3da417bcb86",
              "name": "Search_Term",
              "type": "string",
              "value": "n8n"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "33a01e12-8820-4184-92fb-6682470940b1",
      "name": "Set bio and follower count",
      "type": "n8n-nodes-base.set",
      "position": [
        440,
        920
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ac638d8c-fa83-4cf6-92af-e0489d7349dd",
              "name": "caption",
              "type": "string",
              "value": "={{ $json.caption }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "7275daae-bf7a-4c06-928a-16f0bfdc0a3b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        100
      ],
      "parameters": {
        "color": 3,
        "width": 780,
        "height": 1380,
        "content": "### 1️⃣ Manual Trigger\n\n#### 🧩 Node: `When clicking ‘Execute workflow’`\n- Manually starts the workflow for testing or single-run execution.\n\n---\n\n### 2️⃣ Define the Hashtag\n\n#### 🧩 Node: `Create Search Term`\n- Sets the value of the hashtag you'd like to scan.\n- Default is `n8n`, but you can modify it to anything.\n\n```json\n{\n  \"Search_Term\": \"yourCustomHashtag\"\n}\n```\n\n---\n\n### 3️⃣ Scrape Instagram Posts\n\n#### 🧩 Node: `Find Recent Posts`\n- **API**: [Apify Instagram Hashtag Scraper](https://console.apify.com/actors/apify/instagram-hashtag-scraper)\n- **Setup**:\n  - Visit [Apify Console](https://console.apify.com/)\n  - Create an API token\n  - In n8n, go to Credentials and add `HTTP Query Auth`\n  - Use `?token=yourTokenHere` as the query string\n\n**JSON Body:**\n```json\n{\n  \"hashtags\": [\"{{ $json.Search_Term }}\"],\n  \"resultsLimit\": 20,\n  \"resultsType\": \"posts\"\n}\n```\n\n---\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "09a04fbd-a16b-4166-a623-555770c81605",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        100
      ],
      "parameters": {
        "color": 4,
        "width": 440,
        "height": 1380,
        "content": "\n### 4️⃣ Extract Captions\n\n#### 🧩 Node: `Set bio and follower count`\n- Extracts just the `caption` from each post and stores it in a clean variable for the AI agent to use.\n\n---\n\n### 5️⃣ Aggregate Captions\n\n#### 🧩 Node: `Aggregate`\n- Gathers all captions into one list before processing.\n- Useful for passing a large text block into the AI.\n\n---\n\n### 6️⃣ Convert to Single Text Block\n\n#### 🧩 Node: `Convert table names and columns into single text for agent`\n- Uses a `Code` node to combine all captions into a single string for OpenAI to read:\n```javascript\nreturn [\n  {\n    json: {\n      text: items\n        .map(item => `- ${JSON.stringify(item.json)}`)\n        .join('\\n\\n'),\n    },\n  },\n];\n```\n\n---"
      },
      "typeVersion": 1
    },
    {
      "id": "6a88d748-9563-49b8-9398-9d2032413f94",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        860,
        100
      ],
      "parameters": {
        "color": 6,
        "width": 420,
        "height": 1380,
        "content": "### 7️⃣ Generate Caption Ideas with AI\n\n#### 🧩 Node: `AI Agent`\n- Takes the combined post text and sends it to GPT-4o-mini.\n- Includes this system message:\n```text\nI'm looking for ideas for posts about {{ $('Create Search Term').item.json.Search_Term }}.\nHere’s the last 5 posts on Instagram about the topic. Use those to help me generate a list of relevant captions.\n\nDo not make up ideas that are not like the others in the list.\n\nOutput like this:\n{\n  \"Post Idea\": [\"Idea1\", \"Idea2\"],\n  \"Most Common Post\": [\"common post 1\", \"common post 2\"]\n}\n```\n\n---\n\n### 8️⃣ Choose Language Model\n\n#### 🧩 Node: `OpenAI Chat Model`\n- **Model**: `gpt-4o-mini`\n- **Credential**: Use your OpenAI API key.\n  - Get it from: [OpenAI API Keys](https://platform.openai.com/account/api-keys)\n  - Add it in n8n under OpenAI credentials.\n\n---\n\n### 9️⃣ Parse the AI Output\n\n#### 🧩 Node: `Structured Output Parser`\n- Parses the GPT response into structured JSON:\n```json\n{\n  \"Post Idea\": [\"Idea1\", \"Idea2\"],\n  \"Most Common Post\": [\"common post 1\", \"common post 2\"]\n}\n```\n\n---\n"
      },
      "typeVersion": 1
    },
    {
      "id": "812c1007-ba56-4934-b88f-fcfe1f0bcf01",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -80
      ],
      "parameters": {
        "width": 2320,
        "content": "## 📬 Need More Help?\n\n**👤 Robert Breen**  \nAutomation Consultant | AI Workflow Designer | n8n Expert  \n📧 [robert@ynteractive.com](mailto:robert@ynteractive.com)  \n🔗 [LinkedIn](https://www.linkedin.com/in/robert-breen-29429625/)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "5fee94d6-f796-4785-a806-07714c2f0d64",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        600,
        1100
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "caption"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0381aa63-dfa9-4e94-9991-6b266325d8ad",
      "name": "Convert table names and columns into single text for agent",
      "type": "n8n-nodes-base.code",
      "position": [
        700,
        880
      ],
      "parameters": {
        "jsCode": "return [\n  {\n    json: {\n      text: items\n        .map(item => `- ${JSON.stringify(item.json)}`)\n        .join('\\n\\n'),\n    },\n  },\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "1d2af5fa-b9ef-401d-8b29-b0376d1317b4",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1400,
        1020
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "output['Post Idea']"
      },
      "typeVersion": 1
    },
    {
      "id": "12b8c5e9-3448-4459-ad9b-d6e1af7a7c84",
      "name": "Split Out1",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1420,
        1260
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "output['Most Common Post']"
      },
      "typeVersion": 1
    },
    {
      "id": "73fd8217-6eae-4ce5-a2b5-f0325ea9154e",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1660,
        1140
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "a25480f7-c832-4f8c-80e7-5e1ebd486305",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1300,
        100
      ],
      "parameters": {
        "width": 620,
        "height": 1380,
        "content": "### 🔟 Split the Outputs\n\n#### 🧩 Nodes: `Split Out`, `Split Out1`\n- Separates the `Post Idea` list and `Most Common Post` list into individual items.\n\n---\n\n### 🔁 Merge for Final Output\n\n#### 🧩 Node: `Merge`\n- Combines the two split lists into one output stream.\n\n---"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {
    "AI Agent": [
      {
        "output": {
          "Post Idea": [
            "What are the top 3 automations you've implemented with n8n? Share your experiences!",
            "Ever wondered how n8n can streamline your daily tasks? Let’s discuss the best workflows!",
            "How can n8n transform your business processes? Share your thoughts!",
            "Join our n8n community and learn from others’ automation journeys! What tips do you have to share?",
            "Post about how you used n8n to solve a particular challenge—encourage followers to share their experiences!"
          ],
          "Most Common Post": [
            "Automate your business processes with n8n and focus on what truly matters!",
            "Join our free webinar on using n8n for efficient workflow automation!",
            "Discover how n8n connects different tools to save you time!",
            "Share your favorite tools and how n8n helps you integrate them!",
            "Tag a friend who needs to explore automation with n8n!"
          ]
        }
      }
    ]
  },
  "connections": {
    "a889197b-b78d-4808-948c-6d57883ee34f": {
      "main": [
        [
          {
            "node": "1d2af5fa-b9ef-401d-8b29-b0376d1317b4",
            "type": "main",
            "index": 0
          },
          {
            "node": "12b8c5e9-3448-4459-ad9b-d6e1af7a7c84",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5fee94d6-f796-4785-a806-07714c2f0d64": {
      "main": [
        [
          {
            "node": "0381aa63-dfa9-4e94-9991-6b266325d8ad",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1d2af5fa-b9ef-401d-8b29-b0376d1317b4": {
      "main": [
        [
          {
            "node": "73fd8217-6eae-4ce5-a2b5-f0325ea9154e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "12b8c5e9-3448-4459-ad9b-d6e1af7a7c84": {
      "main": [
        [
          {
            "node": "73fd8217-6eae-4ce5-a2b5-f0325ea9154e",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "00910de9-80ba-41c9-8200-81fcb6d15f45": {
      "main": [
        [
          {
            "node": "33a01e12-8820-4184-92fb-6682470940b1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "47f4b1cb-9361-4aff-a439-2c8979fe93f4": {
      "ai_languageModel": [
        [
          {
            "node": "a889197b-b78d-4808-948c-6d57883ee34f",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "5a62f897-74a6-4899-a8c9-a51a6d011373": {
      "main": [
        [
          {
            "node": "00910de9-80ba-41c9-8200-81fcb6d15f45",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2b0f574d-7976-469a-bf84-00a37ef15def": {
      "ai_outputParser": [
        [
          {
            "node": "a889197b-b78d-4808-948c-6d57883ee34f",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "33a01e12-8820-4184-92fb-6682470940b1": {
      "main": [
        [
          {
            "node": "5fee94d6-f796-4785-a806-07714c2f0d64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2ea0c49a-6706-4272-8990-06f578c5c5a7": {
      "main": [
        [
          {
            "node": "5a62f897-74a6-4899-a8c9-a51a6d011373",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0381aa63-dfa9-4e94-9991-6b266325d8ad": {
      "main": [
        [
          {
            "node": "a889197b-b78d-4808-948c-6d57883ee34f",
            "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 - Content-Erstellung, 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 Nodes17
Kategorie2
Node-Typen11
Schwierigkeitsbeschreibung

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

Autor
Robert Breen

Robert Breen

@rbreen

Professional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.

Externe Links
Auf n8n.io ansehen

Diesen Workflow teilen

Kategorien

Kategorien: 34