Form-Based X/Twitter Poster
π Form-Based X/Twitter Poster (v2)
A user-friendly n8n workflow that enables users to submit tweets through a simple web form β with optional image, video, or GIF uploads β and posts them to a connected X/Twitter account. Designed for ease of use, this workflow handles both media and text-only posts, providing clear feedback upon submission.
π§ Overview
Workflow Name: Form-Based X/Twitter Poster (v2)
Goal: Provide a web form for users to create tweets, upload optional media, and post directly to X/Twitter.
π How It Works
-
Form Submission Trigger Node:** On form submission Type:** formTrigger Purpose:** Renders a web form for tweet creation. Fields:** Post Content: Required textarea for tweet text. Media: Optional file upload (.jpg, .png, .gif, .mp4, etc.). Button:** "Submit" Output:** JSON with text and binary media (if any).
-
Extract Media Details Node:** Extract Media Details Type:** code Purpose:** Extracts tweet text, checks for media, determines media type. Output Example:** { "content": "My tweet!", "mime_type": "image/jpeg", "media_type": "IMAGE" }
-
If Media Exists Node:** If Media Exists Type:** if Purpose:** Checks whether media was uploaded. True Path:** Media was uploaded. False Path:** No media uploaded.
-
Upload Media to X/Twitter (True path only) Node:** Upload Media (X) Type:** httpRequest Purpose:** Uploads media to Twitter via API v1.1. Media Category:** TWEET_IMAGE (can be customized) Auth:** Twitter OAuth1 API Output:** Includes media_id_string
-
Post Tweet with Media (True path) Node:** X Type:** twitter Purpose:** Posts tweet with uploaded media. Auth:** Twitter OAuth2 API
-
Post Text-Only Tweet (False path) Node:** X1 Type:** twitter Purpose:** Posts tweet without media. Auth:** Twitter OAuth2 API
-
Show Confirmation Message Node:** End Form Type:** form Purpose:** Displays thank-you message post-submission. Title:** Thank you so much for sharing your experience on X! π€ Message:** We truly appreciate your support and are so glad we could make a positive impact. Your words mean the world to us!
π How to Customize
Form Fields:** Change form title, labels, help texts, or file formats. Media Logic:** Add logic for distinguishing GIF vs VIDEO. Adjust media upload URL dynamically: https://upload.twitter.com/1.1/media/upload.json?media_category={{ $json.media_type === 'VIDEO' ? 'TWEET_VIDEO' : ($json.media_type === 'GIF' ? 'TWEET_GIF' : 'TWEET_IMAGE') }} Error Handling:** Add Error Trigger nodes to catch and manage failures gracefully. Tweet Text:** Customize tweet text with extra formatting or default content. Advanced Ideas:** Schedule tweets Post to multiple accounts Add content approval steps
π Required Credentials
-
Twitter OAuth1 API Used by:** Upload Media (X) Required for:** Media upload via v1.1 Credentials:** Consumer Key, Consumer Secret, Access Token, Access Token Secret Workflow Credential Name:** X OAuth - Akhil
-
Twitter OAuth2 API Used by:** X, X1 Required for:** Posting tweets Scopes:** tweet.read, tweet.write, users.read, offline.access Workflow Credential Name:** X OAuth2 - Akhil
π‘ Use Cases
Easy Tweet Tool:** For non-technical users to share content. Content Approval:** Internal review system before posting. Announcements:** Quickly broadcast updates. Campaign Posting:** Streamline recurring content sharing.
π§βπ» Node Naming Suggestions
| Old Name | Suggested Name | |--------------------|--------------------------| | If Image Exists | If Media Exists | | X | Post Tweet with Media | | X1 | Post Text-Only Tweet |
β€οΈ Made with love by Akhil using n8n
Related Templates
Track Demo Bookings with Google Calendar to Meta Conversions API Integration
Who is this workflow for? If you're using Meta Ads to generate new leads to your sales pipeline, this workflow is for yo...
Build a PDF-Based RAG System with OpenAI, Pinecone and Cohere Reranking
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. This workflow prov...
Reusable and Independently Testable Sub-workflow
Reusable and Independently Testable Sub-workflow This n8n workflow provides a standardized structure for building and te...
π Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments