N8N Tools - X (Twitter) Enhanced icon

N8N Tools - X (Twitter) Enhanced

Comprehensive X (Twitter) API v2 integration for N8N workflows

Overview

The node provides enhanced integration with the X (formerly Twitter) API v2, allowing users to perform a wide range of operations on Twitter resources within n8n workflows. Specifically, for the Media resource and the Create Media Metadata operation, this node enables users to add metadata such as alt text and sensitive media warnings to existing media items on Twitter. This is useful for improving accessibility by providing descriptive alternative text or flagging media content that may be sensitive.

Practical scenarios include:

  • Adding alt text descriptions to images or videos uploaded to Twitter to improve accessibility for visually impaired users.
  • Attaching sensitive media warnings to media content that might require viewer discretion.

Properties

Name Meaning
Tweet ID The unique identifier of the tweet associated with the media (used in some operations).
Custom Fields Comma-separated list of additional custom fields to include in the API response.
Alt Text Alternative text description for the media to enhance accessibility.
Media ID The unique identifier of the media item to which metadata will be added.
Sensitive Media Warning Optional warning text indicating that the media contains sensitive content.

Output

The node outputs JSON data representing the response from the Twitter API after creating or updating media metadata. This typically includes confirmation of the metadata update and any relevant details returned by the API.

If the node operation involves media upload or retrieval, it may also handle binary data representing media files, but for the "Create Media Metadata" operation, the output is purely JSON describing the metadata status.

Dependencies

  • Requires an active subscription and valid API key for the external "N8N Tools API" service, which validates usage before forwarding requests to Twitter.
  • Requires OAuth2 or API credentials configured in n8n to authenticate with the Twitter API.
  • The node depends on the bundled twitter-api helper class to interact with Twitter's endpoints.

Troubleshooting

  • Invalid subscription or API key error: If the node throws an error about invalid subscription or API key, verify that the API key credential for the external validation service is correctly set up and active.
  • Unsupported file upload method: For media uploads, URLs are not supported yet; only base64 encoded data is accepted. Attempting to use a URL will result in an error.
  • Missing required parameters: Ensure that required fields like mediaId and altText (if applicable) are provided; otherwise, the Twitter API will reject the request.
  • API rate limits: Twitter API enforces rate limits; excessive requests may cause errors. Implement error handling or delays if needed.

Links and References

Discussion