Skip to main content
Use n8n when you want Twexapi research results to trigger database writes, Slack alerts, CRM updates, or scheduled follow-up jobs.

Prerequisites

  • A Twexapi API key
  • n8n Cloud or self-hosted n8n
  • A webhook URL for MCP handoff recipes
  • Optional Slack, Google Sheets, Airtable, or database credentials

API key credential

Create a reusable n8n credential for Twexapi REST calls: For MCP-capable AI Agent nodes, configure the MCP Client Tool with https://api.twexapi.io/mcp and header x-api-key: YOUR_API_KEY.

Pattern

  1. Create an n8n Webhook trigger.
  2. Ask an MCP-capable agent to return strict Twexapi handoff JSON.
  3. POST the JSON to the n8n webhook.
  4. Use Set, IF, Split Out, and HTTP Request nodes to process rows.

Webhook payload

Suggested n8n nodes

Result handoff

Use an Edit Fields node after each MCP or HTTP Request step when the next node only needs stable fields.

Recipe 1: AI agent X research with MCP

1

Add an AI Agent node

Use your preferred chat model.
2

Add an MCP Client Tool

Configure https://api.twexapi.io/mcp with x-api-key.
3

Prompt the agent

Ask it to call explore, then twexapi_request, and return only JSON.
4

Route rows

Split tweets and write each row to your destination.
Suggested prompt:

Recipe 2: Monitor-style Slack alert

Use this when the workflow should alert a Slack channel after receiving a row from an MCP agent or a scheduled REST job. Slack message template:

Recipe 3: Extraction to Google Sheets

For larger follower or reply exports, let the agent choose the endpoint with MCP, then run the repeated pages through REST.

Direct REST continuation

Keep MCP for agent discovery and handoff. Use REST for scheduled, deterministic n8n jobs.

Testing checklist

  • Use n8n Test Step on every HTTP Request node.
  • Confirm every REST request includes Authorization: Bearer YOUR_API_KEY.
  • Confirm every MCP Client Tool request includes x-api-key.
  • Confirm webhooks receive JSON, not prose.
  • On 429, pause before retrying and preserve next_cursor.