Post text and images to X using a simple form trigger
Ready for 3.0What this workflow does
This workflow has 22 nodes and runs when someone submits an n8n form (“Post to X”) (plus 1 other trigger). It uses only n8n's built-in nodes. It also calls api.x.com over HTTP.
How it runs
Trigger: When someone submits an n8n form (“Post to X”) (plus 1 other trigger).
- Normalize Form Input (Code): runs custom JavaScript code
- Fetch X User Info (HTTP Request): calls api.x.com
- Check Input Validity (If): checks a condition and branches into true / false
- Check Test Outcome (If): checks a condition and branches into true / false
- Check If Image Exists (If): checks a condition and branches into true / false
- Set Input Error Status (Edit Fields (Set)): sets 3 fields: success, error_code, error_message
- Record Test Error (Edit Fields (Set)): sets 3 fields: success, error_code, error_message
- Record Test Success (Edit Fields (Set)): sets 3 fields: success, username, name
- Upload Image to X (HTTP Request): calls api.x.com (POST)
- Post New Tweet (HTTP Request): calls api.x.com (POST)
…plus 10 more steps. See the full node list below.
HTTP calls to: api.x.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (6)
- n8n Form Trigger
n8n-nodes-base.formTrigger - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Edit Fields (Set)
n8n-nodes-base.set - HTTP Request
n8n-nodes-base.httpRequest - Manual Trigger
n8n-nodes-base.manualTrigger
From the author
Quick overview This workflow uses an n8n Form trigger and the X (Twitter) API to publish a text-only post or a post with a single uploaded image, then returns a success/error payload including the resulting tweet URL. How it works 1. Receives a form…