blog_workflow_template_n8n

Avancé

Ceci est unContent Creation, Multimodal AIworkflow d'automatisation du domainecontenant 23 nœuds.Utilise principalement des nœuds comme If, Code, Wait, Gmail, LinkedIn. Génération automatique d'articles WordPress à partir d'actualités et partage sur LinkedIn avec Claude AI

Prérequis
  • Compte Google et informations d'identification Gmail API
  • Informations d'identification LinkedIn API
  • Peut nécessiter les informations d'identification d'authentification de l'API cible
  • Informations d'identification Google Sheets API
  • Clé API Anthropic
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
{
  "id": "mOYawNKTDlExaveN",
  "meta": {
    "instanceId": "b75f4073dad0f93fa3a88b8a144a6a6bb3ffc5fb4c5b8f758257986fdc74ce77"
  },
  "name": "blog_workflow_template_n8n",
  "tags": [],
  "nodes": [
    {
      "id": "1f2c0ac6-fddc-4335-97ab-2330cffc0889",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        1488,
        1120
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e58ac4d7-b874-482c-8bf7-7ba733f6bd18",
      "name": "Demande d'approbation",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2816,
        944
      ],
      "webhookId": "6b64b6eb-b90d-4cf0-8b91-8743f12d92ee",
      "parameters": {
        "sendTo": "<mail>@gmail.com",
        "message": "={{ $json.output.content }}",
        "options": {},
        "subject": "=Article approval: {{ $json.output.title }}",
        "operation": "sendAndWait",
        "approvalOptions": {
          "values": {
            "approvalType": "double"
          }
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "1dd1ac97-acfd-48eb-aff5-280f3a47fc97",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1488,
        832
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 10,
              "triggerAtMinute": 30
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b46e02aa-6ccf-4198-97b0-d1d480f247ce",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        2688,
        1728
      ],
      "webhookId": "cc8dc6d4-7969-4658-93d9-105ba467ff01",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "c2facf43-a1ff-47a3-ba73-a942a269e11e",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        3120,
        944
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "8eabd36a-87f0-47d6-b240-5b7b5b3ef2bc",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.data.approved }}",
              "rightValue": "true"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "b2a499ee-16fe-454b-9a19-2bb2b152c72b",
      "name": "Basic LLM Chain",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        2320,
        944
      ],
      "parameters": {
        "text": "=[PROMPT GOES HERE]:  {{ $json.userNews }}",
        "batching": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "3acad4e1-76ad-4887-883d-1406f6c8f730",
      "name": "Anthropic Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        2320,
        1136
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-20250514",
          "cachedResultName": "Claude 4 Sonnet"
        },
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "57695364-25ea-47f1-a809-5f6a55f8718d",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2464,
        1136
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"title\": \"Title of the article\",\n\t\"content\": \"content of the article\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "fd83b42b-ba7e-421a-8acb-f97bef2bbda5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2656,
        1344
      ],
      "parameters": {
        "color": 5,
        "width": 400,
        "height": 528,
        "content": "## LOGGING\nRunning parallel to the approval process, this step keeps a record of all AI-generated content.\n\nWait: A Wait node ensures a brief pause.\n\nLog to Google Sheets: An Append row in sheet node takes the output from the AI (the Basic LLM Chain) and logs it, along with metadata, into a specified Google Sheet. This happens regardless of whether the article is approved or declined, creating a comprehensive log of all generated content."
      },
      "typeVersion": 1
    },
    {
      "id": "aa7aa325-eb00-4d25-bfc7-c23bc2e6c5ed",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1840,
        448
      ],
      "parameters": {
        "color": 5,
        "width": 784,
        "height": 848,
        "content": "## CONTENT GENERATION\n\nFetch News: An HTTP Request node connects to the API service you prefer to pull in the latest news articles.\n\nFormat Data: A Code node takes the raw news data and formats it into a clean text string that the AI can easily understand.\n\nDraft Article with AI: A Basic LLM Chain node orchestrates the content creation.\n\nPrompt: It uses a detailed prompt that instructs the AI to handle the information as requested.\n\nAI Model: It uses an Anthropic Chat Model node configured to use a specific model (claude-sonnet-4...).\n\nStructured Output: It uses a Structured Output Parser to ensure the AI's response is neatly formatted into a JSON object with a title and content."
      },
      "typeVersion": 1
    },
    {
      "id": "ced1b5ad-caa0-4010-9028-8680ac8da858",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2656,
        448
      ],
      "parameters": {
        "color": 5,
        "width": 400,
        "height": 848,
        "content": "## HUMAN TOUCH\n\nSend for Approval: An Approval request node sends an email via Gmail containing the AI-generated title and content. This email includes \"Approve\" and \"Decline\" buttons, and the workflow pauses until one is clicked."
      },
      "typeVersion": 1
    },
    {
      "id": "672dc96a-dd9e-4697-bc34-26e0c78c3c8f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3088,
        448
      ],
      "parameters": {
        "color": 4,
        "width": 1344,
        "height": 848,
        "content": "## PUBLISHING CONTENT\n\n**If APPROVED**:\n\nSelect Image: A Code node named getImageId randomly picks an ID for a featured image from a predefined list.\n\nPublish to WordPress: An HTTP Request node sends the title, content, and selected featured image ID to your WordPress site via its API, creating a new blog post.\n\nGet Image for Sharing: Another HTTP Request node fetches the URL of the newly published post's thumbnail image.\n\nShare on LinkedIn: A LinkedIn node creates a new post on a specified organization page, sharing the article's title and its URL.\n\nSend Confirmation: A Gmail node sends a final notification email confirming that the article has been successfully published, including its short URL.\n\n**If DECLINED**:\n\nSend Notification: A separate Gmail node sends an email notifying the user that the article draft was declined."
      },
      "typeVersion": 1
    },
    {
      "id": "0bc9d9a3-5ebd-437a-8bbb-7a68b5a9780e",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1328,
        448
      ],
      "parameters": {
        "color": 7,
        "width": 480,
        "height": 848,
        "content": "## TRIGGER\n\nThe workflow can be initiated in two ways:\n\nOn a Schedule: A Schedule Trigger node is set to run automatically.\n\nManually: A Manual Trigger node allows you to start the workflow at any time by clicking \"Execute workflow.\""
      },
      "typeVersion": 1
    },
    {
      "id": "364d480e-9601-4568-b3cc-6e2450a17503",
      "name": "Message de succès",
      "type": "n8n-nodes-base.gmail",
      "position": [
        4160,
        944
      ],
      "webhookId": "1198e092-a011-440b-a9b8-85967added38",
      "parameters": {
        "sendTo": "<mail>@gmail.com",
        "message": "=Articolo pubblicato:  {{ $('Push article to WordPress').item.json.short_URL }}",
        "options": {},
        "subject": "WordPress Article"
      },
      "typeVersion": 2.1
    },
    {
      "id": "c1bbbbb4-2a3c-46b1-89f6-4a8a0c046691",
      "name": "Message d'échec",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3312,
        1136
      ],
      "webhookId": "0cde3d27-12e3-4470-b258-e42f595c29fd",
      "parameters": {
        "sendTo": "<mail>@gmail.com",
        "message": "=You declined the article:  {{ $('HTTP Request to Claude 2 - Title Creation').item.json.content[0].text }}",
        "options": {},
        "subject": "Article DECLINED"
      },
      "typeVersion": 2.1
    },
    {
      "id": "67ec150b-3bfd-4567-8f85-04c6e979021b",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        304
      ],
      "parameters": {
        "width": 1296,
        "height": 1536,
        "content": "## AI-Powered Blog Automation\n\n### What this workflow does\nThis workflow automates your entire content pipeline. It fetches the latest news from a source of your choice, uses an AI to draft a complete blog post, sends it to you for approval, and then automatically publishes the approved article to WordPress and shares it on LinkedIn. It also keeps a log of every article generated in a Google Sheet.\n\n\n---\n\n### Setup Instructions\n\n**1. Credentials**\nYou'll need to add credentials for the following services in your n8n instance:\n* **News API**: A Header Auth credential for your chosen news provider (e.g., [CurrentsAPI](https://currentsapi.services/)).\n* **Anthropic API**: Your API key for the Claude model. Get one at [Anthropic](https://www.anthropic.com/).\n* **Google OAuth**: For both Gmail and Google Sheets.\n* **WordPress OAuth2**: To publish articles via the API. See the [WordPress Developer Docs](https://developer.wordpress.com/docs/api/).\n* **LinkedIn OAuth2**: To share the post on a company page.\n\n**2. Node Configuration**\nYou must configure these specific nodes:\n* **Fetch News (HTTP Request)**: Set the query parameters (keywords, language, etc.) for your news source.\n* **Basic LLM Chain**: Review and **customize the prompt** to match your desired tone, language, and style.\n* **Approval request (Gmail)**: Set your email address in the `Send To` field.\n* **HTTP Request WP - Push article**: Replace `<site_Id>` in the URL with your WordPress Site ID.\n* **getImageId (Code Node)**: Update the array with your image IDs from the WordPress Media Library.\n* **Create a post (LinkedIn)**: Enter your LinkedIn `Organization ID`.\n* **Append row in sheet (Google Sheets)**: Select your Google Sheet file and the target sheet.\n* **All Email Nodes**: Make sure the `Send To` field is your email.\n\n## Demo\n\n@[youtube](AfcYxTdSr9g)"
      },
      "typeVersion": 1
    },
    {
      "id": "a3cc5fa3-a50b-43ea-a708-851639c4e31d",
      "name": "Récupération de l'actualité",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1904,
        944
      ],
      "parameters": {
        "url": "https://api.currentsapi.services/v1/search",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {}
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "b9Fm0LGH82gzzSGa",
          "name": "Header Auth - CurrentsApi"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "waitBetweenTries": 3000
    },
    {
      "id": "125d4d6c-dc06-4788-bf6f-d3a8d7edcdd9",
      "name": "JSON Parsing",
      "type": "n8n-nodes-base.code",
      "position": [
        2112,
        944
      ],
      "parameters": {
        "jsCode": "const userString = JSON.stringify($input.first().json.news);\n\n// The CORRECT way to return data in a Code Node\nreturn [\n  {\n    json: {\n      userNews: userString\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "b3e4c350-57ed-4627-bfec-02041f2c17b6",
      "name": "Ajouter un log à la feuille",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2864,
        1728
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "id",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "type",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "role",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "role",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "model",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "model",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "stop_reason",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "stop_reason",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "stop_sequence",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "stop_sequence",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "usage",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "usage",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1dowCNqxxlNt8LUJmqn5jEFQVCVcsECC3OuPMUwHlI44/edit#gid=0",
          "cachedResultName": "Foglio1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1dowCNqxxlNt8LUJmqn5jEFQVCVcsECC3OuPMUwHlI44",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1dowCNqxxlNt8LUJmqn5jEFQVCVcsECC3OuPMUwHlI44/edit?usp=drivesdk",
          "cachedResultName": "log_blog"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "clGpH9YgPxlD7PM0",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "71f6624e-dc6a-42ea-99ae-ec80c2b8221e",
      "name": "Choisir une image dans le tableau",
      "type": "n8n-nodes-base.code",
      "position": [
        3280,
        944
      ],
      "parameters": {
        "jsCode": "function getRandomItem(arr) {\n  // Calculate a random index and return the item at that index\n  return arr[Math.floor(Math.random() * arr.length)];\n}\n\nconst myChoices = [\"131\", \"130\", \"129\", \"70\"];\n\n// Call the function and store the returned value in a variable\nconst selected = getRandomItem(myChoices);\n\n// Return as an array of items, each with a { json } property\nreturn [\n  { json: { choice: selected } }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "040fa548-d626-4da1-a6ed-cb2a50b2165f",
      "name": "Publier l'article sur WordPress",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3456,
        944
      ],
      "parameters": {
        "url": "https://public-api.wordpress.com/rest/v1.1/sites/<site_Id>/posts/new",
        "method": "POST",
        "options": {
          "response": {
            "response": {}
          }
        },
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "title",
              "value": "={{ $('Basic LLM Chain').item.json.output.title }}"
            },
            {
              "name": "content",
              "value": "={{ $('Basic LLM Chain').item.json.output.content }}"
            },
            {
              "name": "featured_image",
              "value": "={{ $json.choice }}"
            }
          ]
        },
        "genericAuthType": "oAuth2Api"
      },
      "credentials": {
        "oAuth2Api": {
          "id": "Z1r5LAKxOTyzadio",
          "name": "WordPress.com - auth"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.2
    },
    {
      "id": "4a69a961-9d51-4e87-b95c-77707c4b8fed",
      "name": "GET Image pour Linkedin",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3664,
        944
      ],
      "parameters": {
        "url": "={{ $json.post_thumbnail.URL }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "159306a0-662f-4bb3-9de8-d2b58f39c8fa",
      "name": "Publier sur la page Linkedin",
      "type": "n8n-nodes-base.linkedIn",
      "position": [
        3888,
        944
      ],
      "parameters": {
        "text": "={{ $json.title }}",
        "postAs": "organization",
        "organization": "111111111",
        "additionalFields": {
          "originalUrl": "={{ $json.URL }}",
          "thumbnailBinaryPropertyName": "data"
        },
        "shareMediaCategory": "ARTICLE"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d1aac863-8bc5-42e1-8503-426b47ed32a4",
  "connections": {
    "c2facf43-a1ff-47a3-ba73-a942a269e11e": {
      "main": [
        [
          {
            "node": "71f6624e-dc6a-42ea-99ae-ec80c2b8221e",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "c1bbbbb4-2a3c-46b1-89f6-4a8a0c046691",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b46e02aa-6ccf-4198-97b0-d1d480f247ce": {
      "main": [
        [
          {
            "node": "b3e4c350-57ed-4627-bfec-02041f2c17b6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "125d4d6c-dc06-4788-bf6f-d3a8d7edcdd9": {
      "main": [
        [
          {
            "node": "b2a499ee-16fe-454b-9a19-2bb2b152c72b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a3cc5fa3-a50b-43ea-a708-851639c4e31d": {
      "main": [
        [
          {
            "node": "125d4d6c-dc06-4788-bf6f-d3a8d7edcdd9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b2a499ee-16fe-454b-9a19-2bb2b152c72b": {
      "main": [
        [
          {
            "node": "e58ac4d7-b874-482c-8bf7-7ba733f6bd18",
            "type": "main",
            "index": 0
          },
          {
            "node": "b46e02aa-6ccf-4198-97b0-d1d480f247ce",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e58ac4d7-b874-482c-8bf7-7ba733f6bd18": {
      "main": [
        [
          {
            "node": "c2facf43-a1ff-47a3-ba73-a942a269e11e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1dd1ac97-acfd-48eb-aff5-280f3a47fc97": {
      "main": [
        [
          {
            "node": "a3cc5fa3-a50b-43ea-a708-851639c4e31d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3acad4e1-76ad-4887-883d-1406f6c8f730": {
      "ai_languageModel": [
        [
          {
            "node": "b2a499ee-16fe-454b-9a19-2bb2b152c72b",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "159306a0-662f-4bb3-9de8-d2b58f39c8fa": {
      "main": [
        [
          {
            "node": "364d480e-9601-4568-b3cc-6e2450a17503",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4a69a961-9d51-4e87-b95c-77707c4b8fed": {
      "main": [
        [
          {
            "node": "159306a0-662f-4bb3-9de8-d2b58f39c8fa",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "71f6624e-dc6a-42ea-99ae-ec80c2b8221e": {
      "main": [
        [
          {
            "node": "040fa548-d626-4da1-a6ed-cb2a50b2165f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "57695364-25ea-47f1-a809-5f6a55f8718d": {
      "ai_outputParser": [
        [
          {
            "node": "b2a499ee-16fe-454b-9a19-2bb2b152c72b",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "040fa548-d626-4da1-a6ed-cb2a50b2165f": {
      "main": [
        [
          {
            "node": "4a69a961-9d51-4e87-b95c-77707c4b8fed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1f2c0ac6-fddc-4335-97ab-2330cffc0889": {
      "main": [
        [
          {
            "node": "a3cc5fa3-a50b-43ea-a708-851639c4e31d",
            "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œuds23
Catégorie2
Types de nœuds13
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