Skip to main content

Post text and images to X using a simple form trigger

Workflow preview

Workflow preview
100%
Post text and images to X using a simple form trigger preview
Open on n8n.io

1. Workflow Overview

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 ...

Best for

  • Social Media automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.formtrigger, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.set, n8n-nodes-base.httprequest, n8n-nodes-base.manualtrigger

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Jesse Lane.

Original n8n.io source

1.1 Workflow description

Title
Post text and images to X using a simple form trigger
Workflow name
Post text and images to X using a simple form trigger

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 submission with required post text and an optional image upload.
  2. Validates and normalizes the input, enforcing supported image types (JPG/PNG/WEBP/GIF) and size limits.
  3. If no image is provided, creates a post on X via the X API v2 POST /2/tweets endpoint.
  4. If an image is provided, uploads the media to X via POST /2/media/upload, extracts the returned media ID, and creates the post with that media attached via POST /2/tweets.
  5. Returns a success response with the tweet ID and tweet URL, or a structured error message when X returns an API error.

Setup

  1. Create an X OAuth2 API credential with user-context scopes tweet.read tweet.write users.read offline.access media.write and apply it to all X HTTP requests in the workflow.
  2. Copy the public URL of the n8n form path x-content-scheduler-free and use it to open the “Post to X” form for publishing.
  3. (Optional) Run the manual connection test that calls GET /2/users/me to confirm the credential is connected to the correct X account.

Requirements

  • x.com api app oauth2 credentials (pay as you go)

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Form Submission Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Input Validation Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Invalid Input Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Image Upload Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Text Post Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Connection Test Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - When Form Submitted

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.5

Block 8 - Normalize Form Input

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - Check Input Validity

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 10 - Set Input Error Status

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 11 - Check If Image Exists

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 12 - Post New Tweet

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.4

Block 13 - Check Tweet Status

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 14 - Set Tweet Error Status

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 15 - Confirm Post Success

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 16 - Upload Image to X

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.4

Block 17 - Check Image Upload

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 18 - Set Media Upload Error

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 19 - Generate Media IDs

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 20 - Verify Media ID Availability

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 21 - Post Tweet With Media

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.4

Block 22 - Check Media Post Status

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 23 - Confirm Media Post Success

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 24 - Manual X Connection Test

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Showing the first 24 of 29 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Post text and images to X using a simple form trigger
Complexity advanced
Nodes 29
Categories Social Media
Author Jesse Lane
Published 21 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15899/15899.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Post text and images to X using a simple form trigger do?

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 ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Social Media use case.