AutomationFlowsAI & RAG › Template 7372

Template 7372

Template 7372. Uses googleSheets, outputParserStructured, lmChatAnthropic, n8n-nodes-serpapi. Scheduled trigger; 54 nodes.

Cron / scheduled trigger★★★★★ complexityAI-powered54 nodesGoogle SheetsOutput Parser StructuredAnthropic ChatN8N Nodes SerpapiChain Llm@Mendable/N8N Nodes Firecrawl
AI & RAG Trigger: Cron / scheduled Nodes: 54 Complexity: ★★★★★ AI nodes: yes Added:

This workflow follows the Chainllm → 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": "33e255b5-f53d-4abd-8c26-422aa80b15ee",
      "name": "Get Query",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2832,
        544
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Query"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/1z7iP_i98PT9BQuUypAi0c3NHkdhREEPJWkDjyj8Snfw/edit"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "6fc7735a-c387-4eb1-8fa9-3b72638616c6",
      "name": "Add datas",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -736,
        592
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "Query",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Query",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "\u00c9volution",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "\u00c9volution",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "News",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "News",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Id\u00e9e",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Id\u00e9e",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "={{ new Date(new Date().setMonth(new Date().getMonth() - 1)).toLocaleDateString('fr-FR', { month: 'long' }).charAt(0).toUpperCase() + new Date(new Date().setMonth(new Date().getMonth() - 1)).toLocaleDateString('fr-FR', { month: 'long' }).slice(1) }} {{ $('Loop Over Items').item.json.Query }}"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/1z7iP_i98PT9BQuUypAi0c3NHkdhREEPJWkDjyj8Snfw/edit"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "e4780fe5-46ae-4e5b-9580-ff69a2aa2118",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1424,
        592
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"query1\": [\"query\", \"\u00e9volution\"],\n    \"query2\": [\"query\", \"\u00e9volution\"],\n    \"query3\": [\"query\", \"\u00e9volution\"]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "22e998bb-8786-47c8-92fa-240d4802025a",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -2608,
        544
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "1c104fbd-2abf-48fd-b175-66278eedf3ba",
      "name": "Anthropic Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        -1632,
        576
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-20250514",
          "cachedResultName": "Claude Sonnet 4"
        },
        "options": {}
      },
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "a7ec9151-75e7-433d-8c00-50c9f68bd660",
      "name": "Search trend",
      "type": "n8n-nodes-serpapi.serpApi",
      "onError": "continueRegularOutput",
      "maxTries": 5,
      "position": [
        -2336,
        544
      ],
      "parameters": {
        "q": "={{ $json.Query }}",
        "operation": "google_trends",
        "requestOptions": {},
        "additionalFields": {
          "hl": "fr",
          "geo": "FR",
          "date": "today 1-m",
          "data_type": "RELATED_QUERIES"
        }
      },
      "credentials": {
        "serpApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 1
    },
    {
      "id": "d86685bb-22c8-4cb8-aea9-736f7b44582a",
      "name": "Classing query",
      "type": "n8n-nodes-base.code",
      "position": [
        -1904,
        544
      ],
      "parameters": {
        "jsCode": "// N8N Code Node - Create Nested Structure for Related Queries\n// This code creates a nested structure: Topic -> related queries\n// Get the input data (assuming it's the first item)\nconst inputData = $input.all()[0].json;\n// Initialize arrays to store extracted data\nlet relatedQueries = [];\nlet risingQueries = [];\ntry {\n  // Check if the response contains related_queries data\n  if (inputData.related_queries) {\n\n    // Extract \"top\" related queries if they exist\n    if (inputData.related_queries.top) {\n      relatedQueries = \n        inputData.related_queries.top.map((query, index) => ({\n          query: query.query,\n          value: query.value,\n          extracted_value: query.extracted_value,\n          link: query.link,\n          serpapi_link: query.serpapi_link,\n          type: 'top',\n          rank: index + 1\n        }));\n    }\n\n    // Extract \"rising\" related queries if they exist\n    if (inputData.related_queries.rising) {\n      risingQueries = \n        inputData.related_queries.rising.map((query, index) => ({\n          query: query.query,\n          value: query.value,\n          extracted_value: query.extracted_value,\n          link: query.link,\n          serpapi_link: query.serpapi_link,\n          type: 'rising',\n          rank: index + 1\n        }));\n    }\n  }\n\n  // Combine all queries with their types\n  const allQueries = [...relatedQueries, ...risingQueries];\n\n  // Sort by extracted_value (descending) to get top performers\n  const sortedQueries = allQueries.sort((a, b) => {\n    const aVal = typeof a.extracted_value === 'number' ? a.extracted_value : 0;\n    const bVal = typeof b.extracted_value === 'number' ? b.extracted_value : 0;\n    return bVal - aVal;\n  });\n\n  // Get top 10 queries\n  const top10Queries = sortedQueries.slice(0, 10);\n\n  // Return only top 10 queries\n  return [\n    {\n      json: {\n        topic: inputData.search_parameters?.q || 'Unknown',\n        top_10_queries: top10Queries\n      }\n    }\n  ];\n\n} catch (error) {\n  // Handle errors gracefully\n  return [\n    {\n      json: {\n        error: 'Failed to extract and structure related queries data',\n        error_message: error.message,\n        topic: inputData.search_parameters?.q || 'Unknown'\n      }\n    }\n  ];\n}"
      },
      "typeVersion": 2
    },
    {
      "id": "95d803cf-01c0-47a7-ac53-416ea1531e5f",
      "name": "Sorting queries",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -1584,
        416
      ],
      "parameters": {
        "text": "=Votre t\u00e2che est de s\u00e9lectionner lister les requ\u00eates qui correspond \u00e9troitement au cr\u00e9neau de \"{{ $('Loop Over Items').item.json.Query }}\" mais elle ne doit pas \u00eatre g\u00e9olocalis\u00e9e, par exemple \"{{ $('Loop Over Items').item.json.Query }} Paris\" car nous ne voulons pas de sujets li\u00e9s \u00e0 la localisation.\nElle ne doivent pas avoir un lien direct avec ces sujets : {{ $('Loop Over Items').item.json['Query to avoid'] }}\n\nPour chaque requ\u00eate indique son \u00e9volution en pourcentage (sans le +).\n\n{{ JSON.stringify($json.top_10_queries, null, 2) }}\n\n",
        "batching": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "22acba62-5ac7-4b81-ab22-c08aefa1f84a",
      "name": "Sorting output > table",
      "type": "n8n-nodes-base.code",
      "position": [
        -1056,
        416
      ],
      "parameters": {
        "jsCode": "// R\u00e9cup\u00e9rer les donn\u00e9es d'entr\u00e9e\nconst inputData = $input.all()[0].json.output;\n\n// Initialiser le tableau de sortie\nlet restructuredData = [];\n\n// Parcourir chaque query dans l'objet\nObject.keys(inputData).forEach(key => {\n  const queryData = inputData[key];\n  \n  // V\u00e9rifier que queryData existe et contient au moins 2 \u00e9l\u00e9ments non vides\n  if (queryData && \n      Array.isArray(queryData) && \n      queryData.length >= 2 && \n      queryData[0] && \n      queryData[0].trim() !== \"\" && \n      queryData[1] && \n      queryData[1].trim() !== \"\") {\n    \n    restructuredData.push({\n      Query: queryData[0],           // Le nom de la requ\u00eate\n      \u00c9volution: queryData[1],       // Le pourcentage d'\u00e9volution\n      News: \"\",                       // Colonne vide pour l'instant\n      Id\u00e9e: \"\"                        // Colonne vide pour l'instant\n    }); \n  }\n});\n\n// Retourner le tableau restructur\u00e9\nreturn restructuredData.map(item => ({ json: item }));"
      },
      "typeVersion": 2
    },
    {
      "id": "58717045-bccf-4daf-abf1-e86a8ad2f586",
      "name": "Anthropic Chat Model8",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        1488,
        304
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-20250514",
          "cachedResultName": "Claude 4 Sonnet"
        },
        "options": {}
      },
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "9d243a77-9785-49fb-8c81-7d6ef42d06f9",
      "name": "Anthropic Chat Model9",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        1472,
        720
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-20250514",
          "cachedResultName": "Claude 4 Sonnet"
        },
        "options": {}
      },
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "f13905ac-cc19-4288-a290-43779e06dd2f",
      "name": "Anthropic Chat Model10",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        1456,
        1168
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-20250514",
          "cachedResultName": "Claude 4 Sonnet"
        },
        "options": {}
      },
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "b770ab6f-f954-4f9f-980e-2946ed32d93b",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -3184,
        544
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "6d90ae52-b983-49e1-ab6f-f0b731c1fb20",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3248,
        848
      ],
      "parameters": {
        "width": 800,
        "height": 288,
        "content": "### What the system does:\n\nSchedule Trigger activates the workflow automatically\nRetrieves query data from Google Sheets \"Query\" tab\nLoops through each query for individual processing\n\n### Result:\n\u2705 Automated workflow execution on schedule\n\u2705 Query data loaded from centralized spreadsheet\n\u2705 Ready to process multiple search terms\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e7b14044-d0fb-4390-9792-d108fd5eff04",
      "name": "Trends OK ?",
      "type": "n8n-nodes-base.if",
      "position": [
        -2128,
        544
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "4cfb50c4-ade2-4a9e-b027-ddc1e08bca46",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.search_metadata.status }}",
              "rightValue": "Success"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "f224008f-f8cd-45cf-803e-78cc6ea57a7e",
      "name": "Create sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -752,
        416
      ],
      "parameters": {
        "title": "={{ new Date(new Date().setMonth(new Date().getMonth() - 1)).toLocaleDateString('fr-FR', { month: 'long' }).charAt(0).toUpperCase() + new Date(new Date().setMonth(new Date().getMonth() - 1)).toLocaleDateString('fr-FR', { month: 'long' }).slice(1) }} {{ $('Loop Over Items').item.json.Query }}",
        "options": {},
        "operation": "create",
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/1z7iP_i98PT9BQuUypAi0c3NHkdhREEPJWkDjyj8Snfw/edit"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "7464748a-0450-41c7-9f80-3e2cd662b18f",
      "name": "Sort related query",
      "type": "n8n-nodes-base.code",
      "position": [
        -480,
        544
      ],
      "parameters": {
        "jsCode": "// R\u00e9cup\u00e9ration des donn\u00e9es d'entr\u00e9e\nconst inputData = $input.all();\n\n// Initialisation des tableaux de sortie\nlet query1 = [];\nlet query2 = [];\nlet query3 = [];\n\n// Parcours des donn\u00e9es d'entr\u00e9e\ninputData.forEach((item, index) => {\n  if (item.json.Query) {\n    // Attribution des queries selon leur position (index)\n    // On ne garde que la valeur de la colonne Query\n    if (index === 0) {\n      query1.push(item.json.Query);\n    } else if (index === 1) {\n      query2.push(item.json.Query);\n    } else if (index === 2) {\n      query3.push(item.json.Query);\n    }\n  }\n});\n\n// Construction de l'objet de sortie avec les donn\u00e9es sp\u00e9cifiques des nodes\nconst output = {\n  // R\u00e9cup\u00e9ration des donn\u00e9es sp\u00e9cifiques des nodes pr\u00e9c\u00e9dentes\n  chatInput: $('When chat message received').first().json.chatInput,\n  loopQuery: $('Loop Over Items').first().json.Query,\n  \n  // Pr\u00e9servation de toutes les donn\u00e9es d'entr\u00e9e originales\n  originalData: inputData.map(item => item.json)\n};\n\n// Ajout des tableaux seulement s'ils contiennent des donn\u00e9es\nif (query1.length > 0) {\n  output.query1 = query1;\n}\n\nif (query2.length > 0) {\n  output.query2 = query2;\n}\n\nif (query3.length > 0) {\n  output.query3 = query3;\n}\n\n// Retour du r\u00e9sultat\nreturn [output];"
      },
      "typeVersion": 2
    },
    {
      "id": "278c9c3f-ee87-4426-b102-70ac5cff0f33",
      "name": "If query 1",
      "type": "n8n-nodes-base.if",
      "position": [
        -96,
        128
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "dd0a7eab-29a5-4a01-9d5b-1220a2c40e18",
              "operator": {
                "type": "array",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.query1 }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "da0bf038-1437-42e6-8368-d8362eca02e9",
      "name": "If query 2",
      "type": "n8n-nodes-base.if",
      "position": [
        -96,
        544
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "dd0a7eab-29a5-4a01-9d5b-1220a2c40e18",
              "operator": {
                "type": "array",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.query2 }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "b8a6d2c0-98b3-4ab4-a72b-a8edef09dca7",
      "name": "If query 3",
      "type": "n8n-nodes-base.if",
      "position": [
        -96,
        1008
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "dd0a7eab-29a5-4a01-9d5b-1220a2c40e18",
              "operator": {
                "type": "array",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.query3 }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "619e65e9-a51e-4019-8de3-93fe8d9e0aa5",
      "name": "Search GNews query 1",
      "type": "n8n-nodes-serpapi.serpApi",
      "position": [
        160,
        112
      ],
      "parameters": {
        "q": "={{ $json.query1[0] }}",
        "operation": "google_news",
        "requestOptions": {},
        "additionalFields": {
          "gl": "fr",
          "hl": "fr"
        }
      },
      "credentials": {
        "serpApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "549c24ff-247a-489d-bede-ac47fcf732c1",
      "name": "Search GNews query 2",
      "type": "n8n-nodes-serpapi.serpApi",
      "position": [
        160,
        528
      ],
      "parameters": {
        "q": "={{ $json.query2[0] }}",
        "operation": "google_news",
        "requestOptions": {},
        "additionalFields": {
          "gl": "fr",
          "hl": "fr"
        }
      },
      "credentials": {
        "serpApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "859738c2-3655-4d8e-bafd-3c4b27081d72",
      "name": "Search GNews query 3",
      "type": "n8n-nodes-serpapi.serpApi",
      "position": [
        160,
        992
      ],
      "parameters": {
        "q": "={{ $json.query3[0] }}",
        "operation": "google_news",
        "requestOptions": {},
        "additionalFields": {
          "gl": "fr",
          "hl": "fr"
        }
      },
      "credentials": {
        "serpApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e0195ecb-91b4-49aa-9654-dd0e44eb7296",
      "name": "Return URL only query 1",
      "type": "n8n-nodes-base.code",
      "position": [
        368,
        112
      ],
      "parameters": {
        "jsCode": "// R\u00e9cup\u00e9rer les donn\u00e9es d'entr\u00e9e\nconst inputData = $input.all()[0].json;\n\n// Extraire les r\u00e9sultats de news\nconst newsResults = inputData.news_results || [];\n\n// Trier par position (ordre croissant)\nconst sortedResults = newsResults.sort((a, b) => a.position - b.position);\n\n// Prendre les 3 premiers r\u00e9sultats\nconst top3Results = sortedResults.slice(0, 3);\n\n// Cr\u00e9er un objet avec les 3 liens s\u00e9par\u00e9s\nconst separatedLinks = {\n  link1: top3Results[0]?.link || null,\n  link2: top3Results[1]?.link || null,\n  link3: top3Results[2]?.link || null\n};\n\n// Retourner un seul objet avec les 3 liens\nreturn [{ json: separatedLinks }];"
      },
      "typeVersion": 2
    },
    {
      "id": "f1688b09-86db-464a-a35d-5c80c5f2673b",
      "name": "Return URL only query 2",
      "type": "n8n-nodes-base.code",
      "position": [
        368,
        528
      ],
      "parameters": {
        "jsCode": "// R\u00e9cup\u00e9rer les donn\u00e9es d'entr\u00e9e\nconst inputData = $input.all()[0].json;\n\n// Extraire les r\u00e9sultats de news\nconst newsResults = inputData.news_results || [];\n\n// Trier par position (ordre croissant)\nconst sortedResults = newsResults.sort((a, b) => a.position - b.position);\n\n// Prendre les 3 premiers r\u00e9sultats\nconst top3Results = sortedResults.slice(0, 3);\n\n// Cr\u00e9er un objet avec les 3 liens s\u00e9par\u00e9s\nconst separatedLinks = {\n  link1: top3Results[0]?.link || null,\n  link2: top3Results[1]?.link || null,\n  link3: top3Results[2]?.link || null\n};\n\n// Retourner un seul objet avec les 3 liens\nreturn [{ json: separatedLinks }];"
      },
      "typeVersion": 2
    },
    {
      "id": "0009afc7-0cab-483f-9cba-6610d61b85ec",
      "name": "Return URL only query 3",
      "type": "n8n-nodes-base.code",
      "position": [
        368,
        992
      ],
      "parameters": {
        "jsCode": "// R\u00e9cup\u00e9rer les donn\u00e9es d'entr\u00e9e\nconst inputData = $input.all()[0].json;\n\n// Extraire les r\u00e9sultats de news\nconst newsResults = inputData.news_results || [];\n\n// Trier par position (ordre croissant)\nconst sortedResults = newsResults.sort((a, b) => a.position - b.position);\n\n// Prendre les 3 premiers r\u00e9sultats\nconst top3Results = sortedResults.slice(0, 3);\n\n// Cr\u00e9er un objet avec les 3 liens s\u00e9par\u00e9s\nconst separatedLinks = {\n  link1: top3Results[0]?.link || null,\n  link2: top3Results[1]?.link || null,\n  link3: top3Results[2]?.link || null\n};\n\n// Retourner un seul objet avec les 3 liens\nreturn [{ json: separatedLinks }];"
      },
      "typeVersion": 2
    },
    {
      "id": "6af6fd2e-5891-4231-94e0-282b252f5c82",
      "name": "Scrape article 1 query 1",
      "type": "@mendable/n8n-nodes-firecrawl.firecrawl",
      "onError": "continueRegularOutput",
      "position": [
        608,
        112
      ],
      "parameters": {
        "url": "={{ $json.link1 }}",
        "operation": "scrape",
        "requestOptions": {}
      },
      "credentials": {
        "firecrawlApi": {
          "name": "<your credential>"
        }
      },
      "executeOnce": false,
      "typeVersion": 1,
      "alwaysOutputData": false
    },
    {
      "id": "ea169298-5883-43a2-be31-aef66f0ca67e",
      "name": "Scrape article 1 query 2",
      "type": "@mendable/n8n-nodes-firecrawl.firecrawl",
      "onError": "continueRegularOutput",
      "position": [
        608,
        528
      ],
      "parameters": {
        "url": "={{ $json.link1 }}",
        "operation": "scrape",
        "requestOptions": {}
      },
      "credentials": {
        "firecrawlApi": {
          "name": "<your credential>"
        }
      },
      "executeOnce": false,
      "typeVersion": 1,
      "alwaysOutputData": false
    },
    {
      "id": "7a32f248-4433-4851-a894-ec9285e48a97",
      "name": "Scrape article 1 query 3",
      "type": "@mendable/n8n-nodes-firecrawl.firecrawl",
      "onError": "continueRegularOutput",
      "position": [
        608,
        992
      ],
      "parameters": {
        "url": "={{ $json.link1 }}",
        "operation": "scrape",
        "requestOptions": {}
      },
      "credentials": {
        "firecrawlApi": {
          "name": "<your credential>"
        }
      },
      "executeOnce": false,
      "typeVersion": 1,
      "alwaysOutputData": false
    },
    {
      "id": "d979ab85-2a34-45af-9c0b-e687b57dd2eb",
      "name": "Scrape article 2 query 1",
      "type": "@mendable/n8n-nodes-firecrawl.firecrawl",
      "onError": "continueRegularOutput",
      "position": [
        800,
        112
      ],
      "parameters": {
        "url": "={{ $('Return URL only query 1').item.json.link2 }}",
        "operation": "scrape",
        "requestOptions": {}
      },
      "credentials": {
        "firecrawlApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": false
    },
    {
      "id": "e7df40af-85cd-4ef3-ade7-b4261674f563",
      "name": "Scrape article 2 query 2",
      "type": "@mendable/n8n-nodes-firecrawl.firecrawl",
      "onError": "continueRegularOutput",
      "position": [
        800,
        528
      ],
      "parameters": {
        "url": "={{ $('Return URL only query 2').item.json.link2 }}",
        "operation": "scrape",
        "requestOptions": {}
      },
      "credentials": {
        "firecrawlApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": false
    },
    {
      "id": "04191cc1-8a5e-4282-99e9-5d5bf7f6abd2",
      "name": "Scrape article 2 query 3",
      "type": "@mendable/n8n-nodes-firecrawl.firecrawl",
      "onError": "continueRegularOutput",
      "position": [
        800,
        992
      ],
      "parameters": {
        "url": "={{ $('Return URL only query 3').item.json.link2 }}",
        "operation": "scrape",
        "requestOptions": {}
      },
      "credentials": {
        "firecrawlApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": false
    },
    {
      "id": "f155470f-836c-4a41-8fa0-3ce5d1107d4f",
      "name": "Scrape article 3 query 1",
      "type": "@mendable/n8n-nodes-firecrawl.firecrawl",
      "onError": "continueRegularOutput",
      "position": [
        1008,
        112
      ],
      "parameters": {
        "url": "={{ $('Return URL only query 1').item.json.link3 }}",
        "operation": "scrape",
        "requestOptions": {}
      },
      "credentials": {
        "firecrawlApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6c55cfee-31c1-403c-9e6a-1685ea60d1b1",
      "name": "Scrape article 3 query 2",
      "type": "@mendable/n8n-nodes-firecrawl.firecrawl",
      "onError": "continueRegularOutput",
      "position": [
        1008,
        528
      ],
      "parameters": {
        "url": "={{ $('Return URL only query 2').item.json.link3 }}",
        "operation": "scrape",
        "requestOptions": {}
      },
      "credentials": {
        "firecrawlApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "242853fe-0222-47d3-9fb1-97bb35e4422e",
      "name": "Scrape article 3 query 3",
      "type": "@mendable/n8n-nodes-firecrawl.firecrawl",
      "onError": "continueRegularOutput",
      "position": [
        1008,
        992
      ],
      "parameters": {
        "url": "={{ $('Return URL only query 3').item.json.link3 }}",
        "operation": "scrape",
        "requestOptions": {}
      },
      "credentials": {
        "firecrawlApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ed299f19-94bf-4f55-9a12-0d0173c98564",
      "name": "Article analysis query 1",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1408,
        112
      ],
      "parameters": {
        "text": "=Source 1\n\n{{ $('Scrape article 1 query 1').item.json.data.markdown }}\n\nSource 2 \n\n{{ $('Scrape article 2 query 1').item.json.data.markdown }}\n\nSource 3\n\n{{ $json.data.markdown }}\n",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=Voil\u00e0 le contenu de 3 articles peux tu les analyser en en d\u00e9duire 3 id\u00e9e d'article de blog SEO avec \u00e0 chaque fois une proposition de mot cl\u00e9 associ\u00e9.\n\nExemple : \n\nTh\u00e8me de l'article 1, proposition de mot cl\u00e9 1\nTh\u00e8me de l'article 2, proposition de mot cl\u00e9 2\nTh\u00e8me de l'article 3, proposition de mot cl\u00e9 3\n\nIl se peut qu'un article soit vide dans ce cas ne le traite pas.\n\nNe fais pas d'introduction ou de conclusion \u00e0 ta r\u00e9ponse r\u00e9pond simplement \u00e0 la requ\u00eate."
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "9c86a0e5-42fa-45b9-ab10-fda6e56cc53e",
      "name": "Article analysis query 2",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1392,
        528
      ],
      "parameters": {
        "text": "=Source 1\n\n{{ $('Scrape article 1 query 2').item.json.data.markdown }}\n\nSource 2 \n\n{{ $('Scrape article 2 query 2').item.json.data.markdown }}\n\nSource 3\n\n{{ $json.data.markdown }}\n",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=Voil\u00e0 le contenu de 3 articles peux tu les analyser en en d\u00e9duire 3 id\u00e9e d'article de blog SEO avec \u00e0 chaque fois une proposition de mot cl\u00e9 associ\u00e9.\n\nExemple : \n\nTh\u00e8me de l'article 1, proposition de mot cl\u00e9 1\nTh\u00e8me de l'article 2, proposition de mot cl\u00e9 2\nTh\u00e8me de l'article 3, proposition de mot cl\u00e9 3\n\nIl se peut qu'un article soit vide dans ce cas ne le traite pas.\n\nNe fais pas d'introduction ou de conclusion \u00e0 ta r\u00e9ponse r\u00e9pond simplement \u00e0 la requ\u00eate."
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "196a1f55-bd5f-4f4d-af82-d97280c156ba",
      "name": "Article analysis query 3",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1392,
        992
      ],
      "parameters": {
        "text": "=Source 1\n\nArticle indisponible\n\nSource 2 \n\n{{ $('Scrape article 2 query 3').item.json.data.markdown }}\n\nSource 3\n\n\n{{ $json.data.markdown }}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=Voil\u00e0 le contenu de 3 articles peux tu les analyser en en d\u00e9duire 3 id\u00e9e d'article de blog SEO avec \u00e0 chaque fois une proposition de mot cl\u00e9 associ\u00e9.\n\nExemple : \n\nTh\u00e8me de l'article 1, proposition de mot cl\u00e9 1\nTh\u00e8me de l'article 2, proposition de mot cl\u00e9 2\nTh\u00e8me de l'article 3, proposition de mot cl\u00e9 3\n\nIl se peut qu'un article soit vide dans ce cas ne le traite pas.\n\nNe fais pas d'introduction ou de conclusion \u00e0 ta r\u00e9ponse r\u00e9pond simplement \u00e0 la requ\u00eate."
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "0c45f73c-8f74-4323-b713-30d96560f4a3",
      "name": "Add article datas query 1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1712,
        112
      ],
      "parameters": {
        "columns": {
          "value": {
            "News": "={{ $('Return URL only query 1').item.json.link1 }}\n{{ $('Return URL only query 1').item.json.link2 }}\n{{ $('Return URL only query 1').item.json.link3 }}",
            "Id\u00e9e": "={{ $json.text }}",
            "Query": "={{ $('Sort related query').item.json.query1[0] }}"
          },
          "schema": [
            {
              "id": "Query",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Query",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "\u00c9volution",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "\u00c9volution",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "News",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "News",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Id\u00e9e",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Id\u00e9e",
              "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": [
            "Query"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "={{ new Date(new Date().setMonth(new Date().getMonth() - 1)).toLocaleDateString('fr-FR', { month: 'long' }).charAt(0).toUpperCase() + new Date(new Date().setMonth(new Date().getMonth() - 1)).toLocaleDateString('fr-FR', { month: 'long' }).slice(1) }} {{ $('Sort related query').item.json.loopQuery }}"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/1z7iP_i98PT9BQuUypAi0c3NHkdhREEPJWkDjyj8Snfw/edit"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "e24d8855-b348-42bb-977b-93d6c022efca",
      "name": "Add article datas query 2",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1712,
        528
      ],
      "parameters": {
        "columns": {
          "value": {
            "News": "={{ $('Return URL only query 2').item.json.link1 }}\n{{ $('Return URL only query 2').item.json.link2 }}\n{{ $('Return URL only query 2').item.json.link3 }}",
            "Id\u00e9e": "={{ $json.text }}",
            "Query": "={{ $('Sort related query').item.json.query2[0] }}"
          },
          "schema": [
            {
              "id": "Query",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Query",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "\u00c9volution",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "\u00c9volution",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "News",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "News",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Id\u00e9e",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Id\u00e9e",
              "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": [
            "Query"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "={{ new Date(new Date().setMonth(new Date().getMonth() - 1)).toLocaleDateString('fr-FR', { month: 'long' }).charAt(0).toUpperCase() + new Date(new Date().setMonth(new Date().getMonth() - 1)).toLocaleDateString('fr-FR', { month: 'long' }).slice(1) }} {{ $('Sort related query').item.json.loopQuery }}"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/1z7iP_i98PT9BQuUypAi0c3NHkdhREEPJWkDjyj8Snfw/edit"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "858b0d03-5e99-4fd6-adbe-c7e32187af76",
      "name": "Add article datas query 3",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1712,
        992
      ],
      "parameters": {
        "columns": {
          "value": {
            "News": "={{ $('Return URL only query 3').item.json.link1 }}\n{{ $('Return URL only query 3').item.json.link2 }}\n{{ $('Return URL only query 3').item.json.link3 }}",
            "Id\u00e9e": "={{ $json.text }}",
            "Query": "={{ $('Sort related query').item.json.query3[0] }}"
          },
          "schema": [
            {
              "id": "Query",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Query",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "\u00c9volution",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "\u00c9volution",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "News",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "News",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Id\u00e9e",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Id\u00e9e",
              "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": [
            "Query"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "={{ new Date(new Date().setMonth(new Date().getMonth() - 1)).toLocaleDateString('fr-FR', { month: 'long' }).charAt(0).toUpperCase() + new Date(new Date().setMonth(new Date().getMonth() - 1)).toLocaleDateString('fr-FR', { month: 'long' }).slice(1) }} {{ $('Sort related query').item.json.loopQuery }}"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/1z7iP_i98PT9BQuUypAi0c3NHkdhREEPJWkDjyj8Snfw/edit"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "a4e2b222-b673-492d-8ec1-b0e8436ec90d",
      "name": "Merge queries",
      "type": "n8n-nodes-base.merge",
      "position": [
        2416,
        512
      ],
      "parameters": {
        "numberInputs": 3
      },
      "executeOnce": true,
      "typeVersion": 3.2
    },
    {
      "id": "394c91b4-f7af-4ed7-a45c-377f2877ba69",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3248,
        320
      ],
      "parameters": {
        "width": 800,
        "height": 496,
        "content": "# Phase 1: Data Collection & Initialization"
      },
      "typeVersion": 1
    },
    {
      "id": "9880cbe8-922b-4339-acc5-74b5c4c378b8",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2400,
        320
      ],
      "parameters": {
        "color": 2,
        "width": 624,
        "height": 480,
        "content": "# Phase 2: Trend Analysis"
      },
      "typeVersion": 1
    },
    {
      "id": "48a5881b-85cc-4f20-8802-502a60ec8ba9",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2416,
        848
      ],
      "parameters": {
        "color": 2,
        "width": 640,
        "height": 272,
        "content": "### What the system does:\n\nSearches Google Trends for each query using SerpAPI\nValidates search results - checks if trends data is available\nExtracts related queries and classifies them by performance\nSorts top 10 trending queries by popularity and growth\n\n### Result:\n\u2705 Real-time trend data from Google\n\u2705 Related search terms identified\n\u2705 Performance metrics captured"
      },
      "typeVersion": 1
    },
    {
      "id": "fb3a7cf9-92f9-4f5b-af6c-533ae2d3d845",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1728,
        320
      ],
      "parameters": {
        "color": 3,
        "width": 512,
        "height": 480,
        "content": "# Phase 3: Query Filtering & Selection"
      },
      "typeVersion": 1
    },
    {
      "id": "79f4dbe7-98bc-4be7-9e73-9ccd841334aa",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1728,
        848
      ],
      "parameters": {
        "color": 3,
        "width": 512,
        "height": 272,
        "content": "### What the system does:\n\nAnalyzes trending queries with Claude AI\nFilters out location-based searches (e.g., \"Paris\" queries)\nRemoves unwanted topics based on predefined criteria\nExtracts growth percentages for each selected query\nStructures data into organized format\n\n### Result:\n\u2705 Relevant queries selected automatically\n\u2705 Growth metrics attached to each query\n\u2705 Geographic and unwanted topics filtered out"
      },
      "typeVersion": 1
    },
    {
      "id": "a82cce28-ed32-4bd2-a695-5fa10ab98e8c",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1168,
        320
      ],
      "parameters": {
        "color": 4,
        "width": 816,
        "height": 480,
        "content": "# Phase 4: Spreadsheet Setup"
      },
      "typeVersion": 1
    },
    {
      "id": "48d4ae25-d080-4e97-96e4-6ee0eced7ca0",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1168,
        848
      ],
      "parameters": {
        "color": 4,
        "width": 816,
        "height": 272,
        "content": "### What the system does:\n\nCreates new sheet named with current month and query\nAdds filtered data to the spreadsheet\nOrganizes information into Query, Evolution, News, and Ideas columns\nSorts related queries into separate arrays (query1, query2, query3)\n\n### Result:\n\u2705 Dedicated sheet created for each main topic\n\u2705 Initial data structure established\n\u2705 Queries prepared for news research\n"
      },
      "typeVersion": 1
    },
    {
      "id": "f8bdbc03-802c-4532-991a-75e8648c31c9",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -48
      ],
      "parameters": {
        "color": 5,
        "width": 1328,
        "height": 1264,
        "content": "# Phase 5: News Research (Parallel Processing)"
      },
      "typeVersion": 1
    },
    {
      "id": "cf1f7e2b-51ad-4169-ba67-2dd673a0a756",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        1264
      ],
      "parameters": {
        "color": 5,
        "width": 1328,
        "height": 272,
        "content": "### What happens for each query:\n\nSearches Google News for current articles\nExtracts top 3 article URLs from search results\nScrapes article content using Firecrawl\nProcesses 3 articles simultaneously for comprehensive coverage\n\n### Result:\n\u2705 Current news articles retrieved\n\u2705 Full article content extracted\n\u2705 Multiple sources analyzed per query"
      },
      "typeVersion": 1
    },
    {
      "id": "fcc81b2e-a90d-4c2d-8cfc-a038a0aadc97",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        -48
      ],
      "parameters": {
        "color": 6,
        "width": 688,
        "height": 1360,
        "content": "# Phase 6: Content Analysis & Idea Generation"
      },
      "typeVersion": 1
    },
    {
      "id": "18c0ca2c-9a5c-4ade-b44f-0246193dfb90",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        1360
      ],
      "parameters": {
        "color": 6,
        "width": 688,
        "height": 272,
        "content": "### What the system does:\n\nAnalyzes scraped articles with Claude AI\nGenerates 3 SEO blog ideas per query\nProvides keyword suggestions for each idea\nCreates actionable content recommendations\n\n### Result:\n\u2705 Blog post ideas generated from current trends\n\u2705 SEO keywords identified\n\u2705 Content strategy suggestions provided"
      },
      "typeVersion": 1
    },
    {
      "id": "5a2d67d6-c5e4-482e-a698-1bde9c2bdcb0",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2048,
        -352
      ],
      "parameters": {
        "width": 816,
        "height": 336,
        "content": "## Need more advanced automation solutions? Contact us for custom enterprise workflows!\n\n# Growth-AI.fr\n\n## https://www.linkedin.com/in/allanvaccarizi/\n## https://www.linkedin.com/in/hugo-marinier-%F0%9F%A7%B2-6537b633/"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Add datas": {
      "main": [
        [
          {
            "node": "Sort related query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Query": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If query 1": {
      "main": [
        [
          {
            "node": "Search GNews query 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If query 2": {
      "main": [
        [
          {
            "node": "Search GNews query 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If query 3": {
      "main": [
        [
          {
            "node": "Search GNews query 3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trends OK ?": {
      "main": [
        [
          {
            "node": "Classing query",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search trend": {
      "main": [
        [
          {
            "node": "Trends OK ?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge queries": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classing query": {
      "main": [
        [
          {
            "node": "Sorting queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Search trend",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sorting queries": {
      "main": [
        [
          {
            "node": "Sorting output > table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort related query": {
      "main": [
        [
          {
            "node": "If query 2",
            "type": "main",
            "index": 0
          },
          {
            "node": "If query 3",
            "type": "main",
            "index": 0
          },
          {
            "node": "If query 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Sorting queries",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Search GNews query 1": {
      "main": [
        [
          {
            "node": "Return URL only query 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search GNews query 2": {
      "main": [
        [
          {
            "node": "Return URL only query 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search GNews query 3": {
      "main": [
        [
          {
            "node": "Return URL only query 3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model8": {
      "ai_languageModel": [
        [
          {
            "node": "Article analysis query 1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model9": {
      "ai_languageModel": [
        [
          {
            "node": "Article analysis query 2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model10": {
      "ai_languageModel": [
        [
          {
            "node": "Article analysis query 3",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Sorting output > table": {
      "main": [
        [
          {
            "node": "Create sheets",
            "type": "main",
            "index": 0
          },
          {
            "node": "Add datas",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Return URL only query 1": {
      "main": [
        [
          {
            "node": "Scrape article 1 query 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Return URL only query 2": {
      "main": [
        [
          {
            "node": "Scrape article 1 query 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Return URL only query 3": {
      "main": [
        [
          {
            "node": "Scrape article 1 query 3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Article analysis query 1": {
      "main": [
        [
          {
            "node": "Add article datas query 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Article analysis query 2": {
      "main": [
        [
          {
            "node": "Add article datas query 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Article analysis query 3": {
      "main": [
        [
          {
            "node": "Add article datas query 3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape article 1 query 1": {
      "main": [
        [
          {
            "node": "Scrape article 2 query 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape article 1 query 2": {
      "main": [
        [
          {
            "node": "Scrape article 2 query 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape article 1 query 3": {
      "main": [
        [
          {
            "node": "Scrape article 2 query 3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape article 2 query 1": {
      "main": [
        [
          {
            "node": "Scrape article 3 query 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape article 2 query 2": {
      "main": [
        [
          {
            "node": "Scrape article 3 query 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape article 2 query 3": {
      "main": [
        [
          {
            "node": "Scrape article 3 query 3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape article 3 query 1": {
      "main": [
        [
          {
            "node": "Article analysis query 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape article 3 query 2": {
      "main": [
        [
          {
            "node": "Article analysis query 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape article 3 query 3": {
      "main": [
        [
          {
            "node": "Article analysis query 3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Sorting queries",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Add article datas query 1": {
      "main": [
        [
          {
            "node": "Merge queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add article datas query 2": {
      "main": [
        [
          {
            "node": "Merge queries",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Add article datas query 3": {
      "main": [
        [
          {
            "node": "Merge queries",
            "type": "main",
            "index": 2
          }
        ]
      ]
    }
  }
}

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

Template 7372. Uses googleSheets, outputParserStructured, lmChatAnthropic, n8n-nodes-serpapi. Scheduled trigger; 54 nodes.

Source: https://gist.github.com/shraey96/091785d32a7bc2371856772688df6206 — 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

📺 Full walkthrough video: https://youtu.be/dXz5OTbm4c8

Google Sheets, Output Parser Structured, Anthropic Chat +3
AI & RAG

This n8n workflow allows you to automatically archive your monthly Spotify liked tracks in a Google Sheet, along with playlist details and descriptions. Based on this data, Claude 3.5 is used to class

HTTP Request, Anthropic Chat, Spotify +3
AI & RAG

🚀 Create Pro-Level Social Media Carousels & Auto-Publish with Blotato Who is this for?

Google Sheets, Jina Ai, HTTP Request +4
AI & RAG

📺 Full walkthrough video: https://youtu.be/QHvfykuSbF8

Anthropic Chat, N8N Nodes Serpapi, Chain Llm +3
AI & RAG

This workflow runs every morning, pulls outbound campaign rows from Google Sheets, uses Anthropic Claude to generate a performance summary with sentiment counts and prioritized follow-ups, and sends t

Google Sheets, Chain Llm, Anthropic Chat +2