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.
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.
On form submissionformTriggerNode: 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 ExistsifUpload Media (X)httpRequestTWEET_IMAGE (can be customized)Twitter OAuth1 APImedia_id_stringXtwitterTwitter OAuth2 APIX1twitterTwitter OAuth2 APIEnd FormformThank you so much for sharing your experience on X! 🖤We truly appreciate your support and are so glad we could make a positive impact. Your words mean the world to us!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:
Upload Media (X)X OAuth - AkhilX, X1tweet.read, tweet.write, users.read, offline.accessX OAuth2 - Akhil| Old Name | Suggested Name |
|---|---|
| If Image Exists | If Media Exists |
| X | Post Tweet with Media |
| X1 | Post Text-Only Tweet |