Extract and Structure X (Twitter) Post Comments using Airtop Automation - n8n Workflow

Automate X comment extraction using this powerful n8n workflow. Scrape author details, profiles, and comment text into structured JSON via the Airtop n8n node.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Marketing analysts and social media managers needing scaled engagement data.
Data scientists requiring structured X interaction data for large-scale analysis.
Users seeking advanced browser automation n8n templates for complex web scraping.
Anyone needing to monitor discussion context on specific X posts.

Overview

Manually collecting comments and user data from X (formerly Twitter) posts is an arduous, non-scalable task. This dedicated n8n workflow solves this by leveraging the powerful Airtop browser automation n8n node. This solution enables you to input a single X post URL and receive a standardized JSON output containing the comment author's name, their profile URL, and the full comment text, up to a specified maximum count.

This robust n8n automation provides structured data that is instantly ready for sentiment analysis, CRM integration, or business intelligence reporting, making it an essential n8n workflow for modern social listening and data extraction needs.

How it Works

This powerful n8n workflow begins with one of two potential n8n trigger mechanisms, designed for maximum flexibility.


  1. Input Collection: The process is initiated either via a user-friendly On form submission n8n trigger or by being called as a sub-workflow via the When Executed by Another Workflow n8n trigger. Both methods collect the X post URL, the Airtop Profile name, and the maximum number of comments to extract.

  2. Parameter Unification: The Unify params Set n8n node standardizes these inputs into consistent variable names, ensuring smooth data flow to the subsequent scraping step.

  3. Core Extraction: The Extract X Post Comments Airtop n8n node takes over. It initiates a headless browser session, navigates to the specified X URL, and executes a complex extraction prompt. This prompt, guided by a strict JSON Schema, dictates exactly what data to scrape (author name, URL, comment content) and ensures the output is perfectly structured.

  4. Data Structuring: Finally, the Edit Fields Set n8n node formats the extracted model response into the final, clean output structure, making the resulting data easily consumable by subsequent n8n nodes or systems. This complete n8n workflow provides highly accurate and structured social media data.

Installation Guide

To utilize this highly efficient n8n workflow, follow these setup steps:


  1. Import the n8n template: Copy the provided JSON code and import it directly into your n8n instance.

  2. Airtop Credentials: You must provide credentials for the Airtop n8n node. This requires an Airtop API Key.

  3. Airtop Profile Setup: Ensure you have an Airtop Profile configured and connected/logged into X (formerly Twitter). The name of this profile must be supplied as an input parameter when executing the workflow.

  4. Testing the n8n trigger: Execute the workflow either by running the On form submission n8n trigger or by calling the workflow via HTTP request/manual execution, providing a valid X URL, your Airtop profile name, and the desired comment limit.

Node Details

On form submission (n8n trigger): Acts as the primary public entry point for this n8n workflow. It collects three required parameters: 'X Post URL', 'Airtop Profile (connected to X)', and 'Max number of comments'.
When Executed by Another Workflow (n8n trigger): Provides an alternative n8n trigger, allowing this extraction logic to be integrated seamlessly into a larger parent n8n workflow.
Unify params (Set n8n node): Normalizes input keys (e.g., merging form labels with standard variable names) to ensure consistency before the Airtop n8n node executes.
Extract X Post Comments (Airtop n8n node): The core scraping engine. It is configured to perform an 'extraction' resource operation. Key configuration includes using dynamic expressions for the URL, profile name, and crafting a detailed prompt paired with a strict JSON schema for reliable, structured comment extraction. This n8n node handles the browser automation necessary to scroll and scrape comments.


  • Edit Fields (Set n8n node): Post-processing step. It extracts the structured response (data.modelResponse) from the Airtop output and promotes it to the top level, finalizing the structured data output of the n8n workflow.

Related n8n Workflows

Free

Nodes: 5 Nodes
Updated: December 26 2025
View all
Created by

Airtop provides an intelligent browser automation API for AI agents, enabling seamless web interaction, including login, navigation, and data extraction from any site, even those with complex authentication - all with natural language instructions.In simple terms, we allow you to automate anything humans can do online, on any site with just words

Featured*