{
  "updatedAt": "2026-07-18T12:13:54.608Z",
  "createdAt": "2026-07-07T21:54:29.213Z",
  "id": "rVutc20jMrDscvvZ",
  "name": "Daily Viral Content Radar (AnyAPI)",
  "description": null,
  "active": true,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 8
            }
          ]
        }
      },
      "id": "6c9094b7-9770-4a1c-aba5-91175e6d49b8",
      "name": "Every Morning 8AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        528,
        384
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "n1",
              "name": "niche",
              "value": "AI Automation & Data Analysis",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "7d14889c-6b3f-4fc2-979f-fab6129247ca",
      "name": "Set Niche",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        752,
        384
      ]
    },
    {
      "parameters": {
        "sku": "tiktok.search_top",
        "inputMode": "json",
        "input": "={ \"query\": \"{{ $json.niche }}\" }",
        "options": {}
      },
      "id": "78b83205-8f4d-44f9-bad2-e14b69ff33f9",
      "name": "AnyAPI: TikTok Top",
      "type": "n8n-nodes-anyapi.anyApi",
      "typeVersion": 1,
      "position": [
        976,
        288
      ],
      "credentials": {
        "anyApiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sku": "instagram.reels_search",
        "inputMode": "json",
        "input": "={ \"query\": \"{{ $json.niche }}\", \"datePosted\": \"last-week\" }",
        "options": {}
      },
      "id": "54ce387b-2be2-449f-be92-532fd6f3386b",
      "name": "AnyAPI: Instagram Reels",
      "type": "n8n-nodes-anyapi.anyApi",
      "typeVersion": 1,
      "position": [
        976,
        480
      ],
      "credentials": {
        "anyApiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {},
      "id": "994411e9-bfa5-4bba-922a-37973efe9c19",
      "name": "Combine Sources",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        1200,
        384
      ]
    },
    {
      "parameters": {
        "jsCode": "const tk = ($('AnyAPI: TikTok Top').first().json.output) || {};\nconst ig = ($('AnyAPI: Instagram Reels').first().json.output) || {};\nconst tkItems = (tk.data && tk.data.items) || tk.items || [];\nconst igItems = (ig.data && ig.data.reels) || ig.reels || [];\nconst rows = [];\nfor (const v of tkItems) { rows.push({ platform: 'TikTok', author: v.author || '', caption: v.caption || '', url: v.url || '', views: Number(v.views) || 0, likes: Number(v.likes) || 0, comments: Number(v.comments) || 0 }); }\nfor (const v of igItems) { rows.push({ platform: 'Instagram Reels', author: v.username || '', caption: v.caption || '', url: v.url || '', views: Number(v.views) || Number(v.plays) || 0, likes: Number(v.likes) || 0, comments: Number(v.comments) || 0 }); }\nrows.sort(function (a, b) { return b.views - a.views; });\nconst top = rows.slice(0, 8);\nconst lines = [];\nfor (let i = 0; i < top.length; i++) { const v = top[i]; lines.push((i + 1) + '. [' + v.platform + '] @' + v.author + ' - ' + (v.views || 0).toLocaleString() + ' views, ' + (v.likes || 0).toLocaleString() + ' likes\\n   Caption: ' + String(v.caption || '').slice(0, 180) + '\\n   URL: ' + v.url); }\nconst niche = $('Set Niche').first().json.niche;\nconst videosText = lines.join('\\n\\n');\nreturn [{ json: { niche: niche, generatedAt: $now.toISO(), count: top.length, videos: top, videosText: videosText } }];"
      },
      "id": "a4b1d4a9-3056-4bef-85e1-644b63e38a8d",
      "name": "Rank Top Viral",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1424,
        384
      ]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Niche: {{ $json.niche }}\n\nToday's top performing TikToks and Reels in this niche:\n\n{{ $json.videosText }}",
        "needsFallback": true,
        "options": {
          "systemMessage": "You are an expert LinkedIn post copywriter and B2B growth strategist. For each LinkedIn post or carousel provided, explain in 1-2 sentences why it likely went viral by identifying its core driver (pattern-interrupt hook, visual formatting and white space, relatable vulnerability, or data-backed contrarian take). Next, provide an actionable 3-step plan to adapt and replicate its structural framework for the user's own brand without sounding like generic marketing. Output clean Markdown with a heading per post, and finish with one overarching \"Pattern of the day\" takeaway across all analyzed posts."
        }
      },
      "id": "457744c7-8703-42d3-a4f0-a1e454aa96a1",
      "name": "Write Replication Brief",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        1712,
        128
      ]
    },
    {
      "parameters": {
        "sendTo": "sohila.k.data@gmail.com",
        "subject": "=Daily viral {{ $('Set Niche').item.json.niche }} brief - {{ $now.toFormat('LLL d') }}",
        "emailType": "text",
        "message": "={{ $json.output }}",
        "options": {
          "appendAttribution": false
        }
      },
      "id": "d1ce10a7-61ef-47da-b997-9007d92ffb5f",
      "name": "Email the Brief",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        2112,
        240
      ],
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "fieldToSplitOut": "videos",
        "options": {}
      },
      "id": "98660d93-21ce-4c35-9183-d66982084872",
      "name": "Split Out Videos",
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        1776,
        528
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1VacMuy8bKUJLSUjcqLG6nEeQ2PYK3ho6v_OAuCNvR3k",
          "mode": "list",
          "cachedResultName": "Viral Finds",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1VacMuy8bKUJLSUjcqLG6nEeQ2PYK3ho6v_OAuCNvR3k/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Sheet1"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Date": "={{ $now.toISODate() }}",
            "Platform": "={{ $json.platform }}",
            "Author": "={{ $json.author }}",
            "Views": "={{ $json.views }}",
            "Likes": "={{ $json.likes }}",
            "URL": "={{ $json.url }}",
            "Caption": "={{ $json.caption }}"
          },
          "schema": [
            {
              "id": "Date",
              "displayName": "Date",
              "type": "string",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "Platform",
              "displayName": "Platform",
              "type": "string",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "Author",
              "displayName": "Author",
              "type": "string",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "Views",
              "displayName": "Views",
              "type": "string",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "Likes",
              "displayName": "Likes",
              "type": "string",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "URL",
              "displayName": "URL",
              "type": "string",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "Caption",
              "displayName": "Caption",
              "type": "string",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "canBeUsedToMatch": true
            }
          ]
        },
        "options": {}
      },
      "id": "5870a5a1-850b-4f13-8efe-8c8d43fca6d0",
      "name": "Log Viral Finds",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        2112,
        528
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $workflow.id }}"
      },
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "typeVersion": 1.4,
      "position": [
        1952,
        352
      ],
      "id": "403f822a-8da7-4050-9f49-5374808682ae",
      "name": "Postgres Chat Memory",
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": "openrouter/auto",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "typeVersion": 1,
      "position": [
        1808,
        352
      ],
      "id": "c5b0f47d-8b70-4928-8c68-ab96f6ee6dc6",
      "name": "OpenRouter Chat Model",
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "modelName": "models/gemini-2.5-flash",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1.1,
      "position": [
        1648,
        352
      ],
      "id": "01c1f5a2-9eda-491f-8842-25f5e37f7a27",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Every Morning 8AM": {
      "main": [
        [
          {
            "node": "Set Niche",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Niche": {
      "main": [
        [
          {
            "node": "AnyAPI: TikTok Top",
            "type": "main",
            "index": 0
          },
          {
            "node": "AnyAPI: Instagram Reels",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AnyAPI: TikTok Top": {
      "main": [
        [
          {
            "node": "Combine Sources",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AnyAPI: Instagram Reels": {
      "main": [
        [
          {
            "node": "Combine Sources",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Combine Sources": {
      "main": [
        [
          {
            "node": "Rank Top Viral",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rank Top Viral": {
      "main": [
        [
          {
            "node": "Write Replication Brief",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Out Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Replication Brief": {
      "main": [
        [
          {
            "node": "Email the Brief",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Videos": {
      "main": [
        [
          {
            "node": "Log Viral Finds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "Write Replication Brief",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Write Replication Brief",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Write Replication Brief",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": true
  },
  "staticData": {
    "node:Every Morning 8AM": {
      "recurrenceRules": []
    }
  },
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodeGroups": [],
  "versionId": "ed366055-23c0-40ff-8a48-cec574978d23",
  "activeVersionId": "ed366055-23c0-40ff-8a48-cec574978d23",
  "versionCounter": 63,
  "triggerCount": 1,
  "sourceWorkflowId": null,
  "tags": [
    {
      "updatedAt": "2026-07-16T16:03:29.217Z",
      "createdAt": "2026-07-16T16:03:29.217Z",
      "id": "08f43634238e406b",
      "name": "Agentic AI"
    },
    {
      "updatedAt": "2026-07-16T16:03:29.020Z",
      "createdAt": "2026-07-16T16:03:29.020Z",
      "id": "9a8d1d753df54ed1",
      "name": "Production Automation"
    },
    {
      "updatedAt": "2026-07-16T16:03:28.786Z",
      "createdAt": "2026-07-16T16:03:28.786Z",
      "id": "6e30f4ffb71d4b65",
      "name": "Data Pipeline"
    },
    {
      "updatedAt": "2026-07-16T16:03:28.540Z",
      "createdAt": "2026-07-16T16:03:28.540Z",
      "id": "90acb56ef2f84a89",
      "name": "Event-Driven"
    },
    {
      "updatedAt": "2026-07-16T16:03:28.284Z",
      "createdAt": "2026-07-16T16:03:28.284Z",
      "id": "e1c954be4bee474d",
      "name": "Data Transformation"
    }
  ],
  "shared": [
    {
      "updatedAt": "2026-07-07T21:54:29.213Z",
      "createdAt": "2026-07-07T21:54:29.213Z",
      "role": "workflow:owner",
      "workflowId": "rVutc20jMrDscvvZ",
      "projectId": "7Kuw5RaGwePDWMtJ",
      "project": {
        "updatedAt": "2026-06-09T16:37:14.049Z",
        "createdAt": "2026-06-09T16:15:53.210Z",
        "id": "7Kuw5RaGwePDWMtJ",
        "name": "Sohila Abbas <sohila.k.data@gmail.com>",
        "type": "personal",
        "icon": null,
        "description": null,
        "customTelemetryTags": [],
        "creatorId": "ef255f89-7c87-4d14-8714-7469755d5486"
      }
    }
  ],
  "versionMetadata": {
    "name": "Version ed366055",
    "description": ""
  }
}