X Block
Interact with X
The X block connects your workflow to the X (formerly Twitter) platform. Use it to post new tweets, read tweet details, search tweets with X's search operators, and fetch user profiles — bringing social media actions directly into your automations.
Overview
| Property | Value |
|---|---|
| Type | x |
| Category | tools |
| Color | #000000 |
When to Use
- Post a new tweet (optionally as a reply or with attached media) from a workflow
- Automatically respond to mentions or events by replying to a specific tweet ID
- Read the full details of a tweet, including conversation context and parent tweets
- Search recent tweets by keyword, hashtag, or advanced X search operators
- Filter tweet searches by time window and sort by recency or relevancy
- Look up a user's profile by username for enrichment or routing decisions
Configuration
Operation
Dropdown that selects what the block does. Defaults to x_write.
| Label | ID |
|---|---|
| Post a New Tweet | x_write |
| Get Tweet Details | x_read |
| Search Tweets | x_search |
| Get User Profile | x_user |
X Account (credential)
OAuth credential for the X account that will perform the operation. Select a connected X account from the dropdown. Requires the tweet.read, tweet.write, and users.read OAuth scopes.
Tweet Text (text)
Shown when operation is x_write. Required.
The text body of the tweet to post (up to 280 characters). Supports {{blockName.field}} references to use dynamic content from earlier blocks.
Reply To (replyTo)
Shown when operation is x_write. Optional.
ID of an existing tweet to reply to. Leave blank to post as a standalone tweet.
Media IDs (mediaIds)
Shown when operation is x_write. Optional.
Comma-separated list of media IDs to attach to the tweet (e.g. images or videos uploaded via the X media upload API).
Tweet ID (tweetId)
Shown when operation is x_read. Required.
ID of the tweet to fetch details for.
Include Replies (includeReplies)
Shown when operation is x_read. Optional.
Whether to include replies when reading a tweet. Options:
| Label | ID |
|---|---|
| true | true |
| false | false |
Defaults to false.
Search Query (query)
Shown when operation is x_search. Required.
Search terms for the tweet search. Supports all X search operators (e.g. from:user, #hashtag, -filter:retweets).
Max Results (maxResults)
Shown when operation is x_search. Optional.
Maximum number of tweets to return. Minimum enforced by the X API is 10; maximum is 100. Defaults to 10.
Sort Order (sortOrder)
Shown when operation is x_search. Optional.
How to order search results. Options:
| Label | ID |
|---|---|
| recency | recency |
| relevancy | relevancy |
Defaults to recency.
Start Time (startTime)
Shown when operation is x_search. Optional.
Earliest creation time for returned tweets, in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
End Time (endTime)
Shown when operation is x_search. Optional.
Latest creation time for returned tweets, in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
Username (username)
Shown when operation is x_user. Required.
The X username to look up, without the leading @ symbol.
Inputs & Outputs
-
Inputs:
operation(string) — Operation to performcredential(string) — X account credentialtext(string) — Tweet text contentreplyTo(string) — Reply to tweet IDmediaIds(string) — Media identifiers (comma-separated)poll(json) — Poll configurationtweetId(string) — Tweet identifierincludeReplies(boolean) — Include repliesquery(string) — Search query termsmaxResults(number) — Maximum search resultsstartTime(string) — Search start timeendTime(string) — Search end timesortOrder(string) — Result sort orderusername(string) — User profile nameincludeRecentTweets(boolean) — Include recent tweets
-
Outputs:
tweet(json) — Tweet data (write and read operations)replies(json) — Tweet repliescontext(json) — Tweet context (parent and root tweets in a thread)tweets(json) — Tweets data (search results array)includes(json) — Additional data (users, media, polls)meta(json) — Response metadata (result count, pagination tokens)user(json) — User profile datarecentTweets(json) — Recent tweets data for the looked-up user
Tools
- X Write (
x_write) — Posts new tweets, replies to existing tweets, or attaches media/polls. CallsPOST https://api.twitter.com/2/tweets. Returns the created tweet object including its ID, text, creation timestamp, and any attachment details. - X Read (
x_read) — Reads the full details of a specific tweet by ID, including conversation context such as parent and root tweets. CallsGET https://api.twitter.com/2/tweets/{id}with expansions. - X Search (
x_search) — Searches recent tweets using keywords, hashtags, or X search operators. Supports time-range filtering and sort order. CallsGET https://api.twitter.com/2/tweets/search/recent. Returns a list of matching tweets, associated user profiles, and pagination metadata. - X User (
x_user) — Fetches a user's public profile by username. Returns the user's ID, display name, bio, profile image URL, verification status, and public metrics (followers, following, tweet count). CallsGET https://api.twitter.com/2/users/by/username/{username}.
YAML Example
x_1:
type: x
name: "Post Tweet"
inputs:
operation: "x_write"
credential: "{{X_OAUTH_CREDENTIAL}}"
text: "{{generate_block.output}}"
replyTo: ""
mediaIds: ""
connections:
outgoing:
- target: next-block-id