AutomationFlowsSocial Media › Extract and Merge Twitter (x) Threads Using Twitterapi.io

Extract and Merge Twitter (x) Threads Using Twitterapi.io

Byenes cingoz @ecingoz on n8n.io

Thread Detection: Automatically detects whether the provided Twitter link is a single tweet or a thread. Tweet Extraction: Fetches and returns the content of a single tweet, or gathers all tweets in a thread by retrieving the first tweet and all connected replies. Thread…

Event trigger★★★★☆ complexity18 nodesExecute Workflow TriggerHTTP Request
Social Media Trigger: Event Nodes: 18 Complexity: ★★★★☆ Added:

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

This workflow follows the Execute Workflow Trigger → HTTP Request 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
{
  "id": "23sZVFonPs0Q3gvm",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Twitter Thread Fetcher: Extract and Merge Tweets from Threads",
  "tags": [],
  "nodes": [
    {
      "id": "209216e9-30f6-40d1-98a6-96324e28db47",
      "name": "Merge first tweet and others",
      "type": "n8n-nodes-base.merge",
      "position": [
        1360,
        -120
      ],
      "parameters": {},
      "typeVersion": 3.1
    },
    {
      "id": "3429ac0d-1d24-4d30-aaac-a0ae6adaef93",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -420,
        120
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5df01f81-da74-4a17-8856-682f8bdf580e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        -280
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "fe1ba598-8c65-468e-bd58-b8b71d48e0f1",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        340,
        -280
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "95f7ac46-d864-483c-bce3-482142fe3697",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        -280
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "2a9eabb2-75a4-40a8-9379-0895203c49c9",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -420,
        -120
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "ee80999e-4980-4794-ac69-9d2c43a7a9d5",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1820,
        -120
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8acccfa4-5bb0-456a-ab7b-7eeef598cf8e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        -440
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "82efbaa8-03d6-4d05-81a4-e2bebe26f403",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        340,
        -440
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "5734a4e8-a751-440e-b216-52fe8b257444",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        -440
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "36baf07f-abe4-46f1-8e8e-5344ee200f52",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -580,
        -440
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "abd08db1-8742-4d52-b510-b3d6d68453be",
      "name": "Extract Tweet ID and Username",
      "type": "n8n-nodes-base.function",
      "position": [
        -60,
        -5
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a81d8f05-d7a6-4c97-b90b-2c7e9c7807f1",
      "name": "Get first tweet",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        160,
        -220
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "23a0d0a4-d119-4a25-8771-7b4aca3ffe5b",
      "name": "Extract Conversation and Author ID",
      "type": "n8n-nodes-base.function",
      "position": [
        380,
        -120
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c48394bc-e96d-455f-92a9-46db485e3aae",
      "name": "Merge all tweet infos",
      "type": "n8n-nodes-base.merge",
      "position": [
        600,
        -5
      ],
      "parameters": {},
      "typeVersion": 3.1
    },
    {
      "id": "1683b177-c050-46fa-8714-c7af785297ca",
      "name": "Get Tweet Replies",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        820,
        0
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "f85bbf89-c9e9-46f8-8f5a-14ca33c0e220",
      "name": "Fetch tweets which are connected to first tweet",
      "type": "n8n-nodes-base.code",
      "position": [
        1040,
        0
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "0fda4ada-cecd-4730-9ea9-1f385afe1c02",
      "name": "Filter empty ones",
      "type": "n8n-nodes-base.filter",
      "position": [
        1580,
        -120
      ],
      "parameters": {},
      "typeVersion": 2.2
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "805f0bc5-601e-4db7-ba87-7cdc4fef06dc",
  "connections": {
    "Get first tweet": {
      "main": [
        [
          {
            "node": "Extract Conversation and Author ID",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge first tweet and others",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter empty ones": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Tweet Replies": {
      "main": [
        [
          {
            "node": "Fetch tweets which are connected to first tweet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge all tweet infos": {
      "main": [
        [
          {
            "node": "Get Tweet Replies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge first tweet and others": {
      "main": [
        [
          {
            "node": "Filter empty ones",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Tweet ID and Username": {
      "main": [
        [
          {
            "node": "Get first tweet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge all tweet infos",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Extract Tweet ID and Username",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Extract Tweet ID and Username",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Conversation and Author ID": {
      "main": [
        [
          {
            "node": "Merge all tweet infos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch tweets which are connected to first tweet": {
      "main": [
        [
          {
            "node": "Merge first tweet and others",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Thread Detection: Automatically detects whether the provided Twitter link is a single tweet or a thread. Tweet Extraction: Fetches and returns the content of a single tweet, or gathers all tweets in a thread by retrieving the first tweet and all connected replies. Thread…

Source: https://n8n.io/workflows/4088/ — original creator credit. Request a take-down →

More Social Media workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Social Media

Disclaimer: this workflow only works on self-hosted instances due to the file system usage.

Execute Workflow Trigger, HTTP Request, Form Trigger +3
Social Media

This subworkflow is ideal for developers and automation builders working with UniPile and n8n to automate message enrichment and LinkedIn lead routing.

Execute Workflow Trigger, HTTP Request
Social Media

This workflow performs automated LinkedIn people search using the TexAU API. It is ideal for prospecting, recruitment, lead generation, and workflows where structured people-search results from Linked

HTTP Request, Execute Workflow Trigger
Social Media

This workflow automates the extraction of detailed LinkedIn profile information through the TexAU API. It is designed for lead enrichment, prospect research, hiring workflows, and any automation requi

Execute Workflow Trigger, HTTP Request
Social Media

03 - YouTube Publisher. Uses executeWorkflowTrigger, httpRequest. Event-driven trigger; 5 nodes.

Execute Workflow Trigger, HTTP Request