AutomationFlowsSocial Media › Perplexity AI to X Auto-Post Breaking News

Perplexity AI to X Auto-Post Breaking News

Original n8n title: Auto-post Breaking News Content Using Perplexity AI to X (twitter)

ByAitor | 1Node @aitoralonso on n8n.io

Stay ahead of the curve and keep your followers informed—automatically. This n8n workflow uses Perplexity AI to generate insightful answers to scheduled queries, then auto-posts the responses directly to X (Twitter). Scheduled Trigger – Runs at set times (daily, hourly, etc.).…

Cron / scheduled trigger★★★★☆ complexity5 nodesHTTP RequestTwitter
Social Media Trigger: Cron / scheduled Nodes: 5 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #3822 — we link there as the canonical source.

This workflow follows the HTTP Request → Twitter recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "v9K61fCQhrG6gt6Z",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Search news using Perplexity AI and post to X (Twitter)",
  "tags": [],
  "nodes": [
    {
      "id": "9b2fdc0f-8c71-4ea9-a9d0-df470f2778df",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -560,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 21,
              "triggerAtMinute": "={{Math.floor(Math.random() * 60)}}\n"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d549c019-1f3e-4758-a5ee-e4ac7e03cc2d",
      "name": "searchQuery",
      "type": "n8n-nodes-base.set",
      "position": [
        -340,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "4cfbc312-5dcd-444d-ae08-0bab417c084c",
              "name": "searchInput",
              "type": "string",
              "value": "What's the latest news in artificial intelligence?"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "87c28d43-6cd6-4292-a563-a9f22467e162",
      "name": "Perplexity",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        100,
        0
      ],
      "parameters": {
        "url": "https://api.perplexity.ai/chat/completions",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"model\": \"llama-3.1-sonar-small-128k-online\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a social media assistant summarizing tech news for Twitter/X. Only return one article. Your output must follow this exact format: a short, engaging headline (max 140 characters), followed by a single space, then the direct article link. Do not use markdown, hashtags, emojis, or line breaks. Keep the total output under 200 characters. Be precise, objective, and newsworthy.Example: Mastercard launches Agent Pay, allowing AI agents to make purchases for users. https://www.perplexity.ai/page/mastercard-unveils-agent-pay-e-qWXnaUEzQZWCqsxF4l43zA\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"{{ $('searchQuery').item.json.searchInput }}\"\n    }\n  ],\n  \"temperature\": 0.3,\n  \"top_p\": 0.9,\n  \"return_citations\": true,\n  \"search_domain_filter\": [\n    \"perplexity.ai\"\n  ],\n  \"search_recency_filter\": \"day\",\n  \"return_images\": true,\n  \"return_related_questions\": false,\n  \"max_tokens\": 80,\n  \"stream\": false,\n  \"presence_penalty\": 0,\n  \"frequency_penalty\": 1\n}\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $json.perplexityAPI }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c1ed633d-d318-403c-9577-c3c63ac2e68e",
      "name": "set API key",
      "type": "n8n-nodes-base.set",
      "position": [
        -120,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "4f9bd3a0-5587-410f-b145-a287f65f9576",
              "name": "perplexityAPI",
              "type": "string",
              "value": "<yourPerplexityAPI>"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "e228e352-2ddd-4e2c-a434-993910ced7be",
      "name": "Post to X",
      "type": "n8n-nodes-base.twitter",
      "position": [
        320,
        0
      ],
      "parameters": {
        "text": "={{ $json.choices[0].message.content }}",
        "additionalFields": {}
      },
      "credentials": {
        "twitterOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    }
  ],
  "active": true,
  "settings": {
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": "qFOYM3IA9QZ7fMym",
    "executionOrder": "v1"
  },
  "versionId": "74e316fe-561f-4c80-b446-bba795654cef",
  "connections": {
    "Post to X": {
      "main": [
        []
      ]
    },
    "Perplexity": {
      "main": [
        [
          {
            "node": "Post to X",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "searchQuery": {
      "main": [
        [
          {
            "node": "set API key",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "set API key": {
      "main": [
        [
          {
            "node": "Perplexity",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "searchQuery",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Stay ahead of the curve and keep your followers informed—automatically. This n8n workflow uses Perplexity AI to generate insightful answers to scheduled queries, then auto-posts the responses directly to X (Twitter). Scheduled Trigger – Runs at set times (daily, hourly, etc.).…

Source: https://n8n.io/workflows/3822/ — original creator credit. Request a take-down →

More Social Media workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Social Media

Social media managers, creators, and brand accounts that rely on retweets for reach but want an automated, hands-off cleanup after campaigns to keep profiles tidy and on-brand.

HTTP Request, Twitter, Slack +1
Social Media

This workflow monitors brand mentions across multiple platforms (Twitter/X, Reddit, News) and automatically detects reputation crises based on sentiment analysis and trend detection. Multi-platform mo

Twitter, Reddit, HTTP Request +3
Social Media

Creator: Summer Chang

HTTP Request, Notion, Twitter
Social Media

FootballAnalytics AI Brain Workflow. Uses httpRequest, twitter. Scheduled trigger; 10 nodes.

HTTP Request, Twitter
Social Media

This n8n workflow automates the process of finding, summarizing, and posting breaking news headlines on X (formerly Twitter). It combines Google Custom Search for finding the latest news articles with

Twitter, HTTP Request