AutomationFlowsAI & RAG › AI-Powered Instagram Carousel Post Creator

AI-Powered Instagram Carousel Post Creator

Original n8n title: Create Publish Instagram Carousel Posts with Gpt-4.1-mini Imgur Graph API

Create Publish Instagram Carousel Posts With Gpt-4.1-Mini Imgur Graph Api. Uses agent, lmChatOpenAi, vectorStoreInMemory, embeddingsOpenAi. Scheduled trigger; 26 nodes.

Cron / scheduled trigger★★★★☆ complexityAI-powered26 nodesAgentOpenAI ChatIn-Memory Vector StoreOpenAI EmbeddingsMemory Buffer WindowTool Vector StoreOpenRouter ChatGoogle Sheets
AI & RAG Trigger: Cron / scheduled Nodes: 26 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Agent → OpenAI Embeddings recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "nodes": [
    {
      "id": "f1e47fca-653b-4d59-a06b-138e0f66847b",
      "name": "Parsear JSON Inicial",
      "type": "n8n-nodes-base.code",
      "position": [
        864,
        288
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "// Accedemos al campo \"output\" que contiene un string JSON anidado\nlet rawText = $json.output;\n\nif (!rawText || typeof rawText !== 'string' || rawText.trim() === '') {\n    throw new Error(\"Error Cr\u00edtico: No se recibi\u00f3 texto v\u00e1lido (string no vac\u00edo) en el campo 'output'.\");\n}\n\n// Limpiar delimitadores tipo ```json y ```\nrawText = rawText.trim();\nrawText = rawText.replace(/^```(?:json)?\\s*/i, '').replace(/\\s*```$/, '').trim();\n\n// Envolver en llaves si no las tiene\nif (!rawText.startsWith('{')) {\n    rawText = '{' + rawText;\n}\nif (!rawText.endsWith('}')) {\n    rawText = rawText + '}';\n}\n\n// Truncar por si hay texto basura despu\u00e9s del cierre\nconst lastBrace = rawText.lastIndexOf(\"}\");\nif (lastBrace !== -1) {\n    rawText = rawText.slice(0, lastBrace + 1).trim();\n}\n\nconsole.log(\"Texto limpio para parsear (Inicial):\", rawText);\n\ntry {\n    const parsed = JSON.parse(rawText);\n\n    if (typeof parsed !== 'object' || parsed === null) {\n        throw new Error(\"El texto parseado no es un objeto JSON v\u00e1lido.\");\n    }\n\n    return { json: parsed };\n} catch (error) {\n    console.error(\"Error al parsear JSON:\", error.message);\n    console.error(\"Texto recibido:\", rawText);\n    throw new Error(`Error al parsear el campo 'output': ${error.message}`);\n}\n"
      },
      "typeVersion": 2
    },
    {
      "id": "903b082a-5e2f-4a1c-9e74-5162e77f10cb",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        80,
        288
      ],
      "parameters": {
        "text": "=# Prompt para gera\u00e7\u00e3o de publica\u00e7\u00e3o em carrossel no Instagram\n\n## Configura\u00e7\u00e3o de contexto\nTema da Publica\u00e7\u00e3o: \"{{ $json.tema }}\"\n\nAntes de iniciar a cria\u00e7\u00e3o, conecte-se ao banco de dados Supabase (PostgreSQL) utilizando as vari\u00e1veis de ambiente SUPABASE_URL e SUPABASE_KEY. Na tabela `publicacoes` (schema `public`), consulte registros existentes com o mesmo tema ou palavras-chave similares nas colunas `titulo_slide` e `copy_principal`. Garanta que o novo conte\u00fado seja \u00fanico, evitando repetir fala, exemplos ou chamadas j\u00e1 publicados.\n\n## Objetivo Principal\nEducar, atrair e converter seguidores em clientes e alunos, mostrando de forma clara os benef\u00edcios e possibilidades da automa\u00e7\u00e3o com n8n e intelig\u00eancia artificial.\n\n## Estilo e Tom\n- Tom profissional, direto e did\u00e1tico, com autoridade t\u00e9cnica.\n- Varie entre:\n  1. Mini hist\u00f3rias de transforma\u00e7\u00e3o\n  2. Listas pr\u00e1ticas (\u201c3 formas de automatizar seu atendimento com n8n\u201d)\n  3. Erros comuns e como evit\u00e1-los\n  4. Estudos de caso (\u201cComo ajudamos um cliente a economizar 15h por semana\u201d)\n  5. Argumentos racionais para ado\u00e7\u00e3o de IA e automa\u00e7\u00e3o\n- Sempre inclua men\u00e7\u00e3o sutil de que oferecemos servi\u00e7os, suporte ou cursos para implementa\u00e7\u00e3o.\n\n## Instru\u00e7\u00f5es de Formato\nSua resposta DEVE ser \u00fanica e exclusivamente um **objeto JSON** v\u00e1lido, com as chaves exatas:\n- `\"titulo_slide\"`: t\u00edtulo impactante para o primeiro slide, gerando curiosidade ou identificando uma dor.\n- `\"copy_principal\"`: texto principal da publica\u00e7\u00e3o, pr\u00e1tico e inspirador, com frases curtas, emojis e quebras de linha.\n- `\"idea_imagem\"`: descri\u00e7\u00e3o detalhada de uma imagem profissional que ilustre o tema, com estilo gr\u00e1fico, cores, composi\u00e7\u00e3o e emo\u00e7\u00e3o.\n- `\"hashtags\"`: string contendo hashtags espec\u00edficas (#AutomacaoComIA, #n8nBrasil, etc.).\n- `\"cta\"`: escolha **aleat\u00f3ria** de uma das seguintes frases:\n  1. \"Quer automatizar seu neg\u00f3cio com n8n? Envie uma DM com a palavra AUTOMATIZAR \ud83d\udce9\"\n  2. \"Pronto para dominar o n8n? Acesse nosso curso completo e comece hoje mesmo!\"\n  3. \"Transforme seu tempo em lucro com automa\u00e7\u00f5es inteligentes. Agende uma consultoria!\"\n  4. \"Te ajudo a criar fluxos personalizados com IA \u2013 fale comigo!\"\n  5. \"Clique no link da bio e aprenda a criar sua primeira automa\u00e7\u00e3o com IA em minutos.\"\n  6. \"Salve esta publica\u00e7\u00e3o e use como refer\u00eancia para seu pr\u00f3ximo projeto automatizado.\"\n\n**N\u00e3o** inclua nenhum outro texto, coment\u00e1rio ou marca\u00e7\u00f5es antes ou depois do JSON.  \nCertifique-se de que o JSON seja perfeitamente v\u00e1lido para parsing direto.  \n",
        "options": {
          "systemMessage": "=Atue como um especialista em marketing digital voltado para servi\u00e7os t\u00e9cnicos e educacionais de automa\u00e7\u00e3o com intelig\u00eancia artificial. Voc\u00ea representa um perfil profissional no Instagram que oferece:\n\nIMPORTANTE:\nAntes de gerar a publica\u00e7\u00e3o, consulte o hist\u00f3rico de conte\u00fados . Evite repetir ideias, abordagens ou estruturas j\u00e1 utilizadas. Com base no hist\u00f3rico, ofere\u00e7a uma nova perspectiva ou destaque uma situa\u00e7\u00e3o de aplica\u00e7\u00e3o diferente da automa\u00e7\u00e3o.\n- Configura\u00e7\u00e3o e manuten\u00e7\u00e3o de automa\u00e7\u00f5es com n8n\n- Cria\u00e7\u00e3o de fluxos personalizados com IA\n- Cursos, workshops e mentorias sobre automa\u00e7\u00e3o para criadores, empreendedores e empresas\n- Suporte e consultoria estrat\u00e9gica em automa\u00e7\u00f5es\n\n\nSeu papel \u00e9 criar publica\u00e7\u00f5es com alto valor percebido, voltadas a atrair clientes e alunos para esses servi\u00e7os."
        },
        "promptType": "define"
      },
      "typeVersion": 1.8
    },
    {
      "id": "f4932df2-7556-498f-aa41-bf5f3b458ddd",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -976,
        768
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 12
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7c8b0e72-446a-499e-8bd8-9893fb94cda9",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -976,
        208
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "77629d55-a262-43cb-86b2-fdf0d65358ff",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -64,
        624
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini-2025-04-14",
          "cachedResultName": "gpt-4.1-mini-2025-04-14"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "3e13bddc-0c22-47d8-8235-584f877d8b57",
      "name": "Simple Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        464,
        960
      ],
      "parameters": {
        "memoryKey": "query"
      },
      "typeVersion": 1.1
    },
    {
      "id": "5c5ffa30-e0d4-4e6b-8ed1-3f5875a33947",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        320,
        1104
      ],
      "parameters": {
        "model": "text-embedding-ada-002",
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "f7527187-9d94-486f-8eaa-029be5af317a",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        128,
        592
      ],
      "parameters": {
        "sessionKey": "={{ $json.tema }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 20
      },
      "typeVersion": 1.3
    },
    {
      "id": "4ea63367-8e23-46ee-a443-b167747bb572",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        608
      ],
      "parameters": {
        "width": 340,
        "height": 460,
        "content": "## trigger temporal\n** configurar a frecuencia das postagens\n"
      },
      "typeVersion": 1
    },
    {
      "id": "03d9f4d5-e99c-4dba-93f2-b3fe87069971",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        48
      ],
      "parameters": {
        "color": 4,
        "width": 340,
        "height": 460,
        "content": "## trugger manual\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c302a692-6806-4594-ab90-f98e28c3b461",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -576,
        272
      ],
      "parameters": {
        "color": 5,
        "width": 340,
        "height": 460,
        "content": "## temas aleatorios pra o AGENTE\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "baeee912-92aa-4778-b838-6c5efaf7c8f2",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        0
      ],
      "parameters": {
        "color": 5,
        "width": 780,
        "height": 1040,
        "content": "## agente conectado a base de dados vectorial pra busca semantica\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "1532dc09-b606-413d-944f-03382550fb89",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        768,
        80
      ],
      "parameters": {
        "width": 360,
        "height": 480,
        "content": "## parsea os dados do JSON"
      },
      "typeVersion": 1
    },
    {
      "id": "fd03c333-ba37-4948-bb83-1a78da37bff8",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1152,
        80
      ],
      "parameters": {
        "color": 3,
        "width": 360,
        "height": 480,
        "content": "## Guarda em SHEETS uma lista das publicacoes\n"
      },
      "typeVersion": 1
    },
    {
      "id": "14dc5a32-4dc9-4a6a-b6de-9cbebeb37422",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        80
      ],
      "parameters": {
        "color": 5,
        "width": 360,
        "height": 480,
        "content": "## Gera imagen com OPENAI\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b1fcce30-d3c4-492c-935e-9582e4fde8b8",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2032,
        80
      ],
      "parameters": {
        "color": 5,
        "width": 360,
        "height": 480,
        "content": "## SUBE IMAGEM PRA SERVIDOR  URL\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "88aa6dee-4760-4e71-a18a-c92decea1184",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2448,
        80
      ],
      "parameters": {
        "color": 5,
        "width": 600,
        "height": 480,
        "content": "## container e postagem instagram\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b76edd69-654e-4e29-9eb2-687e88852079",
      "name": "Answer questions with a vector store",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        512,
        688
      ],
      "parameters": {
        "description": "publicacoes antigas, pra nao repetir"
      },
      "typeVersion": 1.1
    },
    {
      "id": "4ff9e0f1-a96a-4a8c-bd40-801c21744959",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        752,
        848
      ],
      "parameters": {
        "model": "google/gemini-2.0-flash-exp:free",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "501b9e3f-c6a6-41a2-825b-998e08437f31",
      "name": "Simple Vector Store1",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        288,
        848
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolName": "publicacoes",
        "memoryKey": "query",
        "toolDescription": "guarda as publicacoes "
      },
      "typeVersion": 1.1
    },
    {
      "id": "03b9f2fb-519a-4f50-b99d-fa5a992ec0d1",
      "name": "generate search term",
      "type": "n8n-nodes-base.code",
      "position": [
        -464,
        432
      ],
      "parameters": {
        "jsCode": "// Defina seus vetores de segmentos\nconst inicios = [\n  \"Automatize\", \"Otimize\", \"Domine\", \"Descubra\", \"Implemente\", \"Transforme\",\n  \"Acelere\", \"Descomplique\", \"Agilize\", \"Estruture\", \"Crie\", \"Simplifique\",\n  \"Configure\", \"Mantenha\", \"Integre\", \"Escale\", \"Controle\", \"Inove\",\n  \"Aplique\", \"Explore\"\n];\n\nconst focos = [\n  \"seus processos com n8n\", \"rotinas com intelig\u00eancia artificial\",\n  \"tarefas manuais com automa\u00e7\u00f5es\", \"vendas com fluxos inteligentes\",\n  \"suporte t\u00e9cnico automatizado\", \"consultorias com IA\",\n  \"atendimentos com bots no n8n\", \"funis de marketing com automa\u00e7\u00f5es\",\n  \"conte\u00fado com gera\u00e7\u00e3o autom\u00e1tica\", \"opera\u00e7\u00f5es internas com fluxos visuais\",\n  \"suas integra\u00e7\u00f5es com ferramentas no-code\",\n  \"toda sua opera\u00e7\u00e3o digital com automa\u00e7\u00f5es\",\n  \"respostas r\u00e1pidas com fluxos n8n\",\n  \"suas planilhas com IA conectada\",\n  \"o envio de e-mails com regras inteligentes\",\n  \"clientes com jornadas personalizadas\",\n  \"mensagens autom\u00e1ticas e criativas\",\n  \"estrat\u00e9gias de vendas com automa\u00e7\u00f5es\",\n  \"CRM com fluxos autom\u00e1ticos\",\n  \"sistemas personalizados usando IA\"\n];\n\nconst beneficios = [\n  \"para escalar seu neg\u00f3cio digital\", \"para ganhar tempo todos os dias\",\n  \"para vender mesmo enquanto dorme\", \"para eliminar tarefas repetitivas\",\n  \"para crescer com intelig\u00eancia\", \"para ter mais foco no que importa\",\n  \"para conquistar mais clientes\", \"para automatizar seu funil de vendas\",\n  \"para oferecer suporte sem perder tempo\",\n  \"para ensinar seus alunos com menos esfor\u00e7o\",\n  \"para transformar seu conte\u00fado em lucro\",\n  \"para turbinar sua rotina de forma pr\u00e1tica\",\n  \"para trabalhar menos e faturar mais\",\n  \"para ter um sistema funcionando por voc\u00ea\",\n  \"para gerenciar sua empresa com automa\u00e7\u00f5es inteligentes\",\n  \"para aplicar IA na sua estrat\u00e9gia de neg\u00f3cios\",\n  \"para deixar a tecnologia trabalhar para voc\u00ea\",\n  \"para ter controle e autonomia sobre seus fluxos\",\n  \"para criar sistemas poderosos sem programar\",\n  \"para aplicar IA na vida real\"\n];\n\n// Cria um array de formatos usando template literals (backticks)\nconst formatos = [\n  `${inicios[Math.floor(Math.random() * inicios.length)]} ${focos[Math.floor(Math.random() * focos.length)]} ${beneficios[Math.floor(Math.random() * beneficios.length)]}.`,\n  `\u2699\ufe0f ${inicios[Math.floor(Math.random() * inicios.length)]} agora ${focos[Math.floor(Math.random() * focos.length)]} e veja ${beneficios[Math.floor(Math.random() * beneficios.length)]}.`,\n  `\ud83d\ude80 Como ${focos[Math.floor(Math.random() * focos.length)]} pode ajudar voc\u00ea ${beneficios[Math.floor(Math.random() * beneficios.length)]}?`,\n  `\ud83d\udd27 Voc\u00ea j\u00e1 pensou em ${focos[Math.floor(Math.random() * focos.length)]} ${beneficios[Math.floor(Math.random() * beneficios.length)]}?`,\n  `\ud83d\udca1 O segredo de quem escala r\u00e1pido: ${inicios[Math.floor(Math.random() * inicios.length)]} ${focos[Math.floor(Math.random() * focos.length)]} ${beneficios[Math.floor(Math.random() * beneficios.length)]}.`,\n  `\ud83d\udcca Automatiza\u00e7\u00e3o na pr\u00e1tica: ${focos[Math.floor(Math.random() * focos.length)]} \u2014 ${beneficios[Math.floor(Math.random() * beneficios.length)]}.`,\n  `\ud83e\udde0 IA + n8n: Descubra como ${focos[Math.floor(Math.random() * focos.length)]} pode ser aplicado ${beneficios[Math.floor(Math.random() * beneficios.length)]}.`,\n  `\u23f3 Chega de perder tempo: ${inicios[Math.floor(Math.random() * inicios.length)]} ${focos[Math.floor(Math.random() * focos.length)]}.`,\n  `\ud83d\udcda Aprenda a ${inicios[Math.floor(Math.random() * inicios.length)].toLowerCase()} ${focos[Math.floor(Math.random() * focos.length)]} e aplique ${beneficios[Math.floor(Math.random() * beneficios.length)]}.`\n];\n\n// Escolhe um formato aleat\u00f3rio\nconst tema = formatos[Math.floor(Math.random() * formatos.length)];\n\n// Retorna um \u00fanico item \u2014 este formato funciona no Code Node do n8n\nreturn [\n  {\n    json: {\n      tema,\n      data: new Date().toISOString(),\n    },\n  },\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "ba5590b1-c248-42a1-8a15-db410784b7d2",
      "name": "save in sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1280,
        288
      ],
      "parameters": {
        "columns": {
          "value": {
            "cta": "={{ $json.cta }}",
            "Tema": "={{ $('generate search term').item.json.tema }}",
            "fecha": "={{ $('generate search term').item.json.data }}",
            "hashtags": "={{ $json.hashtags }}",
            "idea_imagen": "={{ $json.idea_imagem }}",
            "titulo_slide": "={{ $json.titulo_slide }}",
            "copy_principal": "={{ $json.copy_principal }}"
          },
          "schema": [
            {
              "id": "titulo_slide",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "titulo_slide",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "copy_principal",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "copy_principal",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "idea_imagen",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "idea_imagen",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "hashtags",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "hashtags",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "cta",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "cta",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "fecha",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "fecha",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Tema",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Tema",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1MtFcyeWtO-D5i-_nFIUqaSVMTZgX0EyApBeHjjoIM08/edit#gid=0",
          "cachedResultName": "P\u00e1gina1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1MtFcyeWtO-D5i-_nFIUqaSVMTZgX0EyApBeHjjoIM08",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1MtFcyeWtO-D5i-_nFIUqaSVMTZgX0EyApBeHjjoIM08/edit?usp=drivesdk",
          "cachedResultName": "Publicaciones IA"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "f99b58f7-a911-4ee8-a0ad-34402d050645",
      "name": "upload image to imgur",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2144,
        288
      ],
      "parameters": {
        "url": "https://api.imgur.com/3/image",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "binaryData",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "yourtoken here"
            }
          ]
        },
        "inputDataFieldName": "data"
      },
      "typeVersion": 4.2
    },
    {
      "id": "df5f00dc-094e-44f8-b3f8-f864207508d5",
      "name": "create container",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2528,
        288
      ],
      "parameters": {
        "url": "https://graph.instagram.com/v22.0/{accountID}/media",
        "method": "=POST",
        "options": {},
        "sendBody": true,
        "sendQuery": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "image_url",
              "value": "={{ $json.data.link }}"
            },
            {
              "name": "caption",
              "value": "={{ $('save in sheets').item.json.titulo_slide + \"\\n\\n\" + $('save in sheets').item.json.copy_principal + \"\\n\\n\" + $('save in sheets').item.json.cta + \"\\n\\n\" + $('save in sheets').item.json.hashtags }}\n\n"
            }
          ]
        },
        "queryParameters": {
          "parameters": [
            {
              "name": "access_token",
              "value": "{yourtoken}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "dedd3f0b-0800-4ea4-a254-87698dfc300e",
      "name": "POst to instagram",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2752,
        288
      ],
      "parameters": {
        "url": "https://graph.instagram.com/v22.0/{account_ID}/media_publish",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "creation_id",
              "value": "={{ $json.id }}"
            },
            {
              "name": "access_token",
              "value": "Yourtoken"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5aabc5db-2364-44ce-8c2e-c4b1f7de1c01",
      "name": "generate image",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1632,
        288
      ],
      "parameters": {
        "model": "gpt-image-1",
        "prompt": "={{ $('Parsear JSON Inicial').item.json.idea_imagem }} en formato jpg",
        "options": {},
        "resource": "image"
      },
      "typeVersion": 1.8
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Parsear JSON Inicial",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "generate image": {
      "main": [
        [
          {
            "node": "upload image to imgur",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "save in sheets": {
      "main": [
        [
          {
            "node": "generate image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "generate search term",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create container": {
      "main": [
        [
          {
            "node": "POst to instagram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Simple Vector Store",
            "type": "ai_embedding",
            "index": 0
          },
          {
            "node": "Simple Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Vector Store": {
      "ai_vectorStore": [
        [
          {
            "node": "Answer questions with a vector store",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "Parsear JSON Inicial": {
      "main": [
        [
          {
            "node": "save in sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Vector Store1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "generate search term": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Answer questions with a vector store",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "upload image to imgur": {
      "main": [
        [
          {
            "node": "create container",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "generate search term",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Answer questions with a vector store": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Create Publish Instagram Carousel Posts With Gpt-4.1-Mini Imgur Graph Api. Uses agent, lmChatOpenAi, vectorStoreInMemory, embeddingsOpenAi. Scheduled trigger; 26 nodes.

Source: https://github.com/zengfr/n8n-workflow-all-templates/blob/6a3e60251e39ea8c87e061d82f52633e5d0debe6/n8n-workflow-all-templates/00/00/36/3693_Create___Publish_Instagram_Carousel_Posts_with_GPT-4.1-mini__Imgur___Graph_API.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This workflow automates patient communication for medical clinics using the WhatsApp Business API. It supports appointment booking, rescheduling, service inquiries, follow-ups, and document submission

Google Sheets, Data Table, Data Table Tool +12
AI & RAG

WooriFisa 최종. Uses memoryMongoDbChat, agent, httpRequest, documentDefaultDataLoader. Scheduled trigger; 68 nodes.

Memory Mongo Db Chat, Agent, HTTP Request +14
AI & RAG

This workflow automates intellectual property (IP) monitoring, conflict detection, and governance reporting for IP counsel, legal operations teams, and compliance officers. It eliminates the manual ef

Agent, OpenAI Chat, Memory Buffer Window +9
AI & RAG

This workflow automates academic research processing by routing queries through specialized AI models while maintaining contextual memory. Designed for researchers, faculty, and graduate students, it

HTTP Request, Agent, OpenAI Chat +7
AI & RAG

Every day at 8 AM, the workflow automatically retrieves the latest F1 data—including driver standings, qualifying results, race schedules, and circuit information. All sources are merged into a unifie

HTTP Request, Agent, OpenAI Chat +9