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 →
{
"name": "Trending topics to daily AI post",
"nodes": [
{
"parameters": {
"content": "## Trending topics \u2192 daily AI post\n\nEvery morning: ask Perplexity what's trending in your niche, draft per-platform captions with an LLM, and schedule one post per network through Posta.\n\n> **Drafts only by default.** Posts are created as drafts and scheduled \u2014 review them each morning before they ship. Don't flip to auto-publish until you trust the output.\n\n### Setup\n\n- [ ] Header Auth creds: `Posta API`, `OpenAI API`, `Perplexity API`\n- [ ] `CONTENT_NICHE` env, e.g. `developer tools` \u2014 what to search trends for\n- [ ] In **Fan out to platforms**, set your LinkedIn / Bluesky / Threads Posta account ids and the per-platform peak hours\n\n### Optional: AI image\n\nAdd an image step (DALL\u00b7E / Runware / fal.ai) \u2192 download the bytes \u2192 Posta **Upload media** (resource: Media) \u2192 pass the returned id via Create post's **Additional Fields \u2192 Media IDs**, and per-network crops happen inside Posta.",
"height": 560,
"width": 460
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-1180,
-120
],
"id": "d1000000-0000-4000-9000-000000000001",
"name": "Sticky Overview"
},
{
"parameters": {
"rule": {
"interval": [
{
"field": "days",
"triggerAtHour": 8
}
]
}
},
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [
-640,
160
],
"id": "d1000000-0000-4000-9000-000000000002",
"name": "Every day at 8am"
},
{
"parameters": {
"method": "POST",
"url": "https://api.perplexity.ai/chat/completions",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify({\n model: 'sonar',\n messages: [\n { role: 'user', content: \"What's trending today in \" + ($env.CONTENT_NICHE || 'social media automation') + \"? Give 3 distinct, specific angles worth posting about. Be concise.\" }\n ]\n}) }}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-400,
160
],
"id": "d1000000-0000-4000-9000-000000000003",
"name": "Trending angles (Perplexity)",
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"method": "POST",
"url": "https://api.openai.com/v1/chat/completions",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify({\n model: 'gpt-4o-mini',\n response_format: { type: 'json_object' },\n messages: [\n { role: 'system', content: 'Pick the single best angle from the input and write per-platform captions. Return JSON {\"linkedin\": long-form professional, \"bluesky\": <=300 chars, \"threads\": punchy}. No hashtags on LinkedIn.' },\n { role: 'user', content: $json.choices[0].message.content }\n ]\n}) }}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-160,
160
],
"id": "d1000000-0000-4000-9000-000000000004",
"name": "Per-platform captions",
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsCode": "// Parse the captions JSON and fan out to one item per platform with the\n// account id and that network's peak posting hour (today).\nconst c = JSON.parse($input.first().json.choices[0].message.content);\n\n// >>> Set your Posta social account ids and peak hours here <<<\nconst ACCOUNTS = { linkedin: 'REPLACE_LINKEDIN_ID', bluesky: 'REPLACE_BLUESKY_ID', threads: 'REPLACE_THREADS_ID' };\nconst HOURS = { linkedin: 9, bluesky: 12, threads: 18 };\n\nreturn ['linkedin', 'bluesky', 'threads'].map((p) => ({\n json: {\n platform: p,\n socialAccountIds: ACCOUNTS[p],\n caption: c[p],\n scheduledAt: $now.set({ hour: HOURS[p], minute: 0, second: 0, millisecond: 0 }).toISO(),\n },\n}));"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
80,
160
],
"id": "d1000000-0000-4000-9000-000000000005",
"name": "Fan out to platforms"
},
{
"parameters": {
"socialAccountIds": "={{ $json.socialAccountIds }}",
"caption": "={{ $json.caption }}",
"additionalFields": {},
"platformConfigurations": {}
},
"type": "n8n-nodes-posta.posta",
"typeVersion": 1,
"position": [
320,
160
],
"id": "d1000000-0000-4000-9000-000000000006",
"name": "Create a post",
"credentials": {
"postaApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "schedule",
"postId": "={{ $json.id }}",
"scheduledAt": "={{ $('Fan out to platforms').item.json.scheduledAt }}"
},
"type": "n8n-nodes-posta.posta",
"typeVersion": 1,
"position": [
560,
160
],
"id": "d1000000-0000-4000-9000-000000000007",
"name": "Schedule a post",
"credentials": {
"postaApi": {
"name": "<your credential>"
}
}
}
],
"connections": {
"Every day at 8am": {
"main": [
[
{
"node": "Trending angles (Perplexity)",
"type": "main",
"index": 0
}
]
]
},
"Trending angles (Perplexity)": {
"main": [
[
{
"node": "Per-platform captions",
"type": "main",
"index": 0
}
]
]
},
"Per-platform captions": {
"main": [
[
{
"node": "Fan out to platforms",
"type": "main",
"index": 0
}
]
]
},
"Fan out to platforms": {
"main": [
[
{
"node": "Create a post",
"type": "main",
"index": 0
}
]
]
},
"Create a post": {
"main": [
[
{
"node": "Schedule a post",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"meta": {
"templateCredsSetupCompleted": true
},
"tags": [
{
"name": "socialmedia"
},
{
"name": "posta"
},
{
"name": "ai"
}
]
}
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.
httpHeaderAuthpostaApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Trending topics to daily AI post. Uses httpRequest, n8n-nodes-posta. Scheduled trigger; 7 nodes.
Source: https://github.com/STGime/posta-n8n-workflows/blob/main/workflows/trending-topics-daily-ai-post.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Birthday Automation - Production (Fixed). Uses stopAndError, httpRequest, emailSend, bannerbear. Scheduled trigger; 86 nodes.
This template runs two scheduled workflows to govern Microsoft Entra ID (Azure AD) guest accounts by detecting stale users via Microsoft Graph, staging deletions in SharePoint with a 72-hour window, n
Jira-Allure-Auto-Qa. Uses httpRequest, jira. Scheduled trigger; 68 nodes.
Spotify-Sync-Surrealdb-V1. Uses httpRequest, n8n-nodes-surrealdb, spotify. Scheduled trigger; 62 nodes.
As n8n instances scale, teams often lose track of sub-workflows—who uses them, where they are referenced, and whether they can be safely updated. This leads to inefficiencies like unnecessary copies o