- Home
- Resources
- Integrations
- X (Formerly Twitter)
X n8n integrationAutomate X (Formerly Twitter) with n8n.
How far can a workflow run an X account on its own? The X n8n integration exposes 8 operations across 4 resources: tweets, direct messages, lists and users. No trigger node, the block that starts a workflow, listens to X, so the run begins elsewhere and then posts, searches or likes on demand.
Verified Trustpilot reviews · AI, automation & growth agency
What does the X n8n integration actually cover?
The X n8n integration is the node shipped with n8n that talks to the X API, the programmatic door into the network, on behalf of one connected account. It publishes and deletes tweets, likes and retweets them, searches public posts from the last seven days, sends direct messages, adds a member to a list and looks up a user by handle. Eight operations, four resources, one OAuth2 credential, the connection saved once in n8n and reused in every workflow.
Start with the publishing side. A workflow that reads an editorial calendar in Google Sheets, keeps the rows due today and runs tweet.create on each one turns a spreadsheet into a posting queue. The same shape works from a CMS: when an article goes live in Wordpress, the workflow assembles the announcement and publishes it, with the article URL in the Text field.
The second use is listening. tweet.search pulls public tweets from the last seven days that match a query, on whatever rhythm you set, and the result can land anywhere: one row per mention in a sheet, a message in Slack for whoever is on duty, or a filter that keeps only what deserves an answer. Since the node also likes and retweets, the same run can react instead of only reporting.
The third is curation. user.searchUser resolves a handle into the account behind it, list.add drops that account into a list, and directMessage.create opens a private conversation when a public reply is the wrong place for it. That trio keeps a list of customers, speakers or competitors current without anyone opening the app.
Everything else goes through HTTP Request. The node stops at 8 operations over 4 resources, and the X API is wider than that. When an endpoint is missing, meaning a specific address of the API, the HTTP Request node calls it directly and reuses the same X credential through predefined authentication, so the workflow keeps a single connection.
Two limits are worth knowing before building. There is no X trigger node, so every workflow starts with another kind of start block, and search never reaches further back than seven days. Ready-made templates pair X with Google Sheets, Wordpress and LinkedIn for multi-channel publishing, the n8n review covers what the platform does well and where it hurts, and the n8n training goes through credentials, expressions and error handling.
How do you connect X to n8n?
- 01
Create an app in the X developer portal
An X developer account comes first, then a project in the developer portal. On the project's Overview tab, find the Apps section and select Add App, give the app a name and continue. The default project and app created at sign-up work just as well. This app is what n8n presents to X when it authenticates.
- 02
Set the permissions and the callback URL
In User authentication settings, select Set Up. Pick Read and write and Direct message as the app permissions if you want every function of the node, then Web App, Automated App or Bot as the type of app. Copy the OAuth Redirect URL shown by n8n, paste it into Callback URI / Redirect URL, add a Website URL and save.
- 03
Paste the keys into an n8n credential
X then displays a Client ID and a Client Secret. Both go into the matching fields of the X credential in n8n, which runs on OAuth2; the older OAuth 1.0a method has been deprecated since version
0.236.0and the V2 node. A credential is created once in the Credentials menu, and every workflow then finds it in the node's dropdown.
What the X node can do, operation by operation
The X (Formerly Twitter) node exposes 8 operations across 4 resources. For each one: the node as you configure it in n8n, the required fields, and our field notes.
| Resource | Create | Delete | Add Member | Like | Retweet | Search | Get |
|---|---|---|---|---|---|---|---|
| Direct Message | ✓ | ||||||
| List | ✓ | ||||||
| Tweet | ✓ | ✓ | ✓ | ✓ | ✓ | ||
| User | ✓ |
Operations index
Direct Message
1 operationCreate Direct Message
directMessage.createWhat you see in n8n
Notes & use cases
A direct message leaves the connected account and reaches one recipient privately, without ever showing on the timeline.
Key parameters
- User: the recipient, chosen in the list or set from an expression such as
{{ $json.author_id }}when the account comes out of an earlier search. - Text: the body of the message, URL encoded, with a ceiling of
10000characters. - Attachment ID: optional, under Additional Fields, to associate an attachment with the message.
List
1 operationAdd Member to List
list.addWhat you see in n8n
Notes & use cases
Lists gather accounts into a timeline of their own, and this operation puts one account inside one of them.
Key parameters
- List: the list receiving the member, picked among the account's lists or given by its identifier.
- User: the account to add, by handle or by ID, often
{{ $json.id }}inherited from a Get User step.
Tweet
5 operationsCreate Tweet
tweet.createWhat you see in n8n
Notes & use cases
Three outcomes hide behind a single operation: a plain post, a quote, or a reply. The option you fill in is what settles it.
Key parameters
- Text: the status update itself. URLs have to be encoded, and links wrapped by the t.co shortener still weigh on the character count.
- Reply to Tweet: points at the tweet being answered, which turns the post into a reply.
- Quote a Tweet: hooks the quoted tweet under the new text instead.
- Media ID and Location ID: attach a media item, or tie the post to a place.
Delete Tweet
tweet.deleteWhat you see in n8n
Notes & use cases
Taking a post down has its own operation, and it works from the tweet identifier, never from its text.
Key parameters
- Tweet: the tweet to remove, selected in the list or passed as an ID, for instance
{{ $json.id }}carried over from a search result.
Like Tweet
tweet.likeWhat you see in n8n
Notes & use cases
One field, one public signal: the connected account likes the tweet you point it at.
Key parameters
- Tweet: the tweet to like, chosen in the list or taken from the incoming item, which makes it easy to chain right after a search.
Retweet Tweet
tweet.retweetWhat you see in n8n
Notes & use cases
Sharing someone else's post with the connected account's audience happens here. Same single field as Like, different effect: the tweet shows up again on the account's own timeline.
Key parameters
- Tweet: the tweet to retweet, by ID or from the list, usually the item a filter step has just validated.
Search Tweets
tweet.searchWhat you see in n8n
Notes & use cases
The only read operation on tweets returns public posts from the last seven days, one item per tweet.
Key parameters
- Search Term: the query, UTF-8 and URL encoded, 500 characters maximum, operators included.
- Return All: on, n8n walks the pages to the last tweet; off, Limit caps how many items come back.
- Sort Order:
recencyfor the newest first,relevancyfor the closest match. - After and Before: the date window, which has to stay inside the last 7 days without Academic Research access.
- Tweet Fields: adds fields to each tweet returned, beyond the default ID, text and edit history.
User
1 operationGet User
user.searchUserWhat you see in n8n
Notes & use cases
Handles are what people share; the rest of the node works on the account behind them. This operation bridges the two.
Key parameters
- User: the account to retrieve, chosen in the list or built from a handle collected earlier in the workflow.
- Me: switched on, it returns the authenticated account, which is handy to check which account the credential really opens.
Need help automating X (Formerly Twitter) with n8n?
A person reads every message.

