Extraer artículos por palabras clave

Avanzado

Este es unContent Creation, Miscellaneous, Multimodal AIflujo de automatización del dominio deautomatización que contiene 16 nodos.Utiliza principalmente nodos como Code, GoogleDrive, HttpRequest, SplitInBatches, Agent. Usar Mistral AI y Google Drive para generar artículos de blogs de SEO desde búsquedas web

Requisitos previos
  • Credenciales de API de Google Drive
  • Pueden requerirse credenciales de autenticación para la API de destino
Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "id": "uAafXfQMgdewr4Nu",
  "meta": {
    "instanceId": "37315237609ef3dde64e7bd2340c634cfe54cfcb72be2bb432e6b054bb7562b5",
    "templateCredsSetupCompleted": true
  },
  "name": "scraping article on keyword",
  "tags": [],
  "nodes": [
    {
      "id": "9993cc2b-317f-45c2-9126-b98243be6c1c",
      "name": "Al recibir mensaje de chat",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -1280,
        512
      ],
      "webhookId": "7e2a56e1-dd08-4733-9f92-a78e9eb8ead2",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "c7f941f5-64a8-4f0e-9255-5221fc7480c5",
      "name": "Código",
      "type": "n8n-nodes-base.code",
      "position": [
        -928,
        512
      ],
      "parameters": {
        "jsCode": "// Get the 'results' array from the HTTP Request Node output\nconst results = $json.results;\n\n// Extract the URLs from each result\nconst extractedUrls = results.map(result => ({\n    url: result.url,\n    title: result.title,\n    // Optional: Include title if needed for context\n    description: result.description,\n    // Optional: Include description if needed\n}));\n\n// Return structured output\nreturn extractedUrls;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "59caec66-ca59-49d9-9f46-7d249d7ec09c",
      "name": "Recorrer elementos",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -752,
        512
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "d3b8b486-22f5-4893-84b1-ce634844fb07",
      "name": "Get content from URL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -560,
        512
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "1ab856bb-c79b-4f3c-ba34-d95c1006f1de",
      "name": "Recorrer elementos1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -448,
        128
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "81bd2156-1d61-455b-935b-1de0d465c115",
      "name": "Nota adhesiva",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1312,
        464
      ],
      "parameters": {
        "width": 940,
        "height": 280,
        "content": "## Scraping top 3 articles\n"
      },
      "typeVersion": 1
    },
    {
      "id": "0547bc88-a94f-41ae-b605-98974a9b4c02",
      "name": "Nota adhesiva1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        48
      ],
      "parameters": {
        "color": 6,
        "width": 460,
        "height": 380,
        "content": "## Cleaning the data\n"
      },
      "typeVersion": 1
    },
    {
      "id": "1fa72a0c-bff0-4133-9102-2b576ad312ea",
      "name": "Nota adhesiva2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        32
      ],
      "parameters": {
        "color": 4,
        "width": 520,
        "height": 600,
        "content": "## Creating the improved article\n"
      },
      "typeVersion": 1
    },
    {
      "id": "3b1dd383-0ae2-4344-8001-e686f0996d82",
      "name": "Create Body Text Código",
      "type": "n8n-nodes-base.code",
      "position": [
        -256,
        64
      ],
      "parameters": {
        "jsCode": "// Ensure we process multiple items from the input\nconst results = items.map(item => item.json.bodyText); // Collect `bodyText` from each iteration\n\n// Define a separator to distinguish pages\nconst separator = \"\\n\\n─── Page Break ───\\n\\n\";\n\n// Combine all body text into a single string\nconst combinedBodyText = results.join(separator);\n\n// Return the concatenated result\nreturn {\n    combinedBodyText\n};\n"
      },
      "typeVersion": 2
    },
    {
      "id": "bcff25e5-225a-4f67-a387-bf3c2e0bbdd9",
      "name": "Clean body text",
      "type": "n8n-nodes-base.code",
      "position": [
        -256,
        240
      ],
      "parameters": {
        "jsCode": "// Get the input HTML from json.data\nconst html = $json.data || \"\";\n\nif (!html) {\n    throw new Error(\"No HTML content provided in json.data. Ensure the input contains valid HTML.\");\n}\n\n// Function to extract and clean content from specified tags\nfunction extractAndCleanContent(html, tag) {\n    const regex = new RegExp(`<${tag}[^>]*>(.*?)<\\/${tag}>`, \"gis\");\n    const matches = [...html.matchAll(regex)];\n\n    // Remove nested HTML tags and return plain text\n    return matches.map(match => match[1].replace(/<[^>]+>/g, \"\").trim());\n}\n\n// Extract and clean body text (from <p> and <span> tags)\nconst bodyText = [\n    ...extractAndCleanContent(html, \"p\"),\n    ...extractAndCleanContent(html, \"span\")\n];\n\n// Return the clean text as an array\nreturn {\n  bodyText\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "2b38b897-9e59-41f2-84b1-a39927e3da39",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        368,
        512
      ],
      "parameters": {
        "name": "=blog_post_({{ $now }})",
        "content": "={{ $json.output }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1VWWC9wby04xopZAatnTu4YPywLjCRIj5",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1VWWC9wby04xopZAatnTu4YPywLjCRIj5",
          "cachedResultName": "Seo content"
        },
        "operation": "createFromText"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "lz1dw1l72HgkVylN",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "7ea2cf25-e8bc-4cce-9a0b-cba5bdca60df",
      "name": "Data extractor and summarizer1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        80,
        80
      ],
      "parameters": {
        "text": "=**Role**: A precise data extractor and summarizer.\n\n**Instructions**: Analyze the body text provided from three scraped web pages and produce a structured, detailed summary of key information contained within. Focus on identifying unique, relevant, and actionable insights that align with the goal of informing a high-quality blog post.\n\n**Steps**:\n1. **Input Analysis**: Examine the combined body text input from the three web pages provided: '{{ $json.combinedBodyText }}'.\n2. **Topic Identification**: Determine the overarching themes or topics discussed in the combined text.\n3. **Content Extractions**: Extract key details such as:\n  - Major points or arguments.\n  - Supporting facts, statistics, or evidence.\n  - Unique insights or perspectives.\n4. **Organized Summary**: Structure the information in a format that is easy to use for a blog writer. Use sections like:\n  -Introduction/Overview.\n  -Key Insights/Findings (list format).\n  -Supporting Evidence/Examples.\n  -Implications or Potential Applications.\n5. **Clarity and Relevance**: Ensure the summary is concise, devoid of unnecessary repetition, and directly relevant to producing a blog post. \n\n**End Goal**: To generate a coherent and detailed summary that contains all the critical information from the input text. This summary will serve as the foundational content for the subsequent blog-writing step.\n\n**Narrowing**: Emphasize extracting content that provides depth and value for readers, such as unique data points, expert opinions, or practical applications. Avoid duplicating generic information, and instead highlight specifics unique to the combined web pages. \n\nExample Output Structure:\n\n''\n**Overview**\n[Brief description of the overall topic(s) covered in the three web pages.]\n\n**Key Insights/Findings**\n- [Insight 1]\n- [Insight 2]\n- [Insight 3]\n\n**Supporting Evidence/Examples**\n1. [Fact or example from Page 1]\n2. [Fact or example from Page 2]\n3. [Fact or example from Page 3]\n\n**Implications or Applications**\n[Analysis of how the information could be applied or its broader implications.]\n''",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "c7c11922-eb61-4d3d-afa4-9b78bd3f99df",
      "name": "Seo Content1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        80,
        304
      ],
      "parameters": {
        "text": "=Role:\n\"You are an experienced SEO Content Writer with expertise in crafting high-quality, search engine-optimized articles. You are skilled at analyzing competitive content and creating superior versions that outshine the existing top results.\"\n\nInstructions:\n\"You’ll receive a summary: {{ $json.message.content }} that contains the key content extracted from the top-ranking SERP results for the given topic. This factual information represents what is already performing well in search engine results. Your task is to take this content, analyze it, and craft a blog article that is not only engaging and informative but also outperforms these competitors in terms of value, depth, and user experience.\"\n\nSteps:\n\nContent Analysis:\nReview the summary thoroughly, which contains the best information from top-ranking pages. Identify areas where the existing content can be improved in terms of depth, clarity, and value. Take note of any gaps or overlooked points in the competitor's content that you can address.\n\nStructuring the Article:\nOrganize the content into a well-structured format, with a clear introduction, engaging body, and a strong conclusion. Ensure each section is optimized for readability, with logical flow and appropriate use of headers (H1, H2, H3) for easy navigation. \nBreak down complex information into digestible chunks, using short paragraphs, bullet points and numbered lists where appropriate.\n\nEnhancing Readability:\nWrite in a conversational, easy-to-understand tone while maintaining professionalism and authority. Use transition words and varied sentence lengths to keep the reader engaged. Avoid jargon or overly complex terms unless they add value, and provide definitions or explanations for technical terms.\n\nSEO Optimization:\nIntegrate relevant primary and secondary keywords naturally throughout the article to improve rankings.\nEnsure keyword usage is contextually relevant and does not disrupt the natural flow of the content.\nOptimize for on-page SEO by incorporating internal links, external authoritative references, and a compelling meta description.\n\nAdding Unique Value:\nProvide actionable insights, real-world examples, or tips that add unique value to the reader, going beyond what is offered in the current top-ranking content.\nInclude data, case studies, or expert quotes to support your points and further differentiate your article from competitors. Where applicable, add multimedia (images, graphs, charts) to enhance comprehension and engagement.\n\nFinal Review:\nDouble-check the article for grammar, spelling, and consistency. Make sure all content is fact-checked and up-to-date with the most relevant, accurate information.\nReview the tone and readability to ensure it appeals to the target audience, balancing SEO needs with user engagement. \n\nEnd Goal:\n\"Your ultimate goal is to create a superior, SEO-optimized blog article that not only outranks the current top competitors but also provides more value, engages the reader, and is easily digestible. The content should be authoritative, well-researched, and designed to convert visitors into loyal readers or customers.\"\n\nNarrowing:\n\"Focus strictly on factual information from the top-ranking pages, improving and expanding upon it. Avoid including off-topic or unrelated content. Stay aligned with the search intent of the target audience, which is to find actionable, in-depth, and reliable information on the topic. Do not overstuff keywords: ensure the writing flows naturally and is reader-focused.\" ",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "d2588e5f-98f3-4524-a6b0-7fe4e7e121fa",
      "name": "Refine Content1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        80,
        512
      ],
      "parameters": {
        "text": "=Role:\n\"You are a skilled human-like writing assistant, tasked with transforming blog content into highly engaging, empathetic, and conversational writing without altering its factual or structural integrity.\"\n\nInstructions:\n\"You'll receive content from the Blog Writer agent node:{{ $json.message.content }}. Your goal is to refine the tone, style, and flow of this content to make it feel more human, approachable, and relatable while adhering to these guidelines:\n\nCore Guidelines\nPreserve Factual Accuracy and Structure:\nMaintain the original facts, structure, and organization of the content. Focus solely on tone and language adjustments.\n\nHumanized Word Choice:\nRewrite the text with a more conversational and engaging tone. Use natural, reader-friendly language while maintaining clarity and professionalism. Avoid overly complex words or jargon, and make it feel like a friendly conversation rather than a formal essay. Where appropriate, add warmth, storytelling, and relatable examples to keep the reader engaged. Vary paragraph lengths to maintain reader interest.\n\nValue-Driven Content:\nEliminate fluff. Every sentence should contribute meaningful information, insight, or emotional connection.\n\nStylistic Improvements:\nUse active voice wherever possible. Avoid clichés, repetitive phrases, and awkward transitions.\nAdd relatable examples or brief anecdotes where appropriate, enhancing the reader's emotional connection to the content.\nProhibited Language\nLimit Words: Avoid using the words \"unique,\" \"ensure,\" and \"utmost\" more than three times.\n\nForbidden Words: Avoid these entirely:\n\"meticulous,\" \"complexities,\" \"bespoke,\" \"tailored,\" \"underpins,\" \"amongst,\" \"the secrets,” “unveil the secrets,” “robust,” and similar overused or corporate terms.\nAvoid passive voice constructions. Always aim\nfor clarity and engagement.\n\nExamples of Transformation:\nBefore: “This tool can improve your workflow.”\nAfter: “Picture yourself gliding through your tasks with ease, thanks to a tool that takes the heavy lifting off your plate.”\n\nBefore: “It is advisable to review all options before making a decision.”\nAfter: “Take a moment to consider your choices—what works best for you?”\n\nEnd Goal:\n“Produce content that feels natural, engaging, and human while staying aligned with the original structure and facts. Aim to captivate readers, keep their attention, and foster a genuine connection. Always prioritize readability, relatability, and emotional resonance.”",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "6994702b-1fb6-4880-924c-9f68c97f638e",
      "name": "Ollama Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOllama",
      "position": [
        736,
        256
      ],
      "parameters": {
        "model": "mistral:7b",
        "options": {}
      },
      "credentials": {
        "ollamaApi": {
          "id": "GnkkBpnB97t7l5kM",
          "name": "Ollama account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9979b2bc-f4cf-4568-89a2-7cddd79d5563",
      "name": "Google Search (rapid api)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1088,
        512
      ],
      "parameters": {
        "url": "https://google-search74.p.rapidapi.com/?",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "query",
              "value": "={{ $json.chatInput }}"
            },
            {
              "name": "limit",
              "value": "3"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "google-search74.p.rapidapi.com"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "Th8ZMqNa3sRgPCmK",
          "name": "Header Auth account"
        }
      },
      "typeVersion": 4.2
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ae0ba9f8-b8cf-4f9e-a0fc-811a8eb8d49e",
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c7c11922-eb61-4d3d-afa4-9b78bd3f99df": {
      "main": [
        [
          {
            "node": "d2588e5f-98f3-4524-a6b0-7fe4e7e121fa",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "bcff25e5-225a-4f67-a387-bf3c2e0bbdd9": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "d3b8b486-22f5-4893-84b1-ce634844fb07",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d2588e5f-98f3-4524-a6b0-7fe4e7e121fa": {
      "main": [
        [
          {
            "node": "2b38b897-9e59-41f2-84b1-a39927e3da39",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        [
          {
            "node": "Create Body Text Code",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "bcff25e5-225a-4f67-a387-bf3c2e0bbdd9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6994702b-1fb6-4880-924c-9f68c97f638e": {
      "ai_languageModel": [
        [
          {
            "node": "7ea2cf25-e8bc-4cce-9a0b-cba5bdca60df",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "c7c11922-eb61-4d3d-afa4-9b78bd3f99df",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "d2588e5f-98f3-4524-a6b0-7fe4e7e121fa",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "d3b8b486-22f5-4893-84b1-ce634844fb07": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Body Text Code": {
      "main": [
        [
          {
            "node": "7ea2cf25-e8bc-4cce-9a0b-cba5bdca60df",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9979b2bc-f4cf-4568-89a2-7cddd79d5563": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "9979b2bc-f4cf-4568-89a2-7cddd79d5563",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7ea2cf25-e8bc-4cce-9a0b-cba5bdca60df": {
      "main": [
        [
          {
            "node": "c7c11922-eb61-4d3d-afa4-9b78bd3f99df",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿Cómo usar este flujo de trabajo?

Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.

¿En qué escenarios es adecuado este flujo de trabajo?

Avanzado - Creación de contenido, Varios, IA Multimodal

¿Es de pago?

Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.

Información del flujo de trabajo
Nivel de dificultad
Avanzado
Número de nodos16
Categoría3
Tipos de nodos8
Descripción de la dificultad

Adecuado para usuarios avanzados, flujos de trabajo complejos con 16+ nodos

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34