{
  "name": "Generate B2B lead magnet articles with AI deep research and Google Docs",
  "nodes": [
    {
      "id": "58a1733c-99e2-4dec-95bc-bb398cdb90b0",
      "name": "Submit Your Topic",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -256,
        736
      ]
    },
    {
      "id": "49398999-609c-4c5f-8ffe-238581250345",
      "name": "Refine into 5 Strategic Queries",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -32,
        736
      ]
    },
    {
      "id": "c560923d-f32b-4b3e-90e7-ad0ae8ab7050",
      "name": "Validate Queries",
      "type": "n8n-nodes-base.code",
      "position": [
        320,
        736
      ]
    },
    {
      "id": "5eaa1623-3220-4524-a69f-b991e397fa33",
      "name": "Split into 5 Research Tasks",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        544,
        736
      ]
    },
    {
      "id": "83517161-f82f-4afe-bf80-da76a356f815",
      "name": "Deep Web Researcher",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        768,
        736
      ]
    },
    {
      "id": "082e1c21-bfcd-42eb-8b49-f94c3e550dea",
      "name": "Parse Research Output",
      "type": "n8n-nodes-base.code",
      "position": [
        1120,
        736
      ]
    },
    {
      "id": "ec8f0ab9-7dff-443f-a74f-eb3e59e20b04",
      "name": "Build TOC and Compile Research",
      "type": "n8n-nodes-base.code",
      "position": [
        1568,
        736
      ]
    },
    {
      "id": "ef31a5e3-3b93-481f-8e8d-48cfe0b51942",
      "name": "Final Editor and Polish",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1792,
        736
      ]
    },
    {
      "id": "7d77d794-1c2d-4818-a271-fb38a0a85753",
      "name": "Prepare Document Content",
      "type": "n8n-nodes-base.code",
      "position": [
        2144,
        736
      ]
    },
    {
      "id": "9d954276-045f-4c05-a8ec-9493873ce98b",
      "name": "Create Google Doc",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2368,
        736
      ]
    },
    {
      "id": "4096dc3e-4c0e-433a-b1fa-e362f89b5485",
      "name": "Extract Doc ID",
      "type": "n8n-nodes-base.code",
      "position": [
        2592,
        736
      ]
    },
    {
      "id": "a6ed5aef-b453-4224-99d8-fc9f8664db5e",
      "name": "Build Format Requests",
      "type": "n8n-nodes-base.code",
      "position": [
        2816,
        736
      ]
    },
    {
      "id": "50243f02-0191-4caa-a1c0-9f45e5b608ba",
      "name": "Apply Formatting to Doc",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3040,
        736
      ]
    },
    {
      "id": "70830e27-a8ec-47bf-a394-e32ccb1a5c8f",
      "name": "Make Doc Shareable",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3264,
        736
      ]
    },
    {
      "id": "bc1d0fe2-b818-4ef9-b29e-c7d98330d9ff",
      "name": "Generate Chat Response",
      "type": "n8n-nodes-base.code",
      "position": [
        3488,
        736
      ]
    },
    {
      "id": "dc0e8a8c-920c-45b8-831d-cfecf998b6d6",
      "name": "Log to Tracking Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3488,
        528
      ]
    },
    {
      "id": "05c40466-e05c-4b92-a1f3-f69690558353",
      "name": "Ollama Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOllama",
      "position": [
        768,
        1120
      ]
    },
    {
      "id": "46c462e3-59d0-4b92-8951-99de86ba24b6",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1136,
        -240
      ],
      "parameters": {
        "width": 860,
        "height": 722,
        "content": "## Generate B2B lead magnet articles with AI deep research to Google Docs\n\nThis workflow transforms any topic into a comprehensive, research-backed B2B lead magnet article — automatically saved as a f"
      }
    },
    {
      "id": "4b304f68-6260-452d-82d9-3c5785244009",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        528
      ],
      "parameters": {
        "width": 280,
        "height": 152,
        "content": "## 1. Topic Refinement\nUser submits a topic via chat. AI refines it into 5 strategic research queries with SEO terms, angles, and target personas."
      }
    },
    {
      "id": "c4ee28ba-eb4a-461a-b165-984130559a7f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        688,
        496
      ],
      "parameters": {
        "width": 316,
        "height": 200,
        "content": "## 2. Parallel Deep Research\nEach of the 5 queries is researched independently by an AI agent, producing stats, examples, frameworks, and quotable insights (400–600 words each)."
      }
    },
    {
      "id": "79c74b31-76fc-4317-861d-4ee2b2fb5811",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1584,
        480
      ],
      "parameters": {
        "width": 324,
        "height": 216,
        "content": "## 3. Compile & Write Final Article\nAll research is merged into a structured document. A writing agent produces the complete 2,500–4,000 word lead magnet with formatting tags."
      }
    },
    {
      "id": "3eba0d7e-ff43-48aa-9270-a7c01046755e",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2512,
        464
      ],
      "parameters": {
        "width": 392,
        "height": 184,
        "content": "## 4. Format & Publish to Google Docs\nArticle is created as a Google Doc via API. Bold text and headings are applied programmatically. Public sharing is enabled automatically."
      }
    },
    {
      "id": "fea65222-8fba-4e64-82e9-6ae4cf3c0833",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3424,
        320
      ],
      "parameters": {
        "width": 256,
        "height": 152,
        "content": "## 5. Deliver & Track\nReturns edit, view, and PDF download links to the user via chat. Logs article metadata to Google Sheets for tracking."
      }
    },
    {
      "id": "6c07bfbd-8128-4ed4-befe-60083519941f",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        1104
      ],
      "parameters": {
        "width": 320,
        "height": 80,
        "content": "⚠️ **Update YOUR_AUTHOR_NAME** in this Code node to your actual name before running the workflow."
      }
    }
  ],
  "connections": {
    "Extract Doc ID": {
      "main": [
        [
          {
            "node": "Build Format Requests",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Queries": {
      "main": [
        [
          {
            "node": "Split into 5 Research Tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Google Doc": {
      "main": [
        [
          {
            "node": "Extract Doc ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ollama Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Refine into 5 Strategic Queries",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Deep Web Researcher",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Final Editor and Polish",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Submit Your Topic": {
      "main": [
        [
          {
            "node": "Refine into 5 Strategic Queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Make Doc Shareable": {
      "main": [
        [
          {
            "node": "Generate Chat Response",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log to Tracking Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Deep Web Researcher": {
      "main": [
        [
          {
            "node": "Parse Research Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Format Requests": {
      "main": [
        [
          {
            "node": "Apply Formatting to Doc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Research Output": {
      "main": [
        [
          {
            "node": "Build TOC and Compile Research",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Apply Formatting to Doc": {
      "main": [
        [
          {
            "node": "Make Doc Shareable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Final Editor and Polish": {
      "main": [
        [
          {
            "node": "Prepare Document Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Document Content": {
      "main": [
        [
          {
            "node": "Create Google Doc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split into 5 Research Tasks": {
      "main": [
        [
          {
            "node": "Deep Web Researcher",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build TOC and Compile Research": {
      "main": [
        [
          {
            "node": "Final Editor and Polish",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Refine into 5 Strategic Queries": {
      "main": [
        [
          {
            "node": "Validate Queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}