{
  "name": "WF-06 · Content Multiplier",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "new-recording",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "n1",
      "name": "New Recording Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [200, 400],
      "webhookId": "new-recording",
      "notes": "Trigger from Zoom (cloud recording completed), Loom, Google Drive, or a manual form. Payload should include: recording_url, title, duration_minutes, speaker_name."
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            { "id": "1", "name": "recordingUrl",   "value": "={{ $json.recording_url || $json.download_url || $json.payload?.download_url }}", "type": "string" },
            { "id": "2", "name": "title",          "value": "={{ $json.title || $json.topic || 'Untitled Recording' }}", "type": "string" },
            { "id": "3", "name": "durationMin",    "value": "={{ $json.duration_minutes || Math.round(($json.duration || 0) / 60) }}", "type": "number" },
            { "id": "4", "name": "speakerName",    "value": "={{ $json.speaker_name || '{{ YOUR_NAME }}' }}", "type": "string" },
            { "id": "5", "name": "recordedAt",     "value": "={{ $json.recorded_at || $now }}", "type": "string" }
          ]
        },
        "options": {}
      },
      "id": "n2",
      "name": "Parse Recording Data",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "position": [420, 400]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.openai.com/v1/audio/transcriptions",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            { "name": "Authorization", "value": "Bearer {{ OPENAI_API_KEY }}" }
          ]
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            { "name": "model",          "value": "whisper-1" },
            { "name": "language",       "value": "en" },
            { "name": "response_format","value": "verbose_json" },
            { "name": "url",            "value": "={{ $json.recordingUrl }}" }
          ]
        },
        "options": {},
        "notes": "Uses OpenAI Whisper for transcription. Alternatively, use Fireflies.ai, Otter.ai, or AssemblyAI — all have n8n nodes or HTTP APIs."
      },
      "id": "n3",
      "name": "Transcribe Audio",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [640, 400]
    },
    {
      "parameters": {
        "model": "gpt-4o",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a content strategist. Your job is to extract the most compelling moments, hooks, and insights from a transcript. Output a JSON object with: top_moments (array of 6 short, punchy excerpts best suited for short-form video), core_thesis (1 sentence summary), key_stats (any numbers/claims made), blog_title (SEO-friendly title), email_subject_lines (5 subject lines for a nurture sequence)."
            },
            {
              "role": "user",
              "content": "=Extract from this transcript:\n\nTitle: {{ $('Parse Recording Data').item.json.title }}\nSpeaker: {{ $('Parse Recording Data').item.json.speakerName }}\nDuration: {{ $('Parse Recording Data').item.json.durationMin }} minutes\n\nTranscript:\n{{ $json.text }}"
            }
          ]
        },
        "options": {
          "response_format": { "type": "json_object" }
        }
      },
      "id": "n4",
      "name": "Extract Key Moments",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1,
      "position": [860, 400],
      "credentials": {
        "openAiApi": { "id": "openai-creds", "name": "OpenAI" }
      }
    },
    {
      "parameters": {
        "model": "gpt-4o",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a ghostwriter. Write in the speaker's voice — direct, confident, specific. No fluff. Write a 1,200-word blog post with an intro, 3-4 sections with subheadings, and a conclusion with a CTA. Output plain markdown."
            },
            {
              "role": "user",
              "content": "=Write a blog post based on this talk.\n\nTitle: {{ $('Parse Recording Data').item.json.title }}\nSEO title to use: {{ JSON.parse($('Extract Key Moments').item.json.message.content).blog_title }}\nCore thesis: {{ JSON.parse($('Extract Key Moments').item.json.message.content).core_thesis }}\n\nKey moments to expand on:\n{{ JSON.parse($('Extract Key Moments').item.json.message.content).top_moments.join('\\n') }}\n\nKey stats to include:\n{{ JSON.parse($('Extract Key Moments').item.json.message.content).key_stats }}\n\nFull transcript for reference:\n{{ $('Transcribe Audio').item.json.text }}"
            }
          ]
        },
        "options": {}
      },
      "id": "n5",
      "name": "Write Blog Post",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1,
      "position": [1100, 180],
      "credentials": {
        "openAiApi": { "id": "openai-creds", "name": "OpenAI" }
      }
    },
    {
      "parameters": {
        "model": "gpt-4o",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are an email copywriter. Write a 5-email nurture sequence based on a piece of content. Each email should be short (150-250 words), add genuine value, and end with a soft CTA. Write in the speaker's direct, confident voice. Output JSON array with: [{subject, body}]."
            },
            {
              "role": "user",
              "content": "=Write a 5-email nurture sequence based on:\n\nTitle: {{ $('Parse Recording Data').item.json.title }}\nCore thesis: {{ JSON.parse($('Extract Key Moments').item.json.message.content).core_thesis }}\nSuggested subject lines: {{ JSON.parse($('Extract Key Moments').item.json.message.content).email_subject_lines.join(', ') }}\n\nKey moments:\n{{ JSON.parse($('Extract Key Moments').item.json.message.content).top_moments.join('\\n') }}"
            }
          ]
        },
        "options": {
          "response_format": { "type": "json_object" }
        }
      },
      "id": "n6",
      "name": "Write Email Sequence",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1,
      "position": [1100, 340],
      "credentials": {
        "openAiApi": { "id": "openai-creds", "name": "OpenAI" }
      }
    },
    {
      "parameters": {
        "model": "gpt-4o",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a social media copywriter. Write 12 posts across LinkedIn and Twitter/X based on a piece of content. Mix formats: stats, quotes, hot takes, story hooks, listicles. Each LinkedIn post max 250 words. Each X post max 280 characters. Output JSON array: [{platform, post}]."
            },
            {
              "role": "user",
              "content": "=Write 12 social posts (6 LinkedIn, 6 X/Twitter) based on:\n\nTitle: {{ $('Parse Recording Data').item.json.title }}\nSpeaker: {{ $('Parse Recording Data').item.json.speakerName }}\nCore thesis: {{ JSON.parse($('Extract Key Moments').item.json.message.content).core_thesis }}\nKey moments: {{ JSON.parse($('Extract Key Moments').item.json.message.content).top_moments.join('\\n') }}\nKey stats: {{ JSON.parse($('Extract Key Moments').item.json.message.content).key_stats }}"
            }
          ]
        },
        "options": {
          "response_format": { "type": "json_object" }
        }
      },
      "id": "n7",
      "name": "Write Social Posts",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1,
      "position": [1100, 500],
      "credentials": {
        "openAiApi": { "id": "openai-creds", "name": "OpenAI" }
      }
    },
    {
      "parameters": {
        "model": "gpt-4o",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a course content creator. Write 6 short-form video scripts based on key moments from a longer recording. Each script should be 60-90 seconds when read aloud (~150-200 words). Include a strong hook in the first sentence. Output JSON array: [{hook, script, caption, hashtags}]."
            },
            {
              "role": "user",
              "content": "=Write 6 short video scripts from:\n\nTop moments:\n{{ JSON.parse($('Extract Key Moments').item.json.message.content).top_moments.join('\\n') }}\n\nCore thesis: {{ JSON.parse($('Extract Key Moments').item.json.message.content).core_thesis }}"
            }
          ]
        },
        "options": {
          "response_format": { "type": "json_object" }
        }
      },
      "id": "n8",
      "name": "Write Clip Scripts",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1,
      "position": [1100, 660],
      "credentials": {
        "openAiApi": { "id": "openai-creds", "name": "OpenAI" }
      }
    },
    {
      "parameters": {
        "sendTo": "{{ YOUR_EMAIL }}",
        "subject": "=25 assets ready — {{ $('Parse Recording Data').item.json.title }}",
        "emailType": "html",
        "message": "=<p>Your content batch from <strong>{{ $('Parse Recording Data').item.json.title }}</strong> is ready.</p><h3>What was created:</h3><ul><li>1 blog post (1,200 words)</li><li>5-email nurture sequence</li><li>12 social posts (6 LinkedIn, 6 X)</li><li>6 short-form video scripts</li></ul><h3>Blog post:</h3><pre style=\"white-space:pre-wrap\">{{ $('Write Blog Post').item.json.message.content }}</pre>",
        "options": {}
      },
      "id": "n9",
      "name": "Email Content Bundle",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [1360, 420],
      "credentials": {
        "gmailOAuth2": { "id": "gmail-creds", "name": "Gmail" }
      }
    }
  ],
  "connections": {
    "New Recording Webhook": { "main": [[{ "node": "Parse Recording Data",  "type": "main", "index": 0 }]] },
    "Parse Recording Data":  { "main": [[{ "node": "Transcribe Audio",       "type": "main", "index": 0 }]] },
    "Transcribe Audio":      { "main": [[{ "node": "Extract Key Moments",    "type": "main", "index": 0 }]] },
    "Extract Key Moments": {
      "main": [[
        { "node": "Write Blog Post",      "type": "main", "index": 0 },
        { "node": "Write Email Sequence", "type": "main", "index": 0 },
        { "node": "Write Social Posts",   "type": "main", "index": 0 },
        { "node": "Write Clip Scripts",   "type": "main", "index": 0 }
      ]]
    },
    "Write Blog Post":      { "main": [[{ "node": "Email Content Bundle", "type": "main", "index": 0 }]] },
    "Write Email Sequence": { "main": [[{ "node": "Email Content Bundle", "type": "main", "index": 0 }]] },
    "Write Social Posts":   { "main": [[{ "node": "Email Content Bundle", "type": "main", "index": 0 }]] },
    "Write Clip Scripts":   { "main": [[{ "node": "Email Content Bundle", "type": "main", "index": 0 }]] }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "id": "wf-06-content-multiplier",
  "versionId": "1.0.0"
}
