N8N Tools - X (Twitter) Enhanced icon

N8N Tools - X (Twitter) Enhanced

Comprehensive X (Twitter) API v2 integration for N8N workflows

Overview

This node provides enhanced integration with the X (formerly Twitter) API v2, allowing users to perform a wide range of operations on tweets, users, timelines, media, spaces, lists, bookmarks, direct messages, analytics, and compliance jobs. Specifically for the Delete Tweet operation under the Tweets resource, the node enables deleting a tweet by its ID.

Common scenarios where this node is beneficial include:

  • Automating social media management workflows such as posting, deleting, or managing tweets.
  • Moderation tasks like removing inappropriate or outdated tweets automatically.
  • Integrating Twitter actions into broader business processes or marketing automation pipelines.

Practical example:

  • A user can set up a workflow that deletes tweets containing certain keywords after a specific time period to maintain brand reputation or comply with content policies.

Properties

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

For the Delete Tweet operation, only the Tweet ID property is required and used.

Output

The output of the node is a JSON object representing the result of the delete operation from the Twitter API. Typically, this will confirm whether the tweet was successfully deleted or provide error details if the deletion failed.

  • The json field contains the API response data.
  • No binary data output is produced by the Delete Tweet operation.

Dependencies

  • Requires an API key credential for the "N8N Tools API" service to validate subscription and usage.
  • Requires OAuth2 or API credentials for authenticating with 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 the node throws an error about invalid subscription or API key, verify that the provided API key credential is correct and active.
  • Tweet not found or already deleted: If the tweet ID does not exist or has been deleted previously, the API will return an error. Confirm the tweet ID is valid.
  • Insufficient permissions: Deleting tweets requires appropriate permissions on the Twitter account. Ensure the authenticated user has rights to delete the specified tweet.
  • Network or API errors: Temporary network issues or Twitter API rate limits may cause failures. Retry after some time or check API usage limits.

Links and References

Discussion