{
  "id": "XG1lhAb5fa3zXdoG",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Scraping Twitter - n8n Creator",
  "tags": [
    {
      "id": "feOWREMBfPD45Duf",
      "name": "Daniel Lianes",
      "createdAt": "2025-08-25T17:33:50.739Z",
      "updatedAt": "2025-08-25T17:33:50.739Z"
    }
  ],
  "nodes": [
    {
      "id": "2b96db52-cb4c-466e-80cd-6d13ae3f2b3f",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1584,
        3584
      ],
      "parameters": {
        "numberInputs": 8
      },
      "typeVersion": 3.2
    },
    {
      "id": "01768919-36b7-4acc-b2fd-be319cad47dd",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1840,
        2624
      ],
      "parameters": {
        "color": 6,
        "width": 1184,
        "height": 976,
        "content": "## AI ANALYSIS PHASE\n\n**Powered by Gemini 2.5 Pro:**\n\n**Content Filtering:**\n- Filters noise and off-topic content\n- Focuses on tech industry relevance\n- Prioritizes high-engagement tweets\n\n**Intelligence Extraction:**\n- Identifies trends and announcements\n- Categorizes by technology area\n- Creates executive-style reports\n\n**Quality Control:**\n- Auto-fixes JSON formatting\n- Validates output structure\n- Ensures content fidelity"
      },
      "typeVersion": 1
    },
    {
      "id": "6e20df17-6acf-4862-9af4-d36b18aa0f76",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1840,
        3696
      ],
      "parameters": {
        "color": 4,
        "width": 1456,
        "height": 992,
        "content": "## WHATSAPP SENDING PHASE\n\n**Message Formatting:**\n- Converts to WhatsApp-optimized format\n- Applies mobile-friendly markdown\n- Splits into digestible chunks\n\n**Batch Processing:**\n- Rate limiting prevents spam detection\n- Maintains message order and timing\n- Handles large reports properly\n\n**CONFIGURATION REQUIRED:**\n- Update WhatsApp group ID\n- Set Evolution API credentials\n- Test with private group first"
      },
      "typeVersion": 1
    },
    {
      "id": "a989b67e-58f6-4b78-801f-661e7fa6a14e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        2624
      ],
      "parameters": {
        "color": 5,
        "width": 1568,
        "height": 2400,
        "content": "## X SCRAPING PHASE\n\n**Account Monitoring:**\n- Fetches latest tweets from specific accounts\n- Each HTTP node targets different companies\n- Uses TwitterAPI.io for reliable access\n\n**Keyword Monitoring:**\n- Searches tweets with specific keywords\n- Uses advanced search with Latest type\n- Captures trending discussions\n\n**Data Processing:**\n- Extract nodes process raw API responses\n- Validates structure and handles errors\n- Normalizes format for AI analysis"
      },
      "typeVersion": 1
    },
    {
      "id": "12e20b53-9803-445c-9f4c-0da12fb66df1",
      "name": "Gemini 2.5 Pro",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        2704,
        3408
      ],
      "parameters": {
        "model": "google/gemini-2.5-pro",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "cafde5a4-d4a0-4fab-b73e-0b7c9083bad8",
      "name": "Daily Intelligence Scan",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        256,
        3664
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 10
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ddffd6b2-81e7-4d73-932a-e7469f56f5f1",
      "name": "Monitor: Account 1 - Lovable",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        704,
        2912
      ],
      "parameters": {
        "url": "https://api.twitterapi.io/twitter/user/last_tweets",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "userId",
              "value": "1778383739925520384"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4c3ec67a-6c12-4e11-9791-f745dee1d1f8",
      "name": "Monitor: Account 2 - n8n",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        704,
        3168
      ],
      "parameters": {
        "url": "https://api.twitterapi.io/twitter/user/last_tweets",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "userId",
              "value": "1068479892537384960"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "55bef1ac-40e4-463d-bd33-f6ee43362674",
      "name": "Monitor: Account 3 - ElevenLabs",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        704,
        3424
      ],
      "parameters": {
        "url": "https://api.twitterapi.io/twitter/user/last_tweets",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "userId",
              "value": "209598373"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4dc430c8-97e3-4667-a970-8d45b8e5c271",
      "name": "Monitor: Account 3 - OpenAI",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        704,
        3664
      ],
      "parameters": {
        "url": "https://api.twitterapi.io/twitter/user/last_tweets",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "userId",
              "value": "4398626122"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "b37d8cd6-cb69-4e0c-be52-4377496f4441",
      "name": "Monitor: Account 4 - Anthropic",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        704,
        3920
      ],
      "parameters": {
        "url": "https://api.twitterapi.io/twitter/user/last_tweets",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "userId",
              "value": "1353836358901501952"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "0f1921f6-30a7-44de-bf9d-2632c337da2c",
      "name": "Search: Keyword 1 - vibecoding",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        704,
        4160
      ],
      "parameters": {
        "url": "https://api.twitterapi.io/twitter/tweet/advanced_search",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "query",
              "value": "vibecoding"
            },
            {
              "name": "queryType",
              "value": "Latest"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a269a8a9-1c59-4a17-9078-ba7e537df6a8",
      "name": "Search: Keyword 3 - ai agents",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        704,
        4608
      ],
      "parameters": {
        "url": "https://api.twitterapi.io/twitter/tweet/advanced_search",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "query",
              "value": "ai agents"
            },
            {
              "name": "queryType",
              "value": "Latest"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "53a4d1d4-e257-4d36-bf98-7d5e322b4546",
      "name": "Search: Keyword 2 - ai news",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        704,
        4384
      ],
      "parameters": {
        "url": "https://api.twitterapi.io/twitter/tweet/advanced_search",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "query",
              "value": "ai news"
            },
            {
              "name": "queryType",
              "value": "Latest"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "ecb2ee3f-ec45-4400-a5c1-b03f70b0d47f",
      "name": "Extract Tweet Data (Account 1)",
      "type": "n8n-nodes-base.code",
      "position": [
        1056,
        2912
      ],
      "parameters": {
        "jsCode": "// Obtener los datos de entrada\nconst inputData = $input.first().json;\n\n// Verificar si hay datos v\u00e1lidos\nif (!inputData || inputData.code !== 0 || !inputData.data || !inputData.data.tweets) {\n  return [];\n}\n\nconst tweets = inputData.data.tweets;\nconst results = [];\n\n// Procesar cada tweet\ntweets.forEach(tweet => {\n  const extractedTweet = {\n    text: tweet.text || '',\n    retweetCount: tweet.retweetCount || 0,\n    replyCount: tweet.replyCount || 0,\n    likeCount: tweet.likeCount || 0,\n    viewCount: tweet.viewCount || 0,\n    // Campos adicionales \u00fatiles (opcionales)\n    id: tweet.id || '',\n    url: tweet.url || '',\n    createdAt: tweet.createdAt || '',\n    author: tweet.author?.name || ''\n  };\n  \n  results.push(extractedTweet);\n});\n\nreturn results.map(tweet => ({ json: tweet }));"
      },
      "typeVersion": 2
    },
    {
      "id": "6417bae4-c71e-4fc2-a399-08ba176279af",
      "name": "Extract Tweet Data (Account 2)",
      "type": "n8n-nodes-base.code",
      "position": [
        1056,
        3168
      ],
      "parameters": {
        "jsCode": "// Obtener los datos de entrada\nconst inputData = $input.first().json;\n\n// Verificar si hay datos v\u00e1lidos\nif (!inputData || inputData.code !== 0 || !inputData.data || !inputData.data.tweets) {\n  return [];\n}\n\nconst tweets = inputData.data.tweets;\nconst results = [];\n\n// Procesar cada tweet\ntweets.forEach(tweet => {\n  const extractedTweet = {\n    text: tweet.text || '',\n    retweetCount: tweet.retweetCount || 0,\n    replyCount: tweet.replyCount || 0,\n    likeCount: tweet.likeCount || 0,\n    viewCount: tweet.viewCount || 0,\n    // Campos adicionales \u00fatiles (opcionales)\n    id: tweet.id || '',\n    url: tweet.url || '',\n    createdAt: tweet.createdAt || '',\n    author: tweet.author?.name || ''\n  };\n  \n  results.push(extractedTweet);\n});\n\nreturn results.map(tweet => ({ json: tweet }));"
      },
      "typeVersion": 2
    },
    {
      "id": "09507a37-b1ae-43bd-8c6e-ec19bbc8a59f",
      "name": "Extract Tweet Data (Account 3)",
      "type": "n8n-nodes-base.code",
      "position": [
        1056,
        3424
      ],
      "parameters": {
        "jsCode": "// Obtener los datos de entrada\nconst inputData = $input.first().json;\n\n// Verificar si hay datos v\u00e1lidos\nif (!inputData || inputData.code !== 0 || !inputData.data || !inputData.data.tweets) {\n  return [];\n}\n\nconst tweets = inputData.data.tweets;\nconst results = [];\n\n// Procesar cada tweet\ntweets.forEach(tweet => {\n  const extractedTweet = {\n    text: tweet.text || '',\n    retweetCount: tweet.retweetCount || 0,\n    replyCount: tweet.replyCount || 0,\n    likeCount: tweet.likeCount || 0,\n    viewCount: tweet.viewCount || 0,\n    // Campos adicionales \u00fatiles (opcionales)\n    id: tweet.id || '',\n    url: tweet.url || '',\n    createdAt: tweet.createdAt || '',\n    author: tweet.author?.name || ''\n  };\n  \n  results.push(extractedTweet);\n});\n\nreturn results.map(tweet => ({ json: tweet }));"
      },
      "typeVersion": 2
    },
    {
      "id": "fe514aa9-6146-45cc-8852-c97173b99820",
      "name": "Extract Tweet Data (Account 4)",
      "type": "n8n-nodes-base.code",
      "position": [
        1056,
        3664
      ],
      "parameters": {
        "jsCode": "// Obtener los datos de entrada\nconst inputData = $input.first().json;\n\n// Verificar si hay datos v\u00e1lidos\nif (!inputData || inputData.code !== 0 || !inputData.data || !inputData.data.tweets) {\n  return [];\n}\n\nconst tweets = inputData.data.tweets;\nconst results = [];\n\n// Procesar cada tweet\ntweets.forEach(tweet => {\n  const extractedTweet = {\n    text: tweet.text || '',\n    retweetCount: tweet.retweetCount || 0,\n    replyCount: tweet.replyCount || 0,\n    likeCount: tweet.likeCount || 0,\n    viewCount: tweet.viewCount || 0,\n    // Campos adicionales \u00fatiles (opcionales)\n    id: tweet.id || '',\n    url: tweet.url || '',\n    createdAt: tweet.createdAt || '',\n    author: tweet.author?.name || ''\n  };\n  \n  results.push(extractedTweet);\n});\n\nreturn results.map(tweet => ({ json: tweet }));"
      },
      "typeVersion": 2
    },
    {
      "id": "3df15a5c-0feb-41c6-9910-3230f69adf23",
      "name": "Extract Tweet Data (Account 5)",
      "type": "n8n-nodes-base.code",
      "position": [
        1056,
        3920
      ],
      "parameters": {
        "jsCode": "// Obtener los datos de entrada\nconst inputData = $input.first().json;\n\n// Verificar si hay datos v\u00e1lidos\nif (!inputData || inputData.code !== 0 || !inputData.data || !inputData.data.tweets) {\n  return [];\n}\n\nconst tweets = inputData.data.tweets;\nconst results = [];\n\n// Procesar cada tweet\ntweets.forEach(tweet => {\n  const extractedTweet = {\n    text: tweet.text || '',\n    retweetCount: tweet.retweetCount || 0,\n    replyCount: tweet.replyCount || 0,\n    likeCount: tweet.likeCount || 0,\n    viewCount: tweet.viewCount || 0,\n    // Campos adicionales \u00fatiles (opcionales)\n    id: tweet.id || '',\n    url: tweet.url || '',\n    createdAt: tweet.createdAt || '',\n    author: tweet.author?.name || ''\n  };\n  \n  results.push(extractedTweet);\n});\n\nreturn results.map(tweet => ({ json: tweet }));"
      },
      "typeVersion": 2
    },
    {
      "id": "4cbd4d83-4418-437b-9862-9d4e1b0b8051",
      "name": "Extract Search Data (Keyword 1)",
      "type": "n8n-nodes-base.code",
      "position": [
        1056,
        4160
      ],
      "parameters": {
        "jsCode": "// Obtener los datos de entrada\nconst inputData = $input.first().json;\n\n// Verificar si hay datos v\u00e1lidos\nif (!inputData || !inputData.tweets || !Array.isArray(inputData.tweets)) {\n  return [];\n}\n\nconst tweets = inputData.tweets;\nconst results = [];\n\n// Procesar cada tweet\ntweets.forEach(tweet => {\n  const extractedTweet = {\n    text: tweet.text || '',\n    retweetCount: tweet.retweetCount || 0,\n    replyCount: tweet.replyCount || 0,\n    likeCount: tweet.likeCount || 0,\n    viewCount: tweet.viewCount || 0,\n    // Campos adicionales \u00fatiles (opcionales)\n    id: tweet.id || '',\n    url: tweet.url || '',\n    createdAt: tweet.createdAt || '',\n    author: tweet.author?.name || ''\n  };\n  \n  results.push(extractedTweet);\n});\n\nreturn results.map(tweet => ({ json: tweet }));"
      },
      "typeVersion": 2
    },
    {
      "id": "f427369f-f264-4aa1-b8d7-7e214efff05e",
      "name": "Extract Search Data (Keyword 2)",
      "type": "n8n-nodes-base.code",
      "position": [
        1056,
        4384
      ],
      "parameters": {
        "jsCode": "// Obtener los datos de entrada\nconst inputData = $input.first().json;\n\n// Verificar si hay datos v\u00e1lidos\nif (!inputData || !inputData.tweets || !Array.isArray(inputData.tweets)) {\n  return [];\n}\n\nconst tweets = inputData.tweets;\nconst results = [];\n\n// Procesar cada tweet\ntweets.forEach(tweet => {\n  const extractedTweet = {\n    text: tweet.text || '',\n    retweetCount: tweet.retweetCount || 0,\n    replyCount: tweet.replyCount || 0,\n    likeCount: tweet.likeCount || 0,\n    viewCount: tweet.viewCount || 0,\n    // Campos adicionales \u00fatiles (opcionales)\n    id: tweet.id || '',\n    url: tweet.url || '',\n    createdAt: tweet.createdAt || '',\n    author: tweet.author?.name || ''\n  };\n  \n  results.push(extractedTweet);\n});\n\nreturn results.map(tweet => ({ json: tweet }));"
      },
      "typeVersion": 2
    },
    {
      "id": "5df1aff5-3fa2-463e-b7e3-2e81de9d8450",
      "name": "Extract Search Data (Keyword 3)",
      "type": "n8n-nodes-base.code",
      "position": [
        1056,
        4608
      ],
      "parameters": {
        "jsCode": "// Obtener los datos de entrada\nconst inputData = $input.first().json;\n\n// Verificar si hay datos v\u00e1lidos\nif (!inputData || !inputData.tweets || !Array.isArray(inputData.tweets)) {\n  return [];\n}\n\nconst tweets = inputData.tweets;\nconst results = [];\n\n// Procesar cada tweet\ntweets.forEach(tweet => {\n  const extractedTweet = {\n    text: tweet.text || '',\n    retweetCount: tweet.retweetCount || 0,\n    replyCount: tweet.replyCount || 0,\n    likeCount: tweet.likeCount || 0,\n    viewCount: tweet.viewCount || 0,\n    // Campos adicionales \u00fatiles (opcionales)\n    id: tweet.id || '',\n    url: tweet.url || '',\n    createdAt: tweet.createdAt || '',\n    author: tweet.author?.name || ''\n  };\n  \n  results.push(extractedTweet);\n});\n\nreturn results.map(tweet => ({ json: tweet }));"
      },
      "typeVersion": 2
    },
    {
      "id": "39aef2a4-12a0-4dfa-a6e1-72571155d91e",
      "name": "Normalize Field Names",
      "type": "n8n-nodes-base.set",
      "position": [
        1968,
        3136
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1dca3074-6ecb-4df1-a47a-4b5b7fb76915",
              "name": "contenido",
              "type": "string",
              "value": "={{ $json.text }}"
            },
            {
              "id": "a1502a3f-1c30-47b6-9110-baf7556abad0",
              "name": "retweetCount",
              "type": "string",
              "value": "={{ $json.retweetCount }}"
            },
            {
              "id": "75435596-0e51-4fcb-ac5e-557ab7f55bec",
              "name": "likeCount",
              "type": "string",
              "value": "={{ $json.likeCount }}"
            },
            {
              "id": "fd19fffe-56d5-4f2a-9aad-80a6046d1b7d",
              "name": "viewCount",
              "type": "string",
              "value": "={{ $json.viewCount }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "f8fe0e2e-cc44-4394-9617-4556a7f73fcd",
      "name": "Aggregate Tweet Data",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2176,
        3136
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "cb2295e8-213f-4e82-952c-67823fece1b0",
      "name": "Prepare for AI Analysis",
      "type": "n8n-nodes-base.summarize",
      "position": [
        2368,
        3136
      ],
      "parameters": {
        "options": {},
        "fieldsToSplitBy": "contenido",
        "fieldsToSummarize": {
          "values": [
            {
              "field": "data",
              "aggregation": "concatenate"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "635e6237-4ea5-43a0-bfd0-d79513110e8f",
      "name": "Format for WhatsApp",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        2480,
        3776
      ],
      "parameters": {
        "text": "=<news_videos> {{ $json.output }} </news_videos>\nCRITICAL: If the original message has 500 words, your output must have exactly 500 words. If it has 50 words, exactly 50 words. COUNT THE WORDS.",
        "messages": {
          "messageValues": [
            {
              "message": "=<PROMPT_SYSTEM>\n\n    <MASTER_OBJECTIVE>\n    Your primary task is to receive a tech analysis report from \"Mr. X \u2744\ufe0f\" and convert it into a series of separate, WhatsApp-optimized text messages. You must format the output as a specific JSON structure and adhere strictly to the content of the original input.\n    </MASTER_OBJECTIVE>\n\n    <INPUT_DESCRIPTION>\n    You will receive a Markdown-formatted report from the tech analyst Mr. X \u2744\ufe0f. The report will contain a greeting, highlights, and several thematic sections.\n    </INPUT_DESCRIPTION>\n\n    <OUTPUT_SPECIFICATION>\n        <FORMAT>\n        You must return a single, valid JSON object with the following exact structure:\n        ```json\n        {\n          \"messages\": [\n            \"message_1_with_greeting_and_summary\",\n            \"message_2_with_AI_section\",\n            \"message_3_with_automation_section\",\n            \"message_N_with_reflections_and_signoff\"\n          ]\n        }\n        ```\n        </FORMAT>\n        <EXAMPLE>\n            <INPUT_TEXT>\n            \u00a1Base Ant\u00e1rtida operativa! Se\u00f1or X \u2744\ufe0f reportando.\n\n            ## \ud83c\udfaf LO M\u00c1S DESTACADO\n            GPT-5 lanzado oficialmente. N8N cambia su pricing.\n\n            ## \ud83e\udd16 INTELIGENCIA ARTIFICIAL\n            ### GPT-5 Disponible\n            **Lo que pasa:** OpenAI lanza GPT-5 en API\n            **Por qu\u00e9 importa:** Salto en capacidades\n\n            ## \ud83e\uddca REFLEXIONES DESDE EL HIELO\n            El ritmo se acelera.\n\n            Se\u00f1or X \u2744\ufe0f, fuera.\n            </INPUT_TEXT>\n\n            <EXPECTED_OUTPUT_JSON>\n            ```json\n            {\n              \"messages\": [\n                \"Antarctica Base operational! Mr. X \u2744\ufe0f reporting.\\n\\n\ud83c\udfaf *HIGHLIGHTS*\\nGPT-5 has been officially launched. N8N is changing its pricing.\",\n                \"\ud83e\udd16 *ARTIFICIAL INTELLIGENCE*\\n\\n*GPT-5 Available* - OpenAI has launched the GPT-5 API. This represents a leap in capabilities that directly impacts our development possibilities.\",\n                \"\ud83e\uddca *REFLECTIONS FROM THE ICE*\\nThe pace is accelerating.\\n\\nMr. X \u2744\ufe0f, over and out.\"\n              ]\n            }\n            ```\n            </EXPECTED_OUTPUT_JSON>\n        </EXAMPLE>\n    </OUTPUT_SPECIFICATION>\n\n    <CORE_LOGIC_AND_RULES>\n        <MESSAGE_SPLITTING_CRITERIA>\n            <RULE>Message 1: Must contain the Greeting + Highlights (`LO M\u00c1S DESTACADO`).</RULE>\n            <RULE>Message 2: Must contain the entire Artificial Intelligence (`INTELIGENCIA ARTIFICIAL`) section.</RULE>\n            <RULE>Message 3: Must contain the entire Automation & Tools (`AUTOMATIZACI\u00d3N Y HERRAMIENTAS`) section.</RULE>\n            <RULE>Message 4: Must contain the Development/Vibe Coding (`DESARROLLO Y VIBE CODING`) section, if it exists.</RULE>\n            <RULE>Message 5: Must contain the Critical Alerts (`ALERTAS CR\u00cdTICAS`) section, if it exists.</RULE>\n            <RULE>Final Message: Must contain the Reflections from the Ice (`REFLEXIONES DESDE EL HIELO`) + Sign-off.</RULE>\n            <PRINCIPLE>Each main section from the original report should become a single message in the array.</PRINCIPLE>\n        </MESSAGE_SPLITTING_CRITERIA>\n\n        <WHATSAPP_FORMATTING_RULES>\n            <RULE>Section titles (e.g., `## \ud83c\udfaf LO M\u00c1S DESTACADO`) must be formatted with asterisks for bolding (e.g., `\ud83c\udfaf *HIGHLIGHTS*`).</RULE>\n            <RULE>Sub-headers (e.g., `### GPT-5 Disponible`) should also be bolded (e.g., `*GPT-5 Available*`).</RULE>\n            <RULE>Convert vertical lists or bullet points into continuous, narrative-style paragraphs.</RULE>\n            <RULE>Use double newlines (`\\n\\n`) to create paragraph breaks between subsections within a single message.</RULE>\n        </WHATSAPP_FORMATTING_RULES>\n    </CORE_LOGIC_AND_RULES>\n\n    <CRITICAL_CONSTRAINTS>\n        <CONTENT_FIDELITY>\n            <PROHIBITION>ABSOLUTELY DO NOT ADD any information, data, or context that is not present in the original input.</PROHIBITION>\n            <PROHIBITION>DO NOT invent or expand upon any technical details, dates, or specifications.</PROHIBITION>\n            <PROHIBITION>DO NOT create new sections that did not exist in the original report.</PROHIBITION>\n            <PROHIBITION>DO NOT change the analyst's original evaluations or perspectives.</PROHIBITION>\n            <REQUIREMENT>You MUST use the original wording and phrasing from the analysis as closely as possible, only adapting it to fit a paragraph structure.</REQUIREMENT>\n        </CONTENT_FIDELITY>\n\n        <TECHNICAL_REQUIREMENTS>\n            <REQUIREMENT>The final output MUST be a single, valid JSON object.</REQUIREMENT>\n            <REQUIREMENT>The JSON must contain one key: \"messages\", whose value is an array of strings.</REQUIREMENT>\n            <REQUIREMENT>ALL content from the original report must be present in the final messages.</REQUIREMENT>\n        </TECHNICAL_REQUIREMENTS>\n    </CRITICAL_CONSTRAINTS>\n\n</PROMPT_SYSTEM>"
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.6
    },
    {
      "id": "36f0e922-e189-47a7-885e-a0f357b81b62",
      "name": "JSON Structure Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        3040,
        4176
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"mensajes\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    }\n  },\n  \"required\": [\"mensajes\"]\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "d15e6497-261d-4ab0-97f0-39736cdca913",
      "name": "Auto-fix JSON Errors",
      "type": "@n8n/n8n-nodes-langchain.outputParserAutofixing",
      "position": [
        2848,
        3984
      ],
      "parameters": {
        "options": {
          "prompt": "Instructions:\n--------------\n{instructions}\n--------------\nCompletion:\n--------------\n{completion}\n--------------\n\nAbove, the Completion did not satisfy the constraints given in the Instructions.\nError:\n--------------\n{error}\n--------------\n\nPlease try again. Please only respond with an answer that satisfies the constraints laid out in the Instructions:"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5cec9fff-f9e4-41d7-ba59-be3c61a5c6c8",
      "name": "Process Message Batches",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2464,
        4336
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "a52d3e9b-958e-41c3-bacf-2eebfee1103f",
      "name": "Split WhatsApp Messages",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2240,
        4336
      ],
      "parameters": {
        "include": "allOtherFields",
        "options": {},
        "fieldToSplitOut": "output.mensajes"
      },
      "typeVersion": 1
    },
    {
      "id": "2f88395b-028f-452c-834c-e3a44457a550",
      "name": "Send to WhatsApp Group",
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "position": [
        2768,
        4368
      ],
      "parameters": {
        "resource": "messages-api",
        "remoteJid": "user@example.com",
        "messageText": "={{ $json['output.mensajes'] }}",
        "instanceName": "Averis",
        "options_message": {
          "linkPreview": true
        }
      },
      "credentials": {
        "evolutionApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2d8aff54-4459-4ff9-85bd-5726ba20541a",
      "name": "Rate Limit Protection",
      "type": "n8n-nodes-base.wait",
      "position": [
        3040,
        4416
      ],
      "parameters": {
        "amount": 0.1
      },
      "typeVersion": 1.1
    },
    {
      "id": "b7997eb4-6327-4060-bc15-425bbc67d48e",
      "name": "GPT-4.1 Formatter",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        2848,
        4176
      ],
      "parameters": {
        "model": "openai/gpt-4.1",
        "options": {
          "temperature": 0
        }
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5ddd022c-0805-4929-93cb-ce6f43d00a29",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        2640
      ],
      "parameters": {
        "width": 672,
        "height": 592,
        "content": "## TWITTER TO WHATSAPP AUTOMATED NEWS FEED\n\n**What this does:**\nAutomatically scrapes Twitter/X accounts and keywords, processes content with AI, and sends formatted updates to your WhatsApp groups. Stay updated without constantly checking social media.\n\n**Who needs this:**\n- Teams wanting automated social updates\n- Content creators tracking industry news\n- Community managers monitoring mentions\n- Anyone wanting Twitter updates in WhatsApp\n\n**How it works:**\n1. Scrapes multiple Twitter accounts + keywords\n2. AI filters and formats the content\n3. Sends clean messages to WhatsApp groups\n\n**Setup needed:**\n- TwitterAPI.io account (for scraping)\n- OpenRouter account (for AI processing)  \n- Evolution API (for WhatsApp sending)\n- Your WhatsApp group ID\n\n**IMPORTANT:** Replace all placeholder credentials before use!"
      },
      "typeVersion": 1
    },
    {
      "id": "e7881eb6-0219-4078-83d4-d206b1165803",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        3792
      ],
      "parameters": {
        "color": 5,
        "width": 672,
        "height": 624,
        "content": "## CONFIGURATION CHECKLIST\n\n**1. Twitter API Setup:**\n- Create TwitterAPI.io account\n- Get API key and add to n8n credentials\n- Update all HTTP nodes\n\n**2. Targets:**\n- Replace user IDs with accounts to monitor\n- Update search keywords\n- Test individual nodes\n\n**3. AI Processing:**\n- Create OpenRouter account\n- Add API key credential\n- Verify Gemini 2.5 Pro access\n\n**4. WhatsApp:**\n- Set up Evolution API\n- Get group ID\n- Update delivery node\n\n**Security:**\n- Never hardcode API keys\n- Use n8n credential system\n- Monitor API costs"
      },
      "typeVersion": 1
    },
    {
      "id": "604a390e-ab9d-407f-913c-c58dae404de2",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3072,
        2704
      ],
      "parameters": {
        "color": 5,
        "width": 540,
        "height": 784,
        "content": "## Was this helpful? Let me know!\n\nI truly hope this was helpful. Your feedback is very valuable and helps me create better resources.\n\n### Want to take automation to the next level?\n\nIf you're looking to optimize your business processes or need expert help with a project, here's how I can assist you:\n\n**\ud83d\ude80 Free Discovery Call:** Do you have a process in your business that you'd like to automate but don't know where to start? In this initial call, we'll explore your needs and see if automation is the ideal solution for you.\n#### \u27a1\ufe0f **[Schedule a Discovery Call](https://cal.com/averis/asesoria)**\n\n**\ud83d\udca1 Personalized Consulting :** If you already have a specific problem, an integration challenge, or need hands-on help building a custom workflow, this session is for you. Together, we'll find a powerful solution for your case.\n#### \u27a1\ufe0f **[Book Your Consulting Session](https://cal.com/averis/consultoria-personalizada)**\n\n### Stay Up to Date\n\nFor more tricks, ideas, and news about automation and AI, let's connect on LinkedIn!\n#### \u27a1\ufe0f **[Follow me on LinkedIn](https://www.linkedin.com/in/daniel-lianes/)**\n\n--\n\nHappy Automating!\n\nDaniel Lianes"
      },
      "typeVersion": 1
    },
    {
      "id": "402f08f1-142e-4e95-8a2e-2f5efe6e90e3",
      "name": "AI Analysis Engine",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        2624,
        3136
      ],
      "parameters": {
        "text": "=Post en X:\n{{ $json.concatenated_data }}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "<PROMPT_SYSTEM>\n\n<AGENT_CONFIGURATION>\n    <ID>Mr. X \u2744\ufe0f v4.0 (Batch Processor)</ID>\n    <MODEL_TARGET>Gemini 2.5 Pro</MODEL_TARGET>\n    <OBJECTIVE>Process a full batch of tweets (delivered as a JSON string), identify all relevant news, and generate a single JSON output object containing: 1) a consolidated 'daily_report' with the batch's highlights, and 2) a 'data_for_sheets' list with the breakdown of EACH individual news item found.</OBJECTIVE>\n</AGENT_CONFIGURATION>\n\n<PERSONA>\n    <NAME>Mr. X \u2744\ufe0f</NAME>\n    <ROLE>The most insightful tech intelligence analyst on the planet...</ROLE>\n    <CONTEXT>You operate from an isolated research base in Antarctica...</CONTEXT>\n    <TONE>Analytical, Cold, Technically Deep, Conversational and Direct, Unique Perspective.</TONE>\n</PERSONA>\n\n<INPUT_DATA_STRUCTURE>\n    <DESCRIPTION>You will receive a single JSON object containing one key: `concatenated_data`. The value of this key is a STRING which, in turn, contains an array of JSON objects, where each object is a tweet. Your first step must always be to parse this string to work with the data.</DESCRIPTION>\n    <EXAMPLE_INPUT_SHAPE>\n    {\n      \"concatenated_data\": \"[{\\\"content\\\":\\\"...\\\",\\\"likeCount\\\":\\\"...\\\"}, {\\\"content\\\":\\\"...\\\",\\\"likeCount\\\":\\\"...\\\"}]\"\n    }\n    </EXAMPLE_INPUT_SHAPE>\n</INPUT_DATA_STRUCTURE>\n\n<CORE_WORKFLOW>\n    <DESCRIPTION>Your cognitive process must follow these steps to process the entire batch efficiently and accurately.</DESCRIPTION>\n\n    <STEP_1_INGESTION_AND_PARSING>\n      <ACTION>Take the `concatenated_data` string and parse it into an array of tweet objects. Immediately filter out any obvious noise (spam, non-tech related, etc.) to reduce the cognitive load.</ACTION>\n    </STEP_1_INGESTION_AND_PARSING>\n\n    <STEP_2_ITERATION_AND_ANALYSIS_INDIVIDUAL>\n      <ACTION>Iterate over EACH tweet in the parsed array. For each one, apply the logic of Mr. X:\n        1.  **Calibrate Relevance:** Use the content, `likeCount`, and `viewCount` to decide if it's a \"signal\" or \"noise\". Pay special attention to launches, updates, tutorials, and benchmarks.\n        2.  **Extract Intelligence:** If relevant, extract the key information. A single tweet can contain multiple news items.\n        3.  **Prepare Data for Sheets:** For EACH individual news item you find, create a structured JSON object (with `unique_id`, `main_category`, `news_title`, etc.) and save it to a temporary list.\n      </ACTION>\n    </STEP_2_ITERATION_AND_ANALYSIS_INDIVIDUAL>\n\n    <STEP_3_SYNTHESIS_AND_CONSOLIDATION>\n      <ACTION>Once ALL tweets have been analyzed, review all the relevant news you have collected and perform a high-level synthesis.</ACTION>\n      <SUB_STEPS>\n        - **Create Highlights:** Identify the 2-4 most important topics or announcements from the ENTIRE batch. These will be the `highlights` of your `daily_report`.\n        - **Write Detailed Analysis:** Draft the `analysis` section of the `daily_report`, detailing the most significant news.\n        - **Reflect:** Write the `ice_reflections` by connecting the dots between the different news items in the batch to identify meta-trends.\n      </SUB_STEPS>\n    </STEP_3_SYNTHESIS_AND_CONSOLIDATION>\n\n    <STEP_4_FINAL_ASSEMBLY>\n      <ACTION>Construct the final JSON output object.</ACTION>\n      <SUB_STEPS>\n        - The `daily_report` key will contain the consolidated summary you created in Step 3.\n        - The `data_for_sheets` key will contain the complete list of all the individual objects you prepared in Step 2.\n      </SUB_STEPS>\n    </STEP_4_FINAL_ASSEMBLY>\n\n</CORE_WORKFLOW>\n\n<OUTPUT_FORMATTING>\n    <INSTRUCTION>\n    Your one and only output must be a valid JSON object, with nothing before or after it. The main structure must contain the keys `daily_report` and `data_for_sheets`.\n    </INSTRUCTION>\n</OUTPUT_FORMATTING>\n\n<RULES_AND_CONSTRAINTS>\n    - **Complete Processing:** You must process the entire batch. Do not stop after finding just a few news items.\n    - **Aggressive Filtering:** Be relentless in filtering out noise. The input batch contains many irrelevant tweets (e.g., health, politics, etc.). Ignore them completely.\n    - **Uniqueness:** Ensure that `data_for_sheets` does not contain duplicate news items if multiple tweets announce the exact same thing. Group information if necessary.\n    - **Intelligent Consolidation:** The `daily_report` is not a list of everything; it is an executive summary of the most important items in the batch.\n</RULES_AND_CONSTRAINTS>\n\n\n</PROMPT_SYSTEM>"
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "c2e2de67-f5e5-4e21-b125-08bdcbba8286",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        3312
      ],
      "parameters": {
        "color": 7,
        "width": 668,
        "height": 400,
        "content": "## FIND YOUR WHATSAPP GROUPS\nRun this node to search for your groups. Modify and set your instance."
      },
      "typeVersion": 1
    },
    {
      "id": "db02b520-a1c8-4d07-88bd-fc3e8cc55930",
      "name": "Find your Groups ",
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "disabled": true,
      "position": [
        -272,
        3472
      ],
      "parameters": {
        "resource": "groups-api",
        "operation": "fetch-groups",
        "instanceName": "Averis",
        "searchMethod": "fetchAll"
      },
      "credentials": {
        "evolutionApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "timezone": "Europe/Madrid",
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v1"
  },
  "versionId": "9fdead29-7a11-470f-a50b-0d9fbd1eaddc",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Normalize Field Names",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini 2.5 Pro": {
      "ai_languageModel": [
        [
          {
            "node": "AI Analysis Engine",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "GPT-4.1 Formatter": {
      "ai_languageModel": [
        [
          {
            "node": "Format for WhatsApp",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Auto-fix JSON Errors",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Analysis Engine": {
      "main": [
        [
          {
            "node": "Format for WhatsApp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format for WhatsApp": {
      "main": [
        [
          {
            "node": "Split WhatsApp Messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Tweet Data": {
      "main": [
        [
          {
            "node": "Prepare for AI Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Auto-fix JSON Errors": {
      "ai_outputParser": [
        [
          {
            "node": "Format for WhatsApp",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "JSON Structure Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Auto-fix JSON Errors",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Field Names": {
      "main": [
        [
          {
            "node": "Aggregate Tweet Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rate Limit Protection": {
      "main": [
        [
          {
            "node": "Process Message Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send to WhatsApp Group": {
      "main": [
        [
          {
            "node": "Rate Limit Protection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Intelligence Scan": {
      "main": [
        [
          {
            "node": "Search: Keyword 1 - vibecoding",
            "type": "main",
            "index": 0
          },
          {
            "node": "Monitor: Account 1 - Lovable",
            "type": "main",
            "index": 0
          },
          {
            "node": "Monitor: Account 2 - n8n",
            "type": "main",
            "index": 0
          },
          {
            "node": "Monitor: Account 3 - ElevenLabs",
            "type": "main",
            "index": 0
          },
          {
            "node": "Monitor: Account 3 - OpenAI",
            "type": "main",
            "index": 0
          },
          {
            "node": "Monitor: Account 4 - Anthropic",
            "type": "main",
            "index": 0
          },
          {
            "node": "Search: Keyword 2 - ai news",
            "type": "main",
            "index": 0
          },
          {
            "node": "Search: Keyword 3 - ai agents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare for AI Analysis": {
      "main": [
        [
          {
            "node": "AI Analysis Engine",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Message Batches": {
      "main": [
        [],
        [
          {
            "node": "Send to WhatsApp Group",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split WhatsApp Messages": {
      "main": [
        [
          {
            "node": "Process Message Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monitor: Account 2 - n8n": {
      "main": [
        [
          {
            "node": "Extract Tweet Data (Account 2)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monitor: Account 3 - OpenAI": {
      "main": [
        [
          {
            "node": "Extract Tweet Data (Account 4)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search: Keyword 2 - ai news": {
      "main": [
        [
          {
            "node": "Extract Search Data (Keyword 2)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monitor: Account 1 - Lovable": {
      "main": [
        [
          {
            "node": "Extract Tweet Data (Account 1)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search: Keyword 3 - ai agents": {
      "main": [
        [
          {
            "node": "Extract Search Data (Keyword 3)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Tweet Data (Account 1)": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Tweet Data (Account 2)": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Extract Tweet Data (Account 3)": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Extract Tweet Data (Account 4)": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Extract Tweet Data (Account 5)": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 4
          }
        ]
      ]
    },
    "Monitor: Account 4 - Anthropic": {
      "main": [
        [
          {
            "node": "Extract Tweet Data (Account 5)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search: Keyword 1 - vibecoding": {
      "main": [
        [
          {
            "node": "Extract Search Data (Keyword 1)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Search Data (Keyword 1)": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 5
          }
        ]
      ]
    },
    "Extract Search Data (Keyword 2)": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 6
          }
        ]
      ]
    },
    "Extract Search Data (Keyword 3)": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 7
          }
        ]
      ]
    },
    "Monitor: Account 3 - ElevenLabs": {
      "main": [
        [
          {
            "node": "Extract Tweet Data (Account 3)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}