N8N Tools - X (Twitter) Enhanced icon

N8N Tools - X (Twitter) Enhanced

Comprehensive X (Twitter) API v2 integration for N8N workflows

Overview

This node provides an enhanced integration with the X (formerly Twitter) API v2, allowing users to perform a wide range of Twitter-related actions within n8n workflows. Specifically for the Tweets resource and the Retweet Tweet operation, it enables users to retweet a specified tweet by its ID.

Common scenarios where this node is beneficial include:

  • Automating social media engagement by retweeting relevant tweets based on certain triggers or conditions.
  • Building workflows that amplify content by retweeting tweets from specific users or containing specific hashtags.
  • Integrating Twitter interactions into broader automation pipelines, such as marketing campaigns or customer support.

Practical example:

  • Automatically retweet tweets mentioning your brand or product to increase visibility.
  • Retweet tweets from a curated list of influencers or partners at scheduled intervals.

Properties

Name Meaning
Tweet ID The unique identifier of the tweet to retweet.
Include Private Metrics Whether to include private metrics in the response (requires elevated access).
Custom Fields Comma-separated list of additional custom fields to include in the response.
Custom Expansions Comma-separated list of expansions to include in the response for richer data.

Output

The node outputs JSON data representing the result of the retweet action. This typically includes details about the retweet event, such as confirmation of success and metadata related to the retweeted tweet.

If multiple items are processed, the output is an array of JSON objects corresponding to each input item.

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential for the "N8N Tools API" service to validate subscription and usage.
  • Requires OAuth2 or API credentials configured for accessing the Twitter API v2.
  • The node uses an internal helper class to interact with Twitter's API endpoints.

Troubleshooting

  • Invalid subscription or API key error: If you receive an error indicating invalid subscription or API key, verify that your API key credential for the external validation service is correct and active.
  • Twitter API errors: Errors returned from Twitter (e.g., invalid tweet ID, permission issues) will be surfaced. Ensure the tweet ID is valid and that the authenticated user has permission to retweet.
  • Rate limits: Twitter enforces rate limits; if exceeded, the node may fail. Consider adding error handling or delays in your workflow.
  • Missing required parameters: The "Tweet ID" property is mandatory. Omitting it will cause the node to throw an error.

Links and References

Discussion