{
  "name": "AI_WealthLab_Content_Generator",
  "nodes": [
    {
      "id": "ManualTrigger",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        200,
        300
      ]
    },
    {
      "id": "SetContext",
      "name": "Set Context",
      "type": "n8n-nodes-base.set",
      "typeVersion": 2,
      "position": [
        400,
        300
      ],
      "parameters": {
        "values": {
          "string": [
            {
              "name": "brand",
              "value": "AI WealthLab"
            },
            {
              "name": "platform",
              "value": "LinkedIn"
            },
            {
              "name": "tone",
              "value": "Clear, practical, human"
            }
          ]
        }
      }
    },
    {
      "id": "ResearchTopics",
      "name": "Research Topics",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [
        600,
        300
      ],
      "parameters": {
        "model": "gpt-4",
        "messages": [
          {
            "role": "system",
            "content": "You are a research assistant for AI educators. Generate 5 high-engagement topics about AI automation, workflows, and AI tools. Keep them practical and debate-worthy."
          }
        ]
      }
    },
    {
      "id": "SelectTopic",
      "name": "Select Topic",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        800,
        300
      ],
      "parameters": {
        "functionCode": "const text = items[0].json.choices[0].message.content;\nconst lines = text.split('\\n').filter(l => l.trim() !== '');\nreturn [{ json: { topic: lines[0] } }];"
      }
    },
    {
      "id": "GenerateAngle",
      "name": "Generate Angle",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [
        1000,
        300
      ],
      "parameters": {
        "model": "gpt-4",
        "messages": [
          {
            "role": "system",
            "content": "Create one strong educational angle for the topic. Focus on clarity and usefulness."
          },
          {
            "role": "user",
            "content": "Topic: {{$json.topic}}"
          }
        ]
      }
    },
    {
      "id": "WritePost",
      "name": "Write Post",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [
        1200,
        300
      ],
      "parameters": {
        "model": "gpt-4",
        "messages": [
          {
            "role": "system",
            "content": "Write a social media post for AI WealthLab. Clear, practical, human. Short paragraphs. No hype. End with a question."
          },
          {
            "role": "user",
            "content": "Platform: {{$node['Set Context'].json.platform}}\nTopic: {{$json.topic}}"
          }
        ]
      }
    },
    {
      "id": "ImagePrompt",
      "name": "Generate Image Prompt",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [
        1400,
        300
      ],
      "parameters": {
        "model": "gpt-4",
        "messages": [
          {
            "role": "system",
            "content": "Create a simple image prompt for a clean social media graphic. Modern AI education style. No text."
          },
          {
            "role": "user",
            "content": "Topic: {{$json.topic}}"
          }
        ]
      }
    }
  ],
  "connections": {
    "ManualTrigger": {
      "main": [
        [
          {
            "node": "SetContext",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SetContext": {
      "main": [
        [
          {
            "node": "ResearchTopics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ResearchTopics": {
      "main": [
        [
          {
            "node": "SelectTopic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SelectTopic": {
      "main": [
        [
          {
            "node": "GenerateAngle",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GenerateAngle": {
      "main": [
        [
          {
            "node": "WritePost",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WritePost": {
      "main": [
        [
          {
            "node": "ImagePrompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}