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, enabling various user-related operations including following and unfollowing users. Specifically, the Unfollow User operation allows you to unfollow a specified user by their user ID or username. This is useful in social media management workflows where you want to automate cleaning up your following list or manage relationships programmatically.

Practical examples:

  • Automatically unfollow users who no longer engage with your content.
  • Manage follow/unfollow cycles for marketing campaigns.
  • Integrate with other workflow steps to maintain a curated list of followed accounts.

Properties

Name Meaning
User ID The target user's ID or @username to unfollow.
Include Private Metrics Whether to include private metrics in responses (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 output JSON contains the response from the Twitter API related to the unfollow action. Typically, this will confirm whether the unfollow request was successful and may include metadata about the relationship status.

  • The json field holds the API response object.
  • No binary data is produced by this operation.

Dependencies

  • Requires an active subscription and valid API key for the external "N8N Tools API" service used for validation.
  • Requires OAuth2 credentials for authenticating with the Twitter API.
  • The node uses the bundled Twitter API client internally to perform the unfollow request.

Troubleshooting

  • Invalid subscription or API key error: If you receive errors indicating invalid subscription or API key, verify that your API key credential is correct and has the necessary permissions.
  • User not found or invalid user ID: Ensure the provided User ID or username is valid and exists on Twitter.
  • Permission errors: The authenticated account must have permission to unfollow the specified user; otherwise, the API will reject the request.
  • Rate limits: Twitter API rate limits may apply; if you hit these, consider adding delays or handling retries in your workflow.
  • Continue on Fail: The node supports continuing execution on individual item failures, allowing partial success in batch operations.

Links and References

Discussion