AutomationFlowsAI & RAG › Automate News Discovery & Publishing with Gpt-4, Google Search API & Slack

Automate News Discovery & Publishing with Gpt-4, Google Search API & Slack

ByKalyxi Ai @kalyxi on n8n.io

Automated content publishing system that discovers industry news, transforms it into original articles using GPT-4, and publishes across multiple channels with SEO optimization and intelligent duplicate prevention. 🤖 Smart Query Generation - AI agent generates unique search…

Cron / scheduled trigger★★★★☆ complexityAI-powered14 nodesHTTP RequestOpenAISlackGoogle SheetsAgentGoogle Sheets ToolOpenAI Chat
AI & RAG Trigger: Cron / scheduled Nodes: 14 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #8360 — we link there as the canonical source.

This workflow follows the Agent → Google Sheets 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": "15fe5e33-4d9f-4bc9-9e72-ac1af36c3fe8",
      "name": "\ud83d\udccb Setup Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        96
      ],
      "parameters": {
        "color": 7,
        "width": 390.1693164217126,
        "height": 464.5206143079691,
        "content": "## \ud83d\udcca Google Sheets Setup Instructions\n\n### 1. Create a Google Sheet:\n- Create a new Google Sheet\n- Name it \"n8n Blog Tracker\"\n- Rename the first sheet to \"ProcessedWorkflows\"\n\n### 2. Add Headers (Row 1):\n- A1: workflow_id\n- B1: title\n- C1: slug\n- D1: query\n- E1: published_at\n- F1: seo_score\n- G1: word_count\n- H1: featured\n- I1: status\n\n### 3. Get Sheet ID:\n- Open your Google Sheet\n- Copy the ID from the URL:\n  `https://docs.google.com/spreadsheets/d/[THIS_IS_YOUR_SHEET_ID]/edit`\n\n### 4. Update Both Google Sheets Nodes:\n- Replace \"YOUR_GOOGLE_SHEET_ID\" in both:\n  - \"Get Processed Workflows\" node\n  - \"Log to Google Sheets\" node\n\n### 5. Connect Google Account:\n- Click on either Google Sheets node\n- Add Google Sheets credentials\n- Authenticate with your Google account"
      },
      "typeVersion": 1
    },
    {
      "id": "b3073aba-2403-4ec3-9f30-0aa1fa864c5b",
      "name": "Prepare Publishing Data1",
      "type": "n8n-nodes-base.code",
      "position": [
        2448,
        704
      ],
      "parameters": {
        "jsCode": "const response = $input.item.json;\nlet articleData;\n\ntry {\n  let content = response.message?.content || '';\n  \n  // Clean up JSON extraction\n  if (content.includes('```json')) {\n    const start = content.indexOf('```json') + 7;\n    const end = content.lastIndexOf('```');\n    content = content.substring(start, end).trim();\n  }\n  \n  // Handle incomplete JSON\n  if (!content.trim().endsWith('}')) {\n    const lastQuote = content.lastIndexOf('\"');\n    if (lastQuote > 0) {\n      content = content.substring(0, lastQuote + 1) + '}';\n    }\n  }\n  \n  articleData = JSON.parse(content);\n  \n} catch (e) {\n  console.log('JSON parse failed:', e.message);\n  \n  // Fallback extraction\n  const raw = response.message?.content || '';\n  articleData = {\n    title: (raw.match(/\"title\"\\s*:\\s*\"([^\"]*)\"/)?.[1]) || \"Industry Update\",\n    metaDescription: (raw.match(/\"metaDescription\"\\s*:\\s*\"([^\"]*)\"/)?.[1]) || \"Latest industry news\",\n    content: (raw.match(/\"content\"\\s*:\\s*\"([^\"]*)\"/s)?.[1]) || \"Content extraction failed\",\n    focusKeyphrase: \"ai automation\",\n    readingTime: 8,\n    seoScore: 90,\n    wordCount: 2500\n  };\n}\n\n// MINIMAL formatting since GPT should output correctly\nlet formattedContent = (articleData.content || \"\")\n  // Fix escaped characters\n  .replace(/\\\\\"/g, '\"')\n  .replace(/\\\\n\\\\n/g, '\\n\\n')\n  .replace(/\\\\n/g, '\\n')\n  \n  // Just clean up any remaining spacing issues\n  .replace(/\\n{3,}/g, '\\n\\n')\n  .replace(/^\\n+|\\n+$/g, '')\n  .trim();\n\n// Calculate actual word count\nconst wordCount = formattedContent.split(/\\s+/).filter(word => word.length > 0).length;\n\nreturn [{\n  article: {\n    title: articleData.title,\n    metaDescription: articleData.metaDescription,\n    content: formattedContent,\n    focusKeyphrase: articleData.focusKeyphrase || \"ai automation\",\n    readingTime: Math.ceil(wordCount / 250) || 8,\n    seoScore: articleData.seoScore || 90,\n    wordCount: wordCount\n  },\n  publishing: {\n    slug: (articleData.title || \"article\")\n      .toLowerCase()\n      .replace(/[^a-z0-9]+/g, '-')\n      .replace(/^-+|-+$/g, '')\n      .substring(0, 60),\n    featured: true,\n    publishedAt: new Date().toISOString()\n  },\n  seo: {\n    keyword: articleData.focusKeyphrase || \"ai automation\",\n    intent: \"informational\",\n    difficulty: 5,\n    volume: \"5000/mo\",\n    contentAngle: \"industry analysis\"\n  },\n  metadata: {\n    category: \"AI & Technology\",\n    originalUrl: \"\",\n    originalSource: \"Generated\",\n    sources: [],\n    tags: [\"ai\", \"enterprise\", \"automation\", \"technology\"]\n  },\n  image: {\n    url: \"https://source.unsplash.com/1200x630/?technology,artificial-intelligence\",\n    alt: articleData.title || \"Technology\"\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "25c9e154-5434-47b0-a274-e498767d6e90",
      "name": "Publish to CMS1",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        2672,
        704
      ],
      "parameters": {
        "url": "webhook_url",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n \"title\": {{ JSON.stringify($json.article.title) }},\n \"slug\": {{ JSON.stringify($json.publishing.slug) }},\n \"meta_description\": {{ JSON.stringify($json.article.metaDescription) }},\n \"body_markdown\": {{ JSON.stringify($json.article.content) }},\n \"focus_keyphrase\": {{ JSON.stringify($json.article.focusKeyphrase) }},\n \"reading_time\": {{ JSON.stringify(String($json.article.readingTime)) }},\n \"seo_score\": {{ JSON.stringify(String($json.article.seoScore)) }},\n \"word_count\": {{ JSON.stringify(String($json.article.wordCount)) }},\n \"keyword\": {{ JSON.stringify($json.seo.keyword) }},\n \"intent\": {{ JSON.stringify($json.seo.intent) }},\n \"difficulty\": {{ JSON.stringify(String($json.seo.difficulty)) }},\n \"volume\": {{ JSON.stringify($json.seo.volume) }},\n \"content_angle\": {{ JSON.stringify($json.seo.contentAngle) }},\n \"category\": {{ JSON.stringify($json.metadata.category) }},\n \"featured\": {{ $json.publishing.featured }},\n \"author\": \"Lexi\",\n \"publish_date\": {{ JSON.stringify($json.publishing.publishedAt) }},\n \"sources\": {{ JSON.stringify($json.metadata.sources) }},\n \"original_url\": {{ JSON.stringify($json.metadata.originalUrl) }},\n \"news_type\": {{ JSON.stringify($json.seo.intent) }},\n \"tags\": {{ JSON.stringify($json.metadata.tags) }},\n \"image_url\": {{ JSON.stringify($json.image.url) }},\n \"image_caption\": {{ JSON.stringify($json.image.alt) }},\n \"image_credit\": \"Unsplash\",\n \"cta_label\": \"Subscribe for Updates\",\n \"cta_url\": \"https://kalyxi.ai/#contact\"\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "d52e2366-3a77-47d6-91cc-334ead72f289",
      "name": "Daily Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        848,
        704
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 7
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "92c9457e-5dd2-4177-9ea0-29156543be78",
      "name": "Search Recent Articles",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        1424,
        704
      ],
      "parameters": {
        "url": "https://www.googleapis.com/customsearch/v1",
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        },
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "key",
              "value": "google_api_key"
            },
            {
              "name": "cx",
              "value": "custom_search_id"
            },
            {
              "name": "q",
              "value": "={{ $json.output }}"
            },
            {
              "name": "dateRestrict",
              "value": "d7"
            },
            {
              "name": "num",
              "value": "5"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c223a640-db05-4b7d-a4f2-b2344d9693b4",
      "name": "Extract Best Article",
      "type": "n8n-nodes-base.code",
      "position": [
        1648,
        704
      ],
      "parameters": {
        "jsCode": "// Parse search results and extract the best article\nconst searchResults = $input.item.json;\nlet articles = [];\n\n// Handle Google Custom Search API response\nif (searchResults.items && Array.isArray(searchResults.items)) {\n searchResults.items.forEach(item => {\n   const urlParts = item.link.match(/^https?:\\/\\/([^\\/]+)/);\n   const hostname = urlParts ? urlParts[1] : 'unknown';\n   \n   articles.push({\n     title: item.title,\n     url: item.link,\n     snippet: item.snippet,\n     source: hostname,\n     publishDate: new Date().toISOString()\n   });\n });\n}\n\n// Return all articles found\nreturn articles;"
      },
      "typeVersion": 2
    },
    {
      "id": "3eef26f8-8ed4-4dcb-aa4f-256880e19127",
      "name": "Generate Original Article",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "onError": "continueRegularOutput",
      "position": [
        2096,
        704
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4-turbo-preview"
        },
        "options": {
          "maxTokens": 4096,
          "temperature": 0.7
        },
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are an expert content strategist specializing in AI and enterprise automation. Your task is to create a comprehensive, original article based on current industry trends and insights. You must:\n\n1. Write completely original content - never copy or closely paraphrase\n2. Add significant new analysis, insights, and perspectives\n3. Include real-world examples and implementation strategies\n4. Cite sources properly using [1], [2], etc. format\n5. Create SEO-optimized content with natural keyword usage\n6. Focus on practical, actionable insights for enterprise leaders\n7. Maintain a professional, authoritative tone\n8. Structure content with clear sections and subheadings\n9. minimum : 5000 words"
            },
            {
              "content": "=Create a comprehensive news article based on this source material:\n\nTopic:  {{ $json.content }}\nOriginal Title: {{ $json.title }}\nSource: {{ $json.source }}\nContent Preview: {{ $json.content ? $json.content.substring(0, 2000) : $json.snippet }}\nSnippet: {{ $json.snippet }}\n\nWrite a NEWS ARTICLE in the style of Reuters, Bloomberg, or The Wall Street Journal that:\n\nJOURNALISTIC REQUIREMENTS:\n- Lead with the most newsworthy angle in the first paragraph\n- Use inverted pyramid structure (most important info first)\n- Include specific data points, percentages, and dollar amounts\n- Quote industry experts and executives (create realistic quotes)\n- Maintain objective, third-person reporting tone\n- Use present tense for current developments, past tense for context\n- Include company names, market positions, and competitive landscape\n- Add geographical and temporal context\n\nARTICLE STRUCTURE:\n1. HEADLINE: Punchy, specific, newsworthy (60 chars max)\n2. LEDE: Answer who, what, when, where, why in 2-3 sentences\n3. KEY DEVELOPMENTS: 3-4 paragraphs on the main news\n4. MARKET CONTEXT: Industry trends, competitor moves, market size\n5. EXPERT ANALYSIS: 2-3 quoted perspectives from analysts/executives\n6. IMPLICATIONS: What this means for businesses/investors\n7. BACKGROUND: Relevant history and previous developments\n8. OUTLOOK: Future projections and upcoming catalysts\n\nCRITICAL FORMATTING REQUIREMENTS:\n- Use ## for ALL section headers\n- Separate ALL paragraphs with double line breaks (\\n\\n)\n- Never merge text with headers (e.g., NOT \"## Key DevelopmentsThe company...\")\n- Always use: \"## Header\\n\\nParagraph text here\\n\\nNext paragraph\"\n- Include proper quote spacing: \"Quote text,\" said Name, Title.\n\nSTYLE GUIDELINES:\n- Short paragraphs (2-3 sentences max)\n- Active voice\n- Specific rather than general claims\n- Numbers and data in context\n- Avoid jargon without explanation\n- Include source attribution {{ $json.source }}\n\nFormat as VALID JSON:\n{\n  \"title\": \"News headline with specific claim or metric\",\n  \"metaDescription\": \"SEO description with key facts (150-160 chars)\",\n  \"content\": \"## Introduction\\n\\n[Opening paragraph with newsworthy lead]\\n\\n[Context paragraph]\\n\\n## Key Developments\\n\\n[Main developments paragraph]\\n\\n[Quote paragraph with attribution]\\n\\n## Market Context\\n\\n[Industry analysis paragraph]\\n\\n[Competitive landscape paragraph]\\n\\n## Expert Analysis\\n\\n[Expert opinion paragraph]\\n\\n[Additional analysis paragraph]\\n\\n## Implications\\n\\n[Business impact paragraph]\\n\\n## Background\\n\\n[Historical context paragraph]\\n\\n## Outlook\\n\\n[Future projections paragraph]\",\n  \"focusKeyphrase\": \"primary news keyword\",\n  \"sources\": [\"{{ $json.source }}\", \"Additional context sources\"],\n  \"takeaways\": [\"Key fact 1\", \"Key fact 2\", \"Key fact 3\"],\n  \"readingTime\": 8,\n  \"seoScore\": 95,\n  \"wordCount\": 2500\n}\n\nIMPORTANT: \n- Use \\n\\n between ALL paragraphs in the content field\n- Never write \"## Key DevelopmentsThe company\" - always use proper spacing\n- Each section must be clearly separated with headers\n- Content should be 2000-3000 words for comprehensive coverage\n- Include at least 3 realistic quotes from different sources\n- Add specific metrics, percentages, and dollar amounts throughout"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "002c5b6f-35c5-4466-b49f-5a7cb6785eb0",
      "name": "Send Slack Notification",
      "type": "n8n-nodes-base.slack",
      "onError": "continueRegularOutput",
      "position": [
        3120,
        704
      ],
      "parameters": {
        "text": "=*AI-Powered News Content Automation Pipeline*\n\n\u2705 *New AI Article Published!*\n\n\ud83d\udcdd *Title:* {{ $('Publish to CMS1').item.json.article.title }} \n\ud83d\udcca *Metrics:*\\n\u2022 \nSEO Score: {{ $('Publish to CMS1').item.json.article.seo_score }}/100 \nWord Count: {{ $('Publish to CMS1').item.json.article.word_count }}  \n \n\ud83c\udfaf *SEO Details:*\nFocus Keyword: {{ $('Prepare Publishing Data1').item.json.seo.keyword }}\\\nSearch Volume: {{ $('Prepare Publishing Data1').item.json.seo.volume }}\\\nDifficulty: {{ $('Prepare Publishing Data1').item.json.seo.difficulty }}/10\n\ud83d\udd17 *Meta:* {{ $('Prepare Publishing Data1').item.json.article.metaDescription }}\n \n\ud83d\udc49 *View Article:* {{ $('Publish to CMS1').item.json.article.url }} ",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C09CDD3UM3R",
          "cachedResultName": "seo-manager"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "85a3b60c-a105-48e1-a779-f08273de977f",
      "name": "Log to Google Sheets2",
      "type": "n8n-nodes-base.googleSheets",
      "onError": "continueRegularOutput",
      "position": [
        2896,
        704
      ],
      "parameters": {
        "columns": {
          "value": {
            "slug": "={{ $json.article.slug }}",
            "query": "={{ $('Prepare Publishing Data1').item.json.article.focusKeyphrase }}",
            "title": "={{ $json.article.title }}",
            "status": "={{ $json.message }}",
            "featured": "={{ $('Prepare Publishing Data1').item.json.image.url }}",
            "seo_score": "={{ $json.article.seo_score }}",
            "word_count": "={{ $json.article.word_count }}",
            "workflow_id": "={{ $json.article.id }}",
            "published_at": "={{ $json.article.published_date }}"
          },
          "schema": [
            {
              "id": "workflow_id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "workflow_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "slug",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "slug",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "query",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "query",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "published_at",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "published_at",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "seo_score",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "seo_score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "word_count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "word_count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "featured",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "featured",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "status",
              "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/1xS3rd0wSAub5qS9RT7PQhbkoVuxFeKbyNeT9QweC1gw/edit#gid=0",
          "cachedResultName": "ProcessedWorkflows"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1xS3rd0wSAub5qS9RT7PQhbkoVuxFeKbyNeT9QweC1gw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xS3rd0wSAub5qS9RT7PQhbkoVuxFeKbyNeT9QweC1gw/edit?usp=drivesdk",
          "cachedResultName": "n8n Blog Tracker"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "e8d27e02-ea01-470b-8c5d-efc083cdf0ef",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1072,
        704
      ],
      "parameters": {
        "text": "```\nCheck the Google Sheets processed articles list. Generate ONE unique search query for our AI/automation niche that hasn't been covered yet.\n\nOutput only the search phrase. Nothing else.\n\nExample output:\nedge computing ai manufacturing\n\nRequirements:\n- 3-5 words maximum\n- Must be different from previous searches\n- Stay within AI/enterprise/automation topics\n- No explanations, just the query\n```",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "c3eda3f1-b438-4e85-bf7c-12c6cfad733a",
      "name": "Get row(s) in sheet in Google Sheets",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1216,
        928
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('values0_Value', ``, 'string') }}",
              "lookupColumn": "query"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xS3rd0wSAub5qS9RT7PQhbkoVuxFeKbyNeT9QweC1gw/edit#gid=0",
          "cachedResultName": "ProcessedWorkflows"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1xS3rd0wSAub5qS9RT7PQhbkoVuxFeKbyNeT9QweC1gw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xS3rd0wSAub5qS9RT7PQhbkoVuxFeKbyNeT9QweC1gw/edit?usp=drivesdk",
          "cachedResultName": "n8n Blog Tracker"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "94b5558e-2855-4ce0-8071-0b87f21077da",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1088,
        928
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4-turbo-preview",
          "cachedResultName": "gpt-4-turbo-preview"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "48895c3d-a820-477f-b16f-52ebd9d44241",
      "name": "\ud83d\ude80 Setup Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        96
      ],
      "parameters": {
        "color": 4,
        "width": 420,
        "height": 868,
        "content": "## \ud83e\udd16 AI News Content Pipeline Setup\n\n### Required APIs & Credentials:\n- **OpenAI API Key** (GPT-4 access required)\n- **Google Custom Search API** + Search Engine ID\n- **Google Sheets OAuth2** (for tracking)\n- **Slack OAuth2** (for notifications)\n- **Custom CMS Endpoint** (for publishing)\n\n### Setup Steps:\n1. **Configure Search Engine:**\n   - Update Google Custom Search API key\n   - Set your custom search engine ID\n\n2. **Update CMS Endpoint:**\n   - Replace CMS URL in \"Publish to CMS\" node\n   - Adjust JSON mapping for your CMS structure\n\n3. **Google Sheets Setup:**\n   - Create sheet with headers: workflow_id, title, slug, query, published_at, seo_score, word_count, featured, status\n   - Update sheet ID in both Google Sheets nodes\n\n4. **Schedule Configuration:**\n   - Current: Every 8 hours\n   - Adjust in \"Daily Schedule Trigger\" node\n\n### Key Features:\n- Intelligent duplicate prevention\n- SEO-optimized content generation\n- Professional news article formatting\n- Multi-channel publishing pipeline"
      },
      "typeVersion": 1
    },
    {
      "id": "8bf87601-073b-4bee-82c7-a861b2d0e511",
      "name": "Skip problems",
      "type": "n8n-nodes-base.code",
      "position": [
        1872,
        704
      ],
      "parameters": {
        "jsCode": "const articles = $input.all();\nconst filteredArticles = [];\n\nfor (const article of articles) {\n  const url = article.json.url || '';\n  \n  // Skip domains known to have strong anti-bot protection\n  const blockedDomains = [\n    'aibusiness.com',\n    'forbes.com', \n    'wsj.com',\n    'ft.com'\n  ];\n  \n  const isBlocked = blockedDomains.some(domain => url.includes(domain));\n  \n  if (!isBlocked) {\n    filteredArticles.push(article.json);\n  }\n}\n\n// If all articles are blocked, use the first one with just the snippet\nif (filteredArticles.length === 0 && articles.length > 0) {\n  const fallback = articles[0].json;\n  fallback.content = fallback.snippet;\n  filteredArticles.push(fallback);\n}\n\nreturn filteredArticles;"
      },
      "typeVersion": 2
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Search Recent Articles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Skip problems": {
      "main": [
        [
          {
            "node": "Generate Original Article",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publish to CMS1": {
      "main": [
        [
          {
            "node": "Log to Google Sheets2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Extract Best Article": {
      "main": [
        [
          {
            "node": "Skip problems",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log to Google Sheets2": {
      "main": [
        [
          {
            "node": "Send Slack Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Schedule Trigger": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Recent Articles": {
      "main": [
        [
          {
            "node": "Extract Best Article",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Publishing Data1": {
      "main": [
        [
          {
            "node": "Publish to CMS1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Original Article": {
      "main": [
        [
          {
            "node": "Prepare Publishing Data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet in Google Sheets": {
      "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

Automated content publishing system that discovers industry news, transforms it into original articles using GPT-4, and publishes across multiple channels with SEO optimization and intelligent duplicate prevention. 🤖 Smart Query Generation - AI agent generates unique search…

Source: https://n8n.io/workflows/8360/ — 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

Marketing, content, and enablement teams that need a quick, human-readable summary of every new video published by the YouTube channels they care about—without leaving Slack.

HTTP Request, Google Sheets, XML +7
AI & RAG

Template Name: AI Personal Assistant - Task & Email Management Price: $27 Category: Productivity & Automation Difficulty: Intermediate Use Case: Personal productivity automation for busy professionals

Telegram, HTTP Request, OpenAI +8
AI & RAG

This workflow automates end-to-end ESG (Environmental, Social, and Governance) sustainability reporting for enterprise sustainability teams, compliance officers, and green governance leads. It solves

Agent, OpenAI Chat, Output Parser Structured +12
AI & RAG

Tracking what people say about your brand on Twitter can be overwhelming, especially when important mentions slip through the cracks. This workflow automates the process: it scrapes Twitter mentions,

OpenAI, Output Parser Structured, Google Sheets +4
AI & RAG

This n8n workflow orchestrates a powerful suite of AI Agents and automations to manage and optimize various aspects of an e-commerce operation, particularly for platforms like Shopify. It leverages La

Google Sheets, HTTP Request, Slack +10