Générer automatiquement des publications de médias sociaux à partir d'URL en utilisant l'IA, Telegram et une publication multiplateforme

Avancé

Ceci est unContent Creation, Multimodal AIworkflow d'automatisation du domainecontenant 42 nœuds.Utilise principalement des nœuds comme If, Set, Code, Merge, Function. Génération automatique de publications de médias sociaux avec AI, Telegram et publication multiplateforme à partir d'URL

Prérequis
  • Informations d'identification LinkedIn API
  • Token Bot Telegram
  • Peut nécessiter les informations d'identification d'authentification de l'API cible
  • Informations d'identification Google Sheets API
  • Clé API OpenAI
  • Clé API Google Gemini
Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "nodes": [
    {
      "name": "Telegram Bot Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        0,
        544
      ],
      "webhookId": "9ea69b50-b6ca-4968-918a-8ca35b8ad7d7",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "",
          "name": "YOUR_TELEGRAM_API_CREDENTIAL"
        }
      },
      "typeVersion": 1,
      "id": "Telegram-Bot-Trigger-0"
    },
    {
      "name": "Vue d'ensemble du workflow",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -576,
        336
      ],
      "parameters": {
        "width": 389,
        "height": 384,
        "content": "# 📱 Telegram URL Processor\n\nThis workflow receives URLs from Telegram and processes them into social media content:\n\n- ✅ Extracts URL from message\n- 📊 Saves to Google Sheets\n- 📄 Fetches content\n- 🤖 AI summarization\n- 🎨 Image generation\n- 📱 Multi-platform posting\n- ✅ Returns post URLs"
      },
      "typeVersion": 1,
      "id": "Vue-d-ensemble-du-workflow-1"
    },
    {
      "name": "Extraire l'URL",
      "type": "n8n-nodes-base.function",
      "position": [
        448,
        448
      ],
      "parameters": {
        "functionCode": "// Extract URL from Telegram message\nconst message = $json.message.text;\nconst urlRegex = /(https?:\\/\\/[^\\s]+)/g;\nconst urls = message.match(urlRegex);\n\nif (!urls || urls.length === 0) {\n  throw new Error('No URL found in the message');\n}\n\nconst extractedUrl = urls[0];\nconst chatId = $json.message.chat.id;\nconst messageId = $json.message.message_id;\nconst timestamp = new Date().toISOString();\n\nreturn {\n  json: {\n    url: extractedUrl,\n    chatId: chatId,\n    messageId: messageId,\n    timestamp: timestamp,\n    originalMessage: message\n  }\n};"
      },
      "typeVersion": 1,
      "id": "Extraire-l-URL-2"
    },
    {
      "name": "Récupérer le contenu de l'URL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        896,
        448
      ],
      "parameters": {
        "url": "={{ $node['Extract URL'].json.url }}",
        "options": {
          "redirect": {
            "redirect": {}
          },
          "response": {
            "response": {
              "fullResponse": true
            }
          }
        }
      },
      "typeVersion": 4.2,
      "id": "R-cup-rer-le-contenu-de-l-URL-3"
    },
    {
      "name": "Extraire le contenu texte",
      "type": "n8n-nodes-base.function",
      "position": [
        1120,
        448
      ],
      "parameters": {
        "functionCode": "// Extract text content from HTML\nconst html = $json.data;\nconst url = $node['Extract URL'].json.url;\n\n// Simple HTML to text conversion\nlet textContent = html\n  .replace(/<script[^>]*>.*?<\\/script>/gi, '')\n  .replace(/<style[^>]*>.*?<\\/style>/gi, '')\n  .replace(/<[^>]*>/g, ' ')\n  .replace(/\\s+/g, ' ')\n  .trim();\n\n// Extract title (simple approach)\nconst titleMatch = html.match(/<title[^>]*>([^<]+)<\\/title>/i);\nconst title = titleMatch ? titleMatch[1].trim() : 'Article';\n\n// Limit content length for AI processing\nif (textContent.length > 8000) {\n  textContent = textContent.substring(0, 8000) + '...';\n}\n\nif (textContent.length < 100) {\n  throw new Error('Could not extract meaningful content from the URL');\n}\n\nreturn {\n  json: {\n    url: url,\n    title: title,\n    content: textContent,\n    wordCount: textContent.split(' ').length\n  }\n};"
      },
      "typeVersion": 1,
      "id": "Extraire-le-contenu-texte-4"
    },
    {
      "name": "Traitement IA",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1328,
        64
      ],
      "parameters": {
        "width": 280,
        "height": 864,
        "content": "# 🤖 AI Content Generation\n\nThis section handles:\n- Content summarization\n- Social media post creation\n- Image description generation\n- Platform-specific optimization"
      },
      "typeVersion": 1,
      "id": "Traitement-IA-5"
    },
    {
      "name": "Publier sur Facebook",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3520,
        276
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v19.0/[INSERT_YOUR_SITE_ID]/photos",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "form-urlencoded",
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "caption",
              "value": "={{ $input.first().json.message.content }}"
            },
            {
              "name": "=url",
              "value": "={{ $item(0).$node[\"Supabase Public URL\"].json[\"public_url\"] }}"
            },
            {
              "value": "="
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/x-www-form-urlencoded"
            }
          ]
        },
        "nodeCredentialType": "facebookGraphApi"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "",
          "name": "YOUR_FACEBOOK_GRAPH_API_CREDENTIAL"
        }
      },
      "typeVersion": 4.2,
      "id": "Publier-sur-Facebook-6"
    },
    {
      "name": "Publier sur Instagram",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3520,
        468
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v23.0/[INSERT_YOUR_SITE_ID]/media",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "form-urlencoded",
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "image_url",
              "value": "={{ $item(0).$node[\"Supabase Public URL\"].json[\"public_url\"] }}"
            },
            {
              "name": "caption",
              "value": "={{ $input.first().json.message.content }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/x-www-form-urlencoded"
            }
          ]
        },
        "nodeCredentialType": "facebookGraphApi"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "",
          "name": "YOUR_FACEBOOK_GRAPH_API_CREDENTIAL"
        }
      },
      "typeVersion": 4.2,
      "id": "Publier-sur-Instagram-7"
    },
    {
      "name": "Mise à jour du statut final",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        4864,
        448
      ],
      "parameters": {
        "columns": {
          "value": {
            "Image URL": "={{ $item(0).$node[\"Supabase Public URL\"].json[\"public_url\"] }}",
            "Source URL": "={{ $node[\"Telegram Bot Trigger\"].json.message.text }}",
            "Facebook URL": "={{ $json.facebook_post_url }}",
            "LinkedIn URL": "={{ $json.linkedin_post_url }}",
            "Instagram URL": "={{ $json.instagram_post_url }}",
            "Facebook Content": "={{ $node[\"Facebook Post\"].json.message.content }}",
            "Instagram Content": "={{ $node[\"Instagram Post\"].json.message.content }}",
            "LinkedIn Content ": "={{ $node[\"LinkedIn Post\"].json.message.content }}"
          },
          "schema": [
            {
              "id": "Source URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Source URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Facebook Content",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Facebook Content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Facebook URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Facebook URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Instagram Content",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Instagram Content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Instagram URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Instagram URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "LinkedIn Content ",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "LinkedIn Content ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "LinkedIn URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "LinkedIn URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Image URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Source URL"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1b7k0A06DY_oI3Ex6fR48FN0PXK6g59U4714wBYUCezw/edit#gid=0",
          "cachedResultName": "Arkusz1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1b7k0A06DY_oI3Ex6fR48FN0PXK6g59U4714wBYUCezw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1b7k0A06DY_oI3Ex6fR48FN0PXK6g59U4714wBYUCezw/edit?usp=drivesdk",
          "cachedResultName": "n8n - Telegram Social Media Content Automation"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": "YOUR_GOOGLE_SHEETS_OAUTH2_API_CREDENTIAL"
        }
      },
      "typeVersion": 4,
      "alwaysOutputData": true,
      "id": "Mise-jour-du-statut-final-8"
    },
    {
      "name": "Phase de publication",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4568,
        -44
      ],
      "parameters": {
        "height": 652,
        "content": "# 📱 Social Media Publishing\n\nPosts content to:\n- Facebook Pages via Graph API\n- Instagram Business via Graph API\n- LinkedIn via REST API"
      },
      "typeVersion": 1,
      "id": "Phase-de-publication-9"
    },
    {
      "name": "Publier sur Instagram1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3744,
        468
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v23.0/[INSERT_YOUR_SITE_ID]/media_publish",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "form-urlencoded",
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "creation_id",
              "value": "={{ $json.id }}"
            },
            {
              "name": "access_token",
              "value": "={{ $credentials.facebookGraph.accessToken }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/x-www-form-urlencoded"
            }
          ]
        },
        "nodeCredentialType": "facebookGraphApi"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "",
          "name": "YOUR_FACEBOOK_GRAPH_API_CREDENTIAL"
        }
      },
      "typeVersion": 4.2,
      "id": "Publier-sur-Instagram1-10"
    },
    {
      "name": "Facebook Post",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1344,
        368
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-nano",
          "cachedResultName": "GPT-4.1-NANO"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Based on the provided article content, create a Facebook post that is professional yet approachable, ranging from 100-200 words. The tone should be informative and engaging, with occasional light humor when appropriate to the topic. Focus on the key takeaway or most interesting insight from the article. Include a clear call-to-action that encourages meaningful discussion in the comments. The post should feel conversational and relatable while maintaining credibility. If the topic allows, incorporate a subtle touch of humor or a relatable analogy that your professional network would appreciate. Keep the language of the original text. End with a thoughtful question to spark engagement.:  {{ $('Extract Text Content').item.json.content }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "",
          "name": "YOUR_OPEN_AI_API_CREDENTIAL"
        }
      },
      "typeVersion": 1.8,
      "id": "Facebook-Post-11"
    },
    {
      "name": "Instagram Post",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1344,
        560
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-nano",
          "cachedResultName": "GPT-4.1-NANO"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Transform the article content into a punchy Instagram post of 50-80 words maximum. Use a casual, energetic tone with 2-3 relevant emojis strategically placed. Include wordplay, puns, or clever turns of phrase when they fit naturally. Focus on one compelling hook or surprising fact from the article. Write in short, impactful sentences that work well with Instagram's visual-first format. Include 3-5 relevant hashtags at the end. The post should feel fresh, scrollable, and shareable while still delivering value from the original content. Keep the languafe of the original:  {{ $('Extract Text Content').item.json.content }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "",
          "name": "YOUR_OPEN_AI_API_CREDENTIAL"
        }
      },
      "typeVersion": 1.8,
      "id": "Instagram-Post-12"
    },
    {
      "name": "LinkedIn Post",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1344,
        744
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-nano",
          "cachedResultName": "GPT-4.1-NANO"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Create an engaging, professional LinkedIn post (max 400 characters) based on this article:  {{ $('Extract Text Content').item.json.content }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "",
          "name": "YOUR_OPEN_AI_API_CREDENTIAL"
        }
      },
      "typeVersion": 1.8,
      "id": "LinkedIn-Post-13"
    },
    {
      "name": "Fusion",
      "type": "n8n-nodes-base.merge",
      "position": [
        3296,
        276
      ],
      "parameters": {},
      "typeVersion": 3.2,
      "id": "Fusion-14"
    },
    {
      "name": "Fusion1",
      "type": "n8n-nodes-base.merge",
      "position": [
        3296,
        468
      ],
      "parameters": {},
      "typeVersion": 3.2,
      "id": "Fusion1-15"
    },
    {
      "name": "Fusion2",
      "type": "n8n-nodes-base.merge",
      "position": [
        3296,
        888
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2,
      "id": "Fusion2-16"
    },
    {
      "name": "Si le message contient une URL",
      "type": "n8n-nodes-base.if",
      "position": [
        224,
        544
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "dc0117b8-213b-4c6f-934e-583fe2ec7d45",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "=={{ ($json.message.text || '').match(/https?:\\/\\/\\S+/) !== null }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2,
      "id": "Si-le-message-contient-une-URL-17"
    },
    {
      "name": "Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        448,
        640
      ],
      "webhookId": "7e3d2ccb-9161-43d5-99c6-a2286541886a",
      "parameters": {
        "text": "You can't do this here. You need to upload a URL with an article.",
        "chatId": "={{ $json.message.chat.id }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "",
          "name": "YOUR_TELEGRAM_API_CREDENTIAL"
        }
      },
      "typeVersion": 1.2,
      "id": "Telegram-18"
    },
    {
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        3968,
        272
      ],
      "parameters": {
        "jsCode": "const id = $json.post_id || $json.id || '';\nconst parts = id.split('_');\nconst postId = parts.length > 1 ? parts[1] : '';\nconst facebookUsername = '<YOUR_FACEBOOK_PAGE_USERNAME>';\nconst facebookPostUrl = postId\n  ? `https://facebook.com/${facebookUsername}/posts/${postId}`\n  : '';\n\nreturn {\n  json: {\n    facebook_post_id: postId,\n    facebook_post_url: facebookPostUrl,\n    facebook_published: !!postId\n  }\n};\n"
      },
      "typeVersion": 2,
      "id": "Code-19"
    },
    {
      "name": "Code1",
      "type": "n8n-nodes-base.code",
      "position": [
        4192,
        468
      ],
      "parameters": {
        "jsCode": "const mediaId = $json.id || '';\nreturn {\n  json: {\n    instagram_post_id: mediaId,\n    instagram_post_url: $input.first().json.permalink, // nie mamy shortcode :(\n    instagram_published: !!mediaId\n  }\n};\n"
      },
      "typeVersion": 2,
      "id": "Code1-20"
    },
    {
      "name": "LinkedIn",
      "type": "n8n-nodes-base.linkedIn",
      "position": [
        3744,
        888
      ],
      "parameters": {
        "text": "={{ $('LinkedIn Post').item.json.message.content }}",
        "person": "wZFKPz_aPr",
        "additionalFields": {},
        "shareMediaCategory": "IMAGE"
      },
      "credentials": {
        "linkedInOAuth2Api": {
          "id": "",
          "name": "YOUR_LINKED_IN_OAUTH2_API_CREDENTIAL"
        }
      },
      "typeVersion": 1,
      "id": "LinkedIn-21"
    },
    {
      "name": "Fichier binaire",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3520,
        888
      ],
      "parameters": {
        "url": "={{ $json.public_url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "typeVersion": 4.2,
      "id": "Fichier-binaire-22"
    },
    {
      "name": "Fusion3",
      "type": "n8n-nodes-base.merge",
      "position": [
        4416,
        432
      ],
      "parameters": {
        "numberInputs": 3
      },
      "typeVersion": 3.2,
      "id": "Fusion3-23"
    },
    {
      "name": "Obtenir l'URL du post",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3968,
        468
      ],
      "parameters": {
        "url": "={{ `https://graph.facebook.com/${$json.fbApiVersion || 'v19.0'}/${$json.id}?fields=permalink` }}",
        "options": {},
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {}
          ]
        },
        "nodeCredentialType": "facebookGraphApi"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "",
          "name": "YOUR_FACEBOOK_GRAPH_API_CREDENTIAL"
        }
      },
      "typeVersion": 4.2,
      "id": "Obtenir-l-URL-du-post-24"
    },
    {
      "name": "Code2",
      "type": "n8n-nodes-base.code",
      "position": [
        3968,
        888
      ],
      "parameters": {
        "jsCode": "const urn = $json.urn || ''; // example: urn:li:share:7342310895114420224\nconst postId = urn.split(':').pop(); // get the numeric ID\n\nconst linkedinPostUrl = postId \n  ? `https://www.linkedin.com/feed/update/${urn.replace('urn:li:', '').replace(/:/g, '%3A')}/`\n  : '';\n\nreturn {\n  json: {\n    linkedin_post_id: postId,\n    linkedin_post_url: linkedinPostUrl,\n    linkedin_published: !!postId\n  }\n};\n"
      },
      "typeVersion": 2,
      "id": "Code2-25"
    },
    {
      "name": "Code3",
      "type": "n8n-nodes-base.code",
      "position": [
        4640,
        448
      ],
      "parameters": {
        "jsCode": "return [\n  {\n    json: Object.assign({}, ...items.map(item => item.json))\n  }\n];\n"
      },
      "typeVersion": 2,
      "id": "Code3-26"
    },
    {
      "name": "Modifier les champs",
      "type": "n8n-nodes-base.set",
      "position": [
        2272,
        716
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "bb4004a1-9c8b-4603-b8ed-227e50940f87",
              "name": "filename",
              "type": "string",
              "value": "={{$now.toMillis()}}.png"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4,
      "id": "Modifier-les-champs-27"
    },
    {
      "name": "Générer une image1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        2048,
        716
      ],
      "parameters": {
        "model": "gpt-image-1",
        "prompt": "={{ $json.text }}",
        "options": {
          "size": "1024x1024",
          "quality": "high"
        },
        "resource": "image"
      },
      "credentials": {
        "openAiApi": {
          "id": "",
          "name": "YOUR_OPEN_AI_API_CREDENTIAL"
        }
      },
      "typeVersion": 1.8,
      "id": "G-n-rer-une-image1-28"
    },
    {
      "name": "Chaîne LLM basique2",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1696,
        716
      ],
      "parameters": {
        "text": "=Wygeneruj prompt dla Recraft, tak, aby wygenerował profesjonalny obraz na social media (Facebook, Instagram) do tego TEMATU: {{ $json.text }} Pamiętaj, że obraz ma być interesujący, pasujący do bloga technologicznego, na przykład fotorealistyczne fotki ekspertów w biurze, w terenie, zdjęcia konkretnych sprzetow, technologii czy koncepcji opisanych w artykule. Obrazki mają być esetyczne, wywołujące pozytywne uczucia. Tematyka i wygląd obrazka ma ściśle wiązać się z treścią zadanego TEMATU. W Prawym dolnym rogu ma być mały napis SmartCamp.AI. Pamiętaj, że to jest  prompt, który później będzie wklejany do body w api, wiec unikaj elementów, które moga popsuć json (Nie możesz używać cudzysłowów). Wygeneruj sam prompt, bez wstępu, bez cudzysłowów. Cała wiadomość musi mieć mniej niż 1000 znaków.",
        "batching": {},
        "promptType": "define"
      },
      "typeVersion": 1.7,
      "id": "Cha-ne-LLM-basique2-29"
    },
    {
      "name": "Envoyer un message photo",
      "type": "n8n-nodes-base.telegram",
      "position": [
        5088,
        448
      ],
      "webhookId": "90e30a0b-989d-4a48-9779-d83dda1ca336",
      "parameters": {
        "file": "={{ $item(0).$node[\"Supabase Public URL\"].json[\"public_url\"] }}",
        "chatId": "={{ $node[\"Telegram Bot Trigger\"].json.message.chat.id }}",
        "operation": "sendPhoto",
        "additionalFields": {
          "caption": "=Content published!\n\nFacebook Post: {{ $node[\"Code3\"].json.facebook_post_url }}\n\nInstagram Post: {{ $node[\"Code3\"].json.instagram_post_url }}\n\nLinkedIn Post: {{ $node[\"Code3\"].json.linkedin_post_url }}\n"
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "",
          "name": "YOUR_TELEGRAM_API_CREDENTIAL"
        }
      },
      "typeVersion": 1.2,
      "id": "Envoyer-un-message-photo-30"
    },
    {
      "name": "Ajouter ou mettre à jour une ligne dans la feuille",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        672,
        448
      ],
      "parameters": {
        "columns": {
          "value": {
            "Source URL": "={{ $json.url }}"
          },
          "schema": [
            {
              "id": "Source URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Source URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Facebook Content",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Facebook Content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Facebook URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Facebook URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Instagram Content",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Instagram Content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Instagram URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Instagram URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "LinkedIn Content ",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "LinkedIn Content ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "LinkedIn URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "LinkedIn URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Image URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Source URL"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1b7k0A06DY_oI3Ex6fR48FN0PXK6g59U4714wBYUCezw/edit#gid=0",
          "cachedResultName": "Arkusz1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1b7k0A06DY_oI3Ex6fR48FN0PXK6g59U4714wBYUCezw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1b7k0A06DY_oI3Ex6fR48FN0PXK6g59U4714wBYUCezw/edit?usp=drivesdk",
          "cachedResultName": "n8n - Telegram Social Media Content Automation"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": "YOUR_GOOGLE_SHEETS_OAUTH2_API_CREDENTIAL"
        }
      },
      "typeVersion": 4.6,
      "id": "Ajouter-ou-mettre-jour-une-ligne-dans-la-feuille-31"
    },
    {
      "name": "Identifiants",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        768
      ],
      "parameters": {
        "width": 360,
        "height": 172,
        "content": "🔐 Credentials\nThis template uses n8n Credentials.\n- Facebook/Instagram: `facebookGraph`\n- Supabase: `supabase`\n- Google Sheets: OAuth2\n- OpenAI/Gemini: API key\nNo API keys are stored inside the template."
      },
      "typeVersion": 1,
      "id": "Identifiants-32"
    },
    {
      "name": "Entrée",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -132,
        316
      ],
      "parameters": {
        "width": 360,
        "height": 388,
        "content": "🧪 Input assumption\nSend a Telegram message with a single URL. The workflow extracts the URL and processes the article."
      },
      "typeVersion": 1,
      "id": "Entr-e-33"
    },
    {
      "name": "Pipeline d'image",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2240,
        592
      ],
      "parameters": {
        "width": 920,
        "height": 284,
        "content": "🖼️ Image handling\nGenerates an image with OpenAI and uploads it to Supabase Storage.\nSet your bucket name in the Set node or via JSON."
      },
      "typeVersion": 1,
      "id": "Pipeline-d-image-34"
    },
    {
      "name": "Mapping des feuilles",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        604,
        268
      ],
      "parameters": {
        "width": 232,
        "height": 340,
        "content": "📊 Sheet mapping\nUpdate `YOUR_GOOGLE_SHEET_ID` and `Sheet1`.\nColumns will be created automatically on first run."
      },
      "typeVersion": 1,
      "id": "Mapping-des-feuilles-35"
    },
    {
      "name": "Google Gemini",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1768,
        940
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "",
          "name": "YOUR_GOOGLE_PALM_API_CREDENTIAL"
        }
      },
      "typeVersion": 1,
      "id": "Google-Gemini-36"
    },
    {
      "name": "Phase de publication1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4832,
        -48
      ],
      "parameters": {
        "width": 400,
        "height": 652,
        "content": "# Final step \nUpdates Google Sheets with post details and sends a Telegram message with image + direct post links as confirmation."
      },
      "typeVersion": 1,
      "id": "Phase-de-publication1-37"
    },
    {
      "name": "Téléverser sur Supabase (utilise les identifiants)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2720,
        716
      ],
      "parameters": {
        "url": "={{ ($json.supabase_base_url || '').trim().replace(/\\/+$/,'') + '/storage/v1/object/' + ($json.bucket || 'social-media-ai-generated') + '/' + $json.filename }}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "binaryData",
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "content-type",
              "value": "=={{ $binary.data?.mimeType || 'application/octet-stream' }}"
            },
            {
              "name": "x-upsert",
              "value": "true"
            }
          ]
        },
        "inputDataFieldName": "data",
        "nodeCredentialType": "supabaseApi"
      },
      "credentials": {
        "supabaseApi": {
          "id": "",
          "name": "YOUR_SUPABASE_API_CREDENTIAL"
        }
      },
      "typeVersion": 4.2,
      "id": "T-l-verser-sur-Supabase-utilise-les-identifiants--38"
    },
    {
      "name": "Supabase Config",
      "type": "n8n-nodes-base.set",
      "position": [
        2496,
        716
      ],
      "parameters": {
        "options": {
          "stripBinary": false
        },
        "assignments": {
          "assignments": [
            {
              "id": "1dbcf7c4-2e01-4df2-874e-93868b74a519",
              "name": "bucket",
              "type": "string",
              "value": "social-media-ai-generated"
            },
            {
              "id": "4e88d63f-01de-4265-8271-fd0ed637b5fd",
              "name": "filename",
              "type": "string",
              "value": "={{ $json.filename }}"
            },
            {
              "id": "b5579b42-bc9e-44d9-b997-2f1e505c0692",
              "name": "link_ttl_seconds",
              "type": "string",
              "value": "3600"
            },
            {
              "id": "ab260017-3161-4cbf-ad86-84d23a94e780",
              "name": "supabase_base_url",
              "type": "string",
              "value": "https://api.supabase.smartcamp.ai"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4,
      "id": "Supabase-Config-39"
    },
    {
      "name": "Supabase URL publique",
      "type": "n8n-nodes-base.set",
      "position": [
        2960,
        720
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cdc9fb52-3d91-4af4-9ff4-8fb15e6543c4",
              "name": "public_url",
              "type": "string",
              "value": "={{ $node[\"Supabase Config\"].json.supabase_base_url.toString().trim().replace(/\\/+$/,'') + \"/storage/v1/object/public/\" + encodeURIComponent($node[\"Supabase Config\"].json.bucket) + \"/\" + encodeURIComponent($node[\"Supabase Config\"].json.filename) }}"
            }
          ]
        }
      },
      "typeVersion": 3.4,
      "id": "Supabase-URL-publique-40"
    },
    {
      "name": "Phase de publication2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3456,
        -16
      ],
      "parameters": {
        "width": 432,
        "height": 652,
        "content": "# Instagram & Facebook Site IDs\n\nRemember to replace the palceholder with your respective site IDs"
      },
      "typeVersion": 1,
      "id": "Phase-de-publication2-41"
    }
  ],
  "active": false,
  "settings": {
    "timezone": "Europe/Warsaw",
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": "yGK0VwXqcskQjGJG",
    "executionOrder": "v1",
    "timeSavedPerExecution": 20
  },
  "connections": {
    "Code-19": {
      "main": [
        [
          {
            "node": "Fusion3-23",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code1-20": {
      "main": [
        [
          {
            "node": "Fusion3-23",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Code2-25": {
      "main": [
        [
          {
            "node": "Fusion3-23",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Code3-26": {
      "main": [
        [
          {
            "node": "Mise-jour-du-statut-final-8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fusion-14": {
      "main": [
        [
          {
            "node": "Publier-sur-Facebook-6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fusion1-15": {
      "main": [
        [
          {
            "node": "Publier-sur-Instagram-7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fusion2-16": {
      "main": [
        [
          {
            "node": "Fichier-binaire-22",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fusion3-23": {
      "main": [
        [
          {
            "node": "Code3-26",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LinkedIn-21": {
      "main": [
        [
          {
            "node": "Code2-25",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fichier-binaire-22": {
      "main": [
        [
          {
            "node": "LinkedIn-21",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Modifier-les-champs-27": {
      "main": [
        [
          {
            "node": "Supabase-Config-39",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extraire-l-URL-2": {
      "main": [
        [
          {
            "node": "Ajouter-ou-mettre-jour-une-ligne-dans-la-feuille-31",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Obtenir-l-URL-du-post-24": {
      "main": [
        [
          {
            "node": "Code1-20",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Facebook-Post-11": {
      "main": [
        [
          {
            "node": "Fusion-14",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google-Gemini-36": {
      "ai_languageModel": [
        [
          {
            "node": "Cha-ne-LLM-basique2-29",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "LinkedIn-Post-13": {
      "main": [
        [
          {
            "node": "Cha-ne-LLM-basique2-29",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fusion2-16",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Instagram-Post-12": {
      "main": [
        [
          {
            "node": "Fusion1-15",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase-Config-39": {
      "main": [
        [
          {
            "node": "T-l-verser-sur-Supabase-utilise-les-identifiants--38",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cha-ne-LLM-basique2-29": {
      "main": [
        [
          {
            "node": "G-n-rer-une-image1-28",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publier-sur-Facebook-6": {
      "main": [
        [
          {
            "node": "Code-19",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "R-cup-rer-le-contenu-de-l-URL-3": {
      "main": [
        [
          {
            "node": "Extraire-le-contenu-texte-4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publier-sur-Instagram-7": {
      "main": [
        [
          {
            "node": "Publier-sur-Instagram1-10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "G-n-rer-une-image1-28": {
      "main": [
        [
          {
            "node": "Modifier-les-champs-27",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publier-sur-Instagram1-10": {
      "main": [
        [
          {
            "node": "Obtenir-l-URL-du-post-24",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mise-jour-du-statut-final-8": {
      "main": [
        [
          {
            "node": "Envoyer-un-message-photo-30",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase-URL-publique-40": {
      "main": [
        [
          {
            "node": "Fusion2-16",
            "type": "main",
            "index": 1
          },
          {
            "node": "Fusion1-15",
            "type": "main",
            "index": 1
          },
          {
            "node": "Fusion-14",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Extraire-le-contenu-texte-4": {
      "main": [
        [
          {
            "node": "Facebook-Post-11",
            "type": "main",
            "index": 0
          },
          {
            "node": "Instagram-Post-12",
            "type": "main",
            "index": 0
          },
          {
            "node": "LinkedIn-Post-13",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram-Bot-Trigger-0": {
      "main": [
        [
          {
            "node": "Si-le-message-contient-une-URL-17",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Si-le-message-contient-une-URL-17": {
      "main": [
        [
          {
            "node": "Extraire-l-URL-2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram-18",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ajouter-ou-mettre-jour-une-ligne-dans-la-feuille-31": {
      "main": [
        [
          {
            "node": "R-cup-rer-le-contenu-de-l-URL-3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "T-l-verser-sur-Supabase-utilise-les-identifiants--38": {
      "main": [
        [
          {
            "node": "Supabase-URL-publique-40",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Avancé - Création de contenu, IA Multimodale

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Informations sur le workflow
Niveau de difficulté
Avancé
Nombre de nœuds42
Catégorie2
Types de nœuds14
Description de la difficulté

Adapté aux utilisateurs avancés, avec des workflows complexes contenant 16+ nœuds

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34