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, enabling workflows to interact with various aspects of the platform including tweets, users, timelines, media, spaces, lists, bookmarks, direct messages, analytics, and compliance features. Specifically, for the Direct Messages resource and the Get Conversation Events operation, the node retrieves events (such as messages or actions) from a specified direct message conversation.

Use cases include:

  • Monitoring direct message conversations for new messages or events.
  • Automating responses or processing of direct message content.
  • Integrating Twitter direct message data into broader workflow automations.

Example: Fetching recent events from a customer support conversation on Twitter to trigger follow-up actions in a CRM system.

Properties

Name Meaning
Conversation ID The unique identifier of the direct message conversation from which to retrieve events.

Output

The node outputs an array of JSON objects representing the conversation events retrieved from the specified direct message conversation. Each item corresponds to an event such as a message sent or received within that conversation.

The output structure is:

[
  {
    "json": {
      // Event data returned by the Twitter API for the conversation
    },
    "itemData": {
      "item": <index_of_input_item>
    }
  },
  ...
]

No binary data output is produced by this operation.

Dependencies

  • Requires an active subscription and valid API key for the external service referred to as "N8N Tools API" for validation.
  • Requires OAuth2 or API credentials configured in n8n to authenticate with the Twitter API.
  • The node uses an internal helper class to interact with the Twitter API v2 endpoints.

Troubleshooting

  • Invalid subscription or API key error: If the node throws an error about invalid subscription or API key, verify that your API key credential is correct and has the necessary permissions.
  • HTTP request failures: Network issues or incorrect conversation IDs may cause failures. Ensure the conversation ID exists and the authenticated user has access.
  • Continue on Fail: If enabled, the node will continue processing other items even if one fails, returning error details per item.

Links and References

Discussion