Skip to main content

Extract and merge Twitter (X) threads using TwitterAPI.io

Workflow preview

Workflow preview
100%
Extract and merge Twitter (X) threads using TwitterAPI.io preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Twitter (X) Thread Fetcher: Extract and Merge Tweets from Threads What it does Thread Detection: Automatically detects whether the provided Twitter link is a single tweet or a thread. Tweet Extract...

Best for

  • Market Research automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.merge, n8n-nodes-base.manualtrigger, n8n-nodes-base.stickynote, n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.noop, n8n-nodes-base.function, n8n-nodes-base.httprequest, n8n-nodes-base.code

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by enes cingoz.

Original n8n.io source

1.1 Workflow description

Title
Extract and merge Twitter (X) threads using TwitterAPI.io
Workflow name
Extract and merge Twitter (X) threads using TwitterAPI.io

Twitter (X) Thread Fetcher: Extract and Merge Tweets from Threads

What it does

  • 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 Merging: Merges all tweets in the correct order to reconstruct the complete thread, filtering out any empty results.
  • Seamless Integration: Easily trigger this workflow from other n8n workflows to automate Twitter thread extraction from various sources.

How it works

  • Accepts a Twitter link as input-either a single tweet or a thread.
  • If the link is for a single tweet, fetches and returns the tweet content.
  • If the link is for a thread, fetches the first tweet, then iteratively retrieves all connected replies that form the thread, ensuring only relevant tweets are included.
  • Merges the first tweet and all subsequent thread tweets in order, filters out any empty results, and returns the complete thread.
  • Uses twitterapi.io for all Twitter API requests.

Set up steps

  • Setup typically takes just a few minutes. You’ll need to configure your Twitter API credentials for twitterapi.io.
  • You can trigger this workflow manually for testing or call it from another workflow to automate thread fetching from sources like Notion, spreadsheets, or other platforms.
  • For best results, create a separate workflow to gather Twitter links from your preferred source, then trigger this workflow to fetch and return the full thread.

> Detailed configuration instructions and node explanations are included as sticky notes within the workflow canvas.

Benefits

  • Light speed: Fetches a 15-tweet thread in just 3 seconds for rapid results.
  • Cost effective: Processes a 15-tweet thread for only $0.0027, making it highly affordable. (Cost may vary depending on the density of replies in the thread.)

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Merge first tweet and others

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.1

Block 2 - When clicking ‘Test workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 3 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - When Executed by Another Workflow

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 7 - No Operation, do nothing

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 8 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Extract Tweet ID and Username

Type / Role
n8n-nodes-base.function - function
Config choices
Version 1

Block 13 - Get first tweet

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 14 - Extract Conversation and Author ID

Type / Role
n8n-nodes-base.function - function
Config choices
Version 1

Block 15 - Merge all tweet infos

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.1

Block 16 - Get Tweet Replies

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 17 - Fetch tweets which are connected to first tweet

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 18 - Filter empty ones

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

3. Summary Table

Workflow Extract and merge Twitter (X) threads using TwitterAPI.io
Complexity advanced
Nodes 18
Categories Market Research
Author enes cingoz
Published 15 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4088/4088.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Extract and merge Twitter (X) threads using TwitterAPI.io do?

Twitter (X) Thread Fetcher: Extract and Merge Tweets from Threads What it does Thread Detection: Automatically detects whether the provided Twitter link is a single tweet or a thread. Tweet Extract...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Market Research use case.