Back to Integrations
integrationWebhook node
integrationX (Formerly Twitter) node

Webhook and X (Formerly Twitter) integration

Save yourself the work of writing custom integrations for Webhook and X (Formerly Twitter) and use n8n instead. Build adaptable and scalable Development, Core Nodes, and Marketing workflows that work with your technology stack. All within a building experience you will love.

How to connect Webhook and X (Formerly Twitter)

  • Step 1: Create a new workflow
  • Step 2: Add and configure nodes
  • Step 3: Connect
  • Step 4: Customize and extend your integration
  • Step 5: Test and activate your workflow

Step 1: Create a new workflow and add the first step

In n8n, click the "Add workflow" button in the Workflows tab to create a new workflow. Add the starting point – a trigger on when your workflow should run: an app event, a schedule, a webhook call, another workflow, an AI chat, or a manual trigger. Sometimes, the HTTP Request node might already serve as your starting point.

Webhook and X (Formerly Twitter) integration: Create a new workflow and add the first step

Step 2: Add and configure Webhook and X (Formerly Twitter) nodes

You can find Webhook and X (Formerly Twitter) in the nodes panel. Drag them onto your workflow canvas, selecting their actions. Click each node, choose a credential, and authenticate to grant n8n access. Configure Webhook and X (Formerly Twitter) nodes one by one: input data on the left, parameters in the middle, and output data on the right.

Webhook and X (Formerly Twitter) integration: Add and configure Webhook and X (Formerly Twitter) nodes

Step 3: Connect Webhook and X (Formerly Twitter)

A connection establishes a link between Webhook and X (Formerly Twitter) (or vice versa) to route data through the workflow. Data flows from the output of one node to the input of another. You can have single or multiple connections for each node.

Webhook and X (Formerly Twitter) integration: Connect Webhook and X (Formerly Twitter)

Step 4: Customize and extend your Webhook and X (Formerly Twitter) integration

Use n8n's core nodes such as If, Split Out, Merge, and others to transform and manipulate data. Write custom JavaScript or Python in the Code node and run it as a step in your workflow. Connect Webhook and X (Formerly Twitter) with any of n8n’s 1000+ integrations, and incorporate advanced AI logic into your workflows.

Webhook and X (Formerly Twitter) integration: Customize and extend your Webhook and X (Formerly Twitter) integration

Step 5: Test and activate your Webhook and X (Formerly Twitter) workflow

Save and run the workflow to see if everything works as expected. Based on your configuration, data should flow from Webhook to X (Formerly Twitter) or vice versa. Easily debug your workflow: you can check past executions to isolate and fix the mistake. Once you've tested everything, make sure to save your workflow and activate it.

Webhook and X (Formerly Twitter) integration: Test and activate your Webhook and X (Formerly Twitter) workflow

Explore n8n nodes in a visual reference library

WATCH THE n8n STARTER GUIDE 👇

This template is featured in the n8n Starter Guide series. The template is free, but comes with two additional PDFs and a Quick Start video if you grab the full download pack on gumroad.

How it works

This template is a visual map of many useful n8n nodes. It groups nodes like Triggers, AI tools, and App connectors onto the canvas. Explore the sections to learn about different nodes and easily copy them for your own workflows. It acts as a handy visual reference guide.

Set up steps

• Setup takes about 5 minutes.
• Import the template into your n8n instance.
• Explore the node categories visually on the canvas.
• A Quick Start video is included in the download pack, along with a prompts PDF and PDF with links to other awesome n8n templates here on the n8n template gallery.

Nodes used in this workflow

Popular Webhook and X (Formerly Twitter) workflows

+43

Explore n8n Nodes in a Visual Reference Library

WATCH THE n8n STARTER GUIDE 👇 This template is featured in the n8n Starter Guide series. The template is free, but comes with two additional PDFs and a Quick Start video if you grab the full download pack on gumroad. How it works This template is a visual map of many useful n8n nodes. It groups nodes like Triggers, AI tools, and App connectors onto the canvas. Explore the sections to learn about different nodes and easily copy them for your own workflows. It acts as a handy visual reference guide. Set up steps • Setup takes about 5 minutes. • Import the template into your n8n instance. • Explore the node categories visually on the canvas. • A Quick Start video is included in the download pack, along with a prompts PDF and PDF with links to other awesome n8n templates here on the n8n template gallery.
+2

Automate Blog-to-Social Media with GPT-4 for LinkedIn, X, and Reddit

Turn your blog into a set-and-forget content engine: every new article is instantly repurposed into channel-specific social posts with visuals, keeping your brand visible on LinkedIn, X, and Reddit without extra copywriting time. Perfect for lean marketing teams who want consistent, always-on distribution from a single source of content. How it works • Watches your blog RSS feed (or receives a single URL) and detects new articles. • Saves each post in Postgres so every article is only processed once. • Fetches the article HTML, extracts the main body content and sends it to OpenAI (GPT-4.1). • OpenAI creates platform-optimized copy: 1 LinkedIn post, 1 X/Twitter post, 1 Reddit post + image prompts. • Generates on-brand images with OpenAI and publishes everything automatically to LinkedIn, X, and Reddit. • You can also trigger it manually or via webhook whenever you want to push a specific campaign. Setup Steps • Time: around 20–40 minutes for someone familiar with n8n and the platforms. • Create a Postgres table “rss_items” with fields: guid (PRIMARY KEY), title, link, published_at. • Add credentials in n8n for: – Postgres – OpenAI – LinkedIn OAuth2 – X/Twitter OAuth2 + OAuth1 (for media upload) – Reddit OAuth2 • In the RSS node, set your blog feed URL (for example: https://yourblog.com/feed). • In the webhook node, confirm the URL/path you want external tools or other workflows to call with a “link” field. • Run the manual trigger with one test blog URL to verify: – Article content is extracted correctly. – AI returns LinkedIn/X/Reddit posts and image prompts. – Posts and images appear correctly on all social accounts. • Once tests look good, enable the Schedule Trigger so Blog2Social AI runs automatically at your chosen interval.

Create and post AI social captions from WordPress blogs to Facebook, Instagram, X, and LinkedIn with GPT-4o via OpenRouter

Every time you publish a blog post on WordPress, this workflow automatically creates unique, platform-optimised captions for Facebook, Instagram, Twitter and LinkedIn — and publishes them all simultaneously without any manual effort. Built for content creators, digital marketing agencies, SEO agencies, bloggers, and businesses that publish blog content regularly and want to maximise reach across social media without spending hours manually writing different versions for each platform. The Problem This Solves Most businesses publish a blog post and then either copy and paste the same text to every social media platform — which performs poorly because each platform has different audience expectations, character limits, tone and algorithm preferences — or they skip social media promotion entirely because writing four different captions for one post takes too much time. The result is wasted content. Hours of writing a great blog post go unnoticed because the distribution is manual, inconsistent, or nonexistent. This workflow solves that completely. One WordPress publish triggers everything. The AI writes platform-specific captions that actually match how each platform works. Every post gets promoted everywhere automatically. How It Works Step 1 — WordPress Webhook Trigger The workflow starts the instant you publish a post on WordPress. This requires a webhook plugin installed on your WordPress site — the recommended free option is WP Webhooks (available on WordPress.org plugin directory). When you publish or update a post to published status, WP Webhooks sends a POST request to your n8n webhook URL with the full post data including title, content, permalink, thumbnail URL, and post type. No polling. No scheduled checks. The workflow fires in real time the moment your post goes live. Step 2 — Post Type and Status Filter Before any processing happens, the workflow checks two conditions: The post type must be post (not page, product, or custom post type) The post status must be publish (not draft, pending, or scheduled) This ensures the workflow only runs for actual published blog posts and ignores everything else — drafts, page updates, WooCommerce products, and any other WordPress content types. Step 3 — HTML to Markdown Conversion WordPress post content arrives as raw HTML with tags, shortcodes, and formatting markup. Before sending this to an AI model, the workflow converts the HTML content to clean Markdown text using the built-in Markdown node. This removes HTML tags, cleans up formatting, and gives the AI clean, readable text that produces significantly better caption quality than feeding raw HTML. Step 4 — Data Normalization A Set node extracts and organises all the data needed for the rest of the workflow into clean variables: post_title — the blog post title post_content — the cleaned Markdown content post_link — the full permalink URL to the published post post_thumbnail — the featured image URL used for visual posts on Facebook and Instagram facebook_page_id — your Facebook Page ID for the Graph API call instagram_id — your Instagram Business Account ID for the Graph API call Step 5 — AI Caption Generator An AI agent powered by OpenRouter (GPT-4o) reads the post title, link, and the first 800 characters of the post content, then generates four completely different captions — one for each platform — in a single API call. Each caption is written according to strict platform-specific guidelines: Twitter/X caption: Maximum 220 characters. One punchy insight or hook from the post. One to two hashtags only. Ends with the post link. Short, direct, and conversational. Facebook caption: Starts with a bold question or statement. Three to five bullet points of what readers will learn. Ends with the post link. Friendly and conversational tone. Maximum three hashtags. Instagram caption: Opens with a bold hook in the first 125 characters to survive the truncation. Three to five key takeaways as short bullet points. Ends with "Link in bio to read the full guide." Three to five relevant hashtags. Does not include the URL in the body since Instagram does not make links clickable in captions. LinkedIn caption: Professional tone throughout. Hook or surprising statement to open. Three to four short paragraphs covering the problem, what the post covers, the key insight, and a call to action with the link. Two to three professional hashtags. Between 800 and 1200 characters total for maximum LinkedIn algorithmic reach. The output is enforced as strict JSON via a Structured Output Parser — ensuring reliable, parseable data for the downstream publishing nodes every time. Step 6 — Simultaneous Publishing to All Platforms After caption generation, the workflow publishes to all four platforms in parallel: Twitter/X: The Twitter node posts the caption directly using OAuth2 authentication. No additional steps required. Facebook: An HTTP Request node calls the Facebook Graph API /{page_id}/photos endpoint, sending the Facebook caption as the message and the WordPress featured image URL as the photo. This creates a photo post with the caption on your Facebook Page, which performs significantly better than link-only posts in terms of reach and engagement. Instagram: Instagram publishing requires two steps as per the official Meta Graph API requirements. First, an HTTP Request node calls /{instagram_id}/media to create a media container with the caption and featured image URL. Second, another HTTP Request node calls /{instagram_id}/media_publish with the container ID returned from the first step. This is the official two-step publishing flow required by Meta. LinkedIn: The thumbnail image is first downloaded via an HTTP Request node (LinkedIn requires binary image data, not just a URL). Then the LinkedIn node creates a post using the downloaded image binary along with the LinkedIn caption. The post is published to your company organisation page using OAuth2 authentication. WordPress Plugin Required This workflow requires a webhook plugin installed on your WordPress site to send post data to n8n when a post is published. Recommended: WP Webhooks (Free) Available at wordpress.org/plugins/wp-webhooks After installing WP Webhooks on your WordPress site: Go to Settings → WP Webhooks in your WordPress dashboard Click Send Data tab Add a new webhook Select trigger: Post Published or Post Updated Paste your n8n webhook URL as the delivery URL Save and test The plugin will send a POST request to n8n with the full post data every time you publish a blog post. Alternative options: WPBrutha Webhooks Bit Integrations (free plugin with webhook sending) Custom code using WordPress transition_post_status hook if you prefer a code-based approach Payload Structure Your n8n webhook node expects this data structure from WordPress: { "post": { "post_title": "Your Blog Post Title", "post_content": "Your full HTML post content", "post_type": "post", "post_status": "publish" }, "post_permalink": "https://yoursite.com/your-post-slug/", "post_thumbnail": "https://yoursite.com/wp-content/uploads/featured-image.jpg" } The exact field names depend on which WordPress webhook plugin you use. Adjust the Set node field mappings to match the payload structure sent by your chosen plugin. Requirements WordPress website with admin access WP Webhooks plugin (free) or any WordPress webhook plugin installed and configured n8n instance (self-hosted or cloud) with a publicly accessible webhook URL OpenRouter API key (supports GPT-4o, Claude, Gemini, and 200+ other models) Twitter/X Developer account with OAuth2 app credentials Facebook Page with a System User token from Meta Business Portfolio or a long-lived Page Access Token Instagram Business Account connected to your Facebook Page via Meta Business Portfolio LinkedIn Company Page with OAuth2 app credentials Setup Steps Install and activate WP Webhooks on your WordPress site Copy the n8n webhook URL from the Webhook node in this workflow Configure WP Webhooks to send to your n8n webhook URL on post publish Add your OpenRouter API key to n8n credentials Connect your Twitter/X OAuth2 credentials in the Create Tweet node Add your Facebook Page Access Token or System User Token to the HTTP Query Auth credential used in Post on FB node Add the same token to the Instagram nodes — Create Media Container and Post On IG Update the facebook_page_id value in the Clean Data node with your actual Facebook Page ID Update the instagram_id value in the Clean Data node with your actual Instagram Business Account ID Connect your LinkedIn OAuth2 credentials in the Create a post node Update the LinkedIn organisation URN in the Create a post node with your actual company page URN Publish a test post on WordPress and verify all four platforms receive their posts Customization Options Change the AI model** — swap GPT-4o for any OpenRouter model including Claude Sonnet, Gemini Flash, or Mistral to reduce cost per run Adjust caption length and style** — edit the platform guidelines in the system prompt to match your brand voice or preferred posting style Add more platforms** — extend the workflow with TikTok, Pinterest, Threads, or YouTube community posts by adding nodes after the AI Agent Filter by category or tag** — add an IF node after the filter to only trigger for posts in specific WordPress categories Add a delay between platforms** — add Wait nodes between publishing steps if you prefer staggered posting Schedule posts instead of immediate publishing** — replace the direct publishing nodes with a scheduling tool like Postiz or Buffer API Content length control** — the AI currently reads the first 800 characters of post content. Increase or decrease this slice in the user prompt to give the AI more or less context Language support** — the AI will match the language of your blog post automatically. Write in Urdu, Arabic, French, or any other language and captions will be generated in the same language Use Cases SEO and digital marketing agencies** promoting client blog content across all platforms automatically Bloggers and content creators** who publish regularly and want consistent social media presence without manual effort ecommerce businesses** promoting product guides, how-to articles, and SEO content SaaS companies** distributing thought leadership content and product updates Local businesses** sharing informative blog posts about their services News and media sites** distributing articles to social audiences in real time Nodes Used Webhook — receives WordPress post data on publish IF — filters for published blog posts only Markdown — converts HTML post content to clean text Set — normalizes and extracts post data into clean variables AI Agent (LangChain) — generates four platform-specific captions simultaneously Structured Output Parser — enforces JSON output from the AI agent OpenRouter Chat Model — powers the AI caption generation Twitter node — publishes to Twitter/X HTTP Request (Facebook) — posts photo with caption to Facebook Page via Graph API HTTP Request (Instagram container) — creates Instagram media container via Graph API HTTP Request (Instagram publish) — publishes Instagram container to feed HTTP Request (LinkedIn image) — downloads featured image binary for LinkedIn LinkedIn node — publishes image post to LinkedIn company page Built with Meta Graph API v25.0, OpenRouter, Twitter API v2, and LinkedIn API. Compatible with any WordPress site running version 4.7 or above with the WordPress REST API enabled.
+3

Repurpose LinkedIn posts into X tweets with Apify, Claude AI and Airtable

Automatically scrape LinkedIn posts with Apify, transform them into optimized tweets and threads using Claude AI, store them in Airtable for approval, and publish to X on a daily schedule. Who is this for This workflow is designed for content creators, social media managers, and personal brand builders who want to maximize their content reach by repurposing LinkedIn posts for X (Twitter) without manual rewriting. What it does This workflow automates the entire LinkedIn-to-X content repurposing pipeline: Weekly scraping: Uses Apify to scrape your recent LinkedIn posts based on configurable parameters stored in Airtable Carousel extraction: If a post contains a carousel/PDF, OpenAI extracts the slide content via OCR AI transformation: Claude (via OpenRouter) converts each LinkedIn post into two X-optimized variations: a standalone tweet and a thread (3-7 tweets) Content storage: Saves both the original posts and generated tweets to Airtable with a "Pending" status for review Scheduled publishing: Daily at 12:30, searches for ‘Approved’ tweets whose publication date has passed and posts them to X Thread handling: Properly chains thread tweets as replies to maintain the conversation structure Requirements Apify account (LinkedIn Profile Posts Scraper actor) Airtable account with configured base OpenAI API access (for carousel OCR) OpenRouter API access (for Claude) X/Twitter API access How to set up Create an Airtable base with three tables: Config, LK Posts, and X Tweets (see table configurations below) Configure the Config table with your LinkedIn profile URL, scraping limits, and tweet scheduling delay Configure the ‘TWEET NOW’ button in Airtable with the following URL formula: Connect your credentials: Apify, Airtable, OpenAI, OpenRouter, and X/Twitter Set the weekly and daily schedule triggers according to your timezone Activate the workflow Config Table | Field Name | Type | Description | |------------|------|-------------| | Name | String | Configuration parameter name | | Type | Single Select | Data type indicator: String, Integer | | String Value | String | Value when Type is "String" | | Integer Value | Number | Value when Type is "Integer" | Configuration parameters to create: profile_url — LinkedIn profile URL to scrape posted_limit — Time range for scraping (possible values: "any", "1h", "24h", "week", "3months", "6months", "year") max_posts — Maximum number of posts to scrape schedule_tweets_days_after_lk — Number of days after LinkedIn post date to schedule the tweet LK Posts Table | Field Name | Type | Description | |------------|------|-------------| | LK Post ID | String | LinkedIn post unique identifier | | Status | Single Select | Post processing status: Scrapped, Converted, Tweeted | | Date | DateTime | Original LinkedIn post publication date | | Content | Long Text | LinkedIn post text content | | Post URL | URL | Link to the original LinkedIn post | | Post Img URL | URL | URL of post image (if any) | | Post Doc URL | URL | URL of carousel/PDF document (if any) | | Carousel Content | Long Text | Extracted text content from carousel slides | X Tweets Table | Field Name | Type | Description | |------------|------|-------------| | Unique ID | Formula | Auto-generated unique identifier | | LK Post ID | String | Reference to the source LinkedIn post | | Status | Single Select | Tweet status: Pending, Approved, Rejected, Tweeted | | Variation | Single Select | Tweet format: Standalone, Thread | | Tweet Nb | Number | Tweet position in thread (0 for standalone, 1-7 for thread tweets) | | Content | Long Text | The tweet text content | | Publication Date | DateTime | Scheduled date/time to publish the tweet | | Post Now | Button | Triggers webhook to post immediately | How to customize AI prompt: Edit the "ConvertPostIntoTweets" node to adjust tone and style LLM model: Replace the OpenRouter node with OpenAI or any other LLM node in "ConvertPostIntoTweets" if you prefer a different model Posting delay: Change schedule_tweets_days_after_lk in the Config table Schedule: Modify "Weekly_OnSunday" and "Daily_AtNoon" triggers Scraping: Adjust max_posts and posted_limit in Config table
+4

Repurpose YouTube videos into blogs and social posts with GPT-4o, WordPress, LinkedIn, X and Instagram

Overview This workflow turns a single YouTube video into multiple content formats and publishes them across different platforms with an optional human approval step. It helps content creators, marketers, and agencies repurpose long-form video content into blog posts and social media updates automatically. How it works Fetches the transcript from a YouTube video Uses AI to generate blog and social media content Optionally waits for manual approval Publishes content to selected platforms Logs the result for tracking Setup steps Add your API credentials (AI, transcript, and social platforms) Paste a YouTube video URL Choose auto-publish or approval mode Run the workflow Use cases Content repurposing for YouTube creators Automated blog and social media publishing Marketing automation for agencies AI-assisted content production pipelines 🧑‍💻 Creator Information Developed by: Adem Tasin 🌐 Website: ademtasin.com 💼 LinkedIn: Adem Tasin
+2

Schedule and optimize Twitter and LinkedIn posts from Google Sheets with OpenAI GPT-4o-mini

Schedule and optimize social media posts to Twitter and LinkedIn using AI This workflow automates the entire lifecycle of social media management—from fetching draft content to AI-driven optimization and multi-platform publishing. Who’s it for Social media managers, marketing teams, and content creators who use Google Sheets to plan their content but want to leverage AI for better engagement and automate the repetitive task of cross-platform posting. How it works The workflow is triggered either hourly or manually via a webhook. It fetches scheduled content from a designated Google Sheet and identifies posts ready for publication. An AI Agent (OpenAI) then analyzes the raw content to generate two optimized versions: a punchy, character-limited post for Twitter and a more professional, detailed version for LinkedIn. After generating relevant hashtags and engagement tips, the workflow publishes the posts simultaneously. Finally, it logs the live URLs back to your spreadsheet and sends a performance summary to a Slack channel for easy tracking. How to set up Google Sheet: Create a sheet with columns for status, content, platforms, scheduled_time, hashtags, and tone. Credentials: Connect your Google Sheets, OpenAI, Twitter (X), LinkedIn, and Slack accounts. Node Configuration: Select your specific spreadsheet and worksheet in both the "Fetch Content" and "Update Content" nodes. Slack: Specify the channel name or ID in the Slack node to receive notifications. Activation: Test with the Manual Webhook, then toggle the workflow to "Active." Requirements Google Sheets OAuth2** OpenAI API Key** (using GPT-4o-mini or higher) Twitter (X) OAuth2** LinkedIn OAuth2** Slack Bot Token** How to customize the workflow AI Tone**: Modify the "System Message" in the AI Content Optimizer node to match your brand's unique voice. Additional Platforms**: Extend the branching logic after the AI Parse node to include platforms like Discord, Facebook, or Mastodon. Advanced Scheduling**: Adjust the Filter node's JavaScript code if you use a different date format or status labels in your spreadsheet.

Build your own Webhook and X (Formerly Twitter) integration

Create custom Webhook and X (Formerly Twitter) workflows by choosing triggers and actions. Nodes come with global operations and settings, as well as app-specific parameters that can be configured. You can also use the HTTP Request node to query data from any app or service with a REST API.

X (Formerly Twitter) supported actions

Create
Send a direct message to a user
Add Member
Add a member to a list
Create
Create, quote, or reply to a tweet
Delete
Delete a tweet
Like
Like a tweet
Retweet
Retweet a tweet
Search
Search for tweets from the last seven days
Get
Retrieve a user by username

Webhook and X (Formerly Twitter) integration details

integrationWebhook node
Webhook

Webhooks are automatic notifications that apps send when something occurs. They are sent to a certain URL, which is effectively the app's phone number or address, and contain a message or payload. Polling is nearly never quicker than webhooks, and it takes less effort from you.

Use case

Save engineering resources

Reduce time spent on customer integrations, engineer faster POCs, keep your customer-specific functionality separate from product all without having to code.

Learn more
Use case

Automate lead management

Using too many marketing tools? n8n lets you orchestrate all your apps into one cohesive, automated workflow.

Learn more

FAQs

  • Can Webhook connect with X (Formerly Twitter)?

  • Can I use Webhook’s API with n8n?

  • Can I use X (Formerly Twitter)’s API with n8n?

  • Is n8n secure for integrating Webhook and X (Formerly Twitter)?

  • How to get started with Webhook and X (Formerly Twitter) integration in n8n.io?

Need help setting up your Webhook and X (Formerly Twitter) integration?

Discover our latest community's recommendations and join the discussions about Webhook and X (Formerly Twitter) integration.
Benjamin Hatton
Albert Ashkhatoyan
Víctor González
Salomão
sg tech

Looking to integrate Webhook and X (Formerly Twitter) in your company?

Over 3000 companies switch to n8n every single week

Why use n8n to integrate Webhook with X (Formerly Twitter)

Build complex workflows, really fast

Build complex workflows, really fast

Handle branching, merging and iteration easily.
Pause your workflow to wait for external events.

Code when you need it, UI when you don't

Simple debugging

Your data is displayed alongside your settings, making edge cases easy to track down.

Use templates to get started fast

Use 1000+ workflow templates available from our core team and our community.

Reuse your work

Copy and paste, easily import and export workflows.

Implement complex processes faster with n8n

red iconyellow iconred iconyellow icon