{
  "name": "D - Weekly UGC Trends & Tech Digest",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "weeksInterval": 1,
              "triggerAtDay": [
                1
              ],
              "triggerAtHour": 8
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -400,
        0
      ],
      "id": "schedule-weekly-1",
      "name": "Weekly Monday 8am"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.openai.com/v1/responses",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "openAiApi",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ model: \"gpt-4.1\", tools: [ { type: \"web_search\" } ], input: \"You are a research assistant for a UGC (user-generated content) creator based in Round Rock, Texas who applies to brand deals on platforms like Billo, JoinBrands, Insense, Collabstr, and Sideshift, and also runs 'Probably Fine Co.', an Etsy shop selling DIY blueprints for wildlife nest boxes and garden planters, with an Instagram presence around birdwatching, DIY, and woodworking content. Search the web for UGC video ads, brand-deal case studies, or short-form video marketing articles published in the last 14 days that highlight successful, high-performing UGC or short-form content (TikTok/Instagram Reels ads, brand UGC campaigns, or DIY/maker/birdwatching content that performed unusually well). Identify 4-6 concrete, recurring characteristics driving their success (hook style, pacing, format, tone, editing technique, caption style, etc.). For each one, give one specific, actionable way this creator could adopt or test it in their own UGC pitches or DIY/wildlife content this week. Keep the whole answer under 350 words, plain text, no markdown headers, short bullet-style lines, cite the source name in parentheses after each point where relevant.\" }) }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -160,
        -80
      ],
      "id": "http-content-research-1",
      "name": "Research UGC Content Trends",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.openai.com/v1/responses",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "openAiApi",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ model: \"gpt-4.1\", tools: [ { type: \"web_search\" } ], input: \"You are scanning for competitive-advantage opportunities for a solo UGC creator and digital-product maker (Etsy shop 'Probably Fine Co.', SketchUp/DIY blueprints, birdwatching/woodworking content) who uses CapCut, Canva, ElevenLabs, Adobe Firefly/Photoshop, Gemini, and n8n automation. Search the web for news, product launches, or notable updates from the last 14 days in AI video generation, AI voice/voice cloning, faceless content creation, short-form video/editing tools, or UGC/brand-deal marketplace platforms (Billo, JoinBrands, Insense, Collabstr, Sideshift) that could give this creator a competitive edge. Identify 3-5 specific developments; for each, briefly explain why it matters and one concrete next step to try it. Keep the whole answer under 300 words, plain text, no markdown headers, short bullet-style lines, cite the source name in parentheses after each point where relevant.\" }) }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -160,
        80
      ],
      "id": "http-tech-research-1",
      "name": "Research Tech Advantages",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "mode": "append",
        "options": {}
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3,
      "position": [
        80,
        0
      ],
      "id": "merge-results-1",
      "name": "Combine Both Results"
    },
    {
      "parameters": {
        "jsCode": "function extractText(resp) {\n  if (!resp) return '';\n  const output = resp.output || [];\n  const msg = output.find(o => o.type === 'message');\n  if (!msg || !msg.content) return '';\n  const part = msg.content.find(c => c.type === 'output_text') || msg.content[0];\n  return (part && part.text) ? part.text.trim() : '';\n}\n\nfunction truncate(s, max) {\n  if (!s) return s;\n  return s.length > max ? s.slice(0, max).trim() + '\u2026' : s;\n}\n\nconst items = $input.all();\nconst contentResp = items[0] ? items[0].json : null;\nconst techResp = items[1] ? items[1].json : null;\nconst contentText = extractText(contentResp) || '(no result returned)';\nconst techText = extractText(techResp) || '(no result returned)';\nconst dateStr = new Date().toISOString().slice(0,10);\nconst contentTextShort = truncate(contentText, 1400);\nconst techTextShort = truncate(techText, 1400);\nlet telegramMessage = `\\uD83D\\uDCC8 Weekly UGC & Tech Digest (${dateStr})\\n\\n\\uD83C\\uDFAC Content characteristics to try:\\n${contentTextShort}\\n\\n\\uD83E\\uDD16 Tech/tool advantages to explore:\\n${techTextShort}\\n\\nFull digest logged to the Weekly Insights sheet.`;\nif (telegramMessage.length > 4000) telegramMessage = telegramMessage.slice(0, 3990).trim() + '\u2026';\nreturn [{ json: { date: dateStr, contentText, techText, telegramMessage } }];\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        320,
        0
      ],
      "id": "code-combine-1",
      "name": "Combine & Format Digest"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1lVPDfBIyFNGt3zKf3Xb3tUSaIRkIi6IZCKCtHtYj-c8",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Weekly Insights",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Date": "={{ $json.date }}",
            "Category": "Content Trends",
            "Summary & Takeaways": "={{ $json.contentText }}"
          }
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        560,
        -80
      ],
      "id": "sheets-log-content-1",
      "name": "Log Content Insights",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1lVPDfBIyFNGt3zKf3Xb3tUSaIRkIi6IZCKCtHtYj-c8",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Weekly Insights",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Date": "={{ $json.date }}",
            "Category": "Tech Advantage",
            "Summary & Takeaways": "={{ $json.techText }}"
          }
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        560,
        80
      ],
      "id": "sheets-log-tech-1",
      "name": "Log Tech Insights",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "7338142522",
        "text": "={{ $json.telegramMessage }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        800,
        0
      ],
      "id": "telegram-digest-1",
      "name": "Send Weekly Digest",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "function extractText(resp) {\n  if (!resp) return '';\n  const output = resp.output || [];\n  const msg = output.find(o => o.type === 'message');\n  if (!msg || !msg.content) return '';\n  const part = msg.content.find(c => c.type === 'output_text') || msg.content[0];\n  return (part && part.text) ? part.text.trim() : '';\n}\n\nfunction splitIdeas(text, category, maxCount) {\n  const lines = text.split(/\\n+/)\n    .map(l => l.replace(/^[-\\u2022\\d.)\\s]+/, '').trim())\n    .filter(l => l.length > 15);\n  return lines.slice(0, maxCount).map(l => ({\n    category,\n    title: l.length > 60 ? l.slice(0, 57) + '...' : l,\n    description: l\n  }));\n}\n\nconst items = $input.all();\nconst contentResp = items[0] ? items[0].json : null;\nconst techResp = items[1] ? items[1].json : null;\nconst contentText = extractText(contentResp);\nconst techText = extractText(techResp);\n\nconst ideas = [\n  ...splitIdeas(contentText, 'Content Trend', 2),\n  ...splitIdeas(techText, 'Tech Advantage', 2)\n];\n\nconst now = new Date();\nconst dateStr = now.toISOString().slice(0,10);\n\nreturn ideas.map((idea, i) => {\n  const id = `i${now.getTime().toString(36)}${Math.random().toString(36).slice(2,6)}${i}`;\n  return {\n    json: {\n      approvalId: id,\n      category: idea.category,\n      description: idea.description,\n      detailsJson: JSON.stringify({ title: idea.title, description: idea.description, category: idea.category }),\n      createdDate: dateStr,\n      telegramText: `\\uD83D\\uDCA1 New content idea (${idea.category})\\n\\n${idea.description}\\n\\nOK to proceed with this?`\n    }\n  };\n});\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        320,
        260
      ],
      "id": "code-extract-ideas-1",
      "name": "Extract Approval Ideas"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1lVPDfBIyFNGt3zKf3Xb3tUSaIRkIi6IZCKCtHtYj-c8",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Approvals",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "ApprovalID": "={{ $json.approvalId }}",
            "Type": "Idea",
            "Details": "={{ $json.detailsJson }}",
            "Status": "Pending",
            "CreatedDate": "={{ $json.createdDate }}",
            "ResolvedDate": ""
          }
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        560,
        260
      ],
      "id": "sheets-log-approval-idea-1",
      "name": "Log Approval Idea",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "7338142522",
        "text": "={{ $json.telegramText }}",
        "additionalFields": {
          "reply_markup": {
            "inlineKeyboard": {
              "rows": [
                {
                  "row": [
                    {
                      "text": "\u2705 Yes, proceed",
                      "additionalFields": {
                        "callback_data": "={{ 'IDEA|' + $json.approvalId + '|YES' }}"
                      }
                    },
                    {
                      "text": "\ud83d\uddc4 No, backlog",
                      "additionalFields": {
                        "callback_data": "={{ 'IDEA|' + $json.approvalId + '|NO' }}"
                      }
                    }
                  ]
                }
              ]
            }
          }
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        800,
        260
      ],
      "id": "telegram-idea-approval-1",
      "name": "Send Idea Approval",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Weekly Monday 8am": {
      "main": [
        [
          {
            "node": "Research UGC Content Trends",
            "type": "main",
            "index": 0
          },
          {
            "node": "Research Tech Advantages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Research UGC Content Trends": {
      "main": [
        [
          {
            "node": "Combine Both Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Research Tech Advantages": {
      "main": [
        [
          {
            "node": "Combine Both Results",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Combine Both Results": {
      "main": [
        [
          {
            "node": "Combine & Format Digest",
            "type": "main",
            "index": 0
          },
          {
            "node": "Extract Approval Ideas",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine & Format Digest": {
      "main": [
        [
          {
            "node": "Log Content Insights",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log Tech Insights",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Weekly Digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Approval Ideas": {
      "main": [
        [
          {
            "node": "Log Approval Idea",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Idea Approval",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {}
}