{
  "nodes": [
    {
      "id": "9a0f0715-0f7f-4779-8f3a-c35bcf2ca175",
      "name": "New content - generate research questions",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -1008,
        528
      ],
      "parameters": {
        "text": "=Content title:  {{ $json.Title }}\n\nArticle guidelines: {{ $json.Guidelines }}\n\n",
        "messages": {
          "messageValues": [
            {
              "message": "=You will receive a content title and an angle. Return 5\u20138 non-overlapping questions in JSON array format that cover everything needed to write excellent content as it breaks down the topic into sub-questions.\n\nGuidelines:  \n- Start with simple, short broad questions for example to define the terms (e.g., What is X?, Why is X important?, How to do X?).  \n- Then move into more specific, advanced, or analytical questions.  \n- Ensure questions together form a complete coverage of the topic.   \n\n## Output format:\n\nYou'll return the questions in such a JSON ARRAY:\n\n[\n  {\n    \"question\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit?\"\n  },\n  {\n    \"question\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua?\"\n  },\n  {\n    \"question\": \"Lorem ipsum dolor sit amet?\"\n  },\n  {\n    \"question\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua, ut enim ad minim veniam?\"\n  },\n  {\n    \"question\": \"Lorem ipsum dolor sit amet, consectetur?\"\n  }\n]"
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.5
    },
    {
      "id": "97aa9da3-f03f-4ef5-8645-6ca9a941dfd4",
      "name": "Format question and answer",
      "type": "n8n-nodes-base.set",
      "position": [
        320,
        768
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1e33a1f4-a1a2-4962-ac72-cc518d7ff043",
              "name": "Question",
              "type": "string",
              "value": "={{ $('Loop Over Questions').item.json.question }}"
            },
            {
              "id": "903bcf38-13dd-48fb-8eb3-83f7a232aa53",
              "name": "Answer",
              "type": "string",
              "value": "={{ $json.answer.replace(/\\{\\[(\\d+)\\]\\((.*?)\\)\\}/g, '([source]($2))') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "8ce76a1b-d79b-43e7-8b47-c61b6167b1af",
      "name": "New content - Generate the AI output",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        144,
        -48
      ],
      "parameters": {
        "text": "=Article title:\n\n{{ $('Prepare form values').first().json.Title }}\n\nArticle guidelines:\n\n{{ $('Prepare form values').first().json.Guidelines }}\n\n\nContent to leverage:\n\nThis Q&A research provides high-quality knowledge, insights, and sources for your content. Be sure to include source links in your output whenever a source was used.\n\n{{ JSON.stringify($json['questions and answers'], null, 2) }}\n",
        "messages": {
          "messageValues": [
            {
              "message": "=# Role\n\nYour role is to write an article based on the request in the user message.\n\n# What the user message contains\n\nThe user message includes the article title, any guidelines to follow, and comprehensive research material. This research is the sole basis for your article \u2014 do not invent information beyond it. When the research includes source links, integrate them smoothly as hyperlinks in the article.\n\n# How to write good articles\n\nYou excel at writing articles by making sure that they deliver value, are concise, seem like they are human-written, not using typical AI useless sentence formulations.\n\n# Your output format\n\nOutput only the full article.\n\n* Begin with a `# H1` title.\n* Use subheadings throughout the article."
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.5
    },
    {
      "id": "97939f7a-faf8-4b86-a566-ac55a1f3272a",
      "name": "New article form",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1568,
        528
      ],
      "parameters": {
        "options": {},
        "formTitle": "New article",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Article title",
              "placeholder": "10 ways to do Influencer Marketing in 2025",
              "requiredField": true
            },
            {
              "fieldLabel": "Article guidelines",
              "placeholder": "Promote xyz and write in British English...",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Fill in this form to trigger the generation of a new article."
      },
      "typeVersion": 2.3
    },
    {
      "id": "dda874a4-b51e-46f1-b99b-a181beaae73c",
      "name": "Prepare form values",
      "type": "n8n-nodes-base.set",
      "position": [
        -1312,
        528
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ec4734ed-654f-478a-ab90-91bfcee1e208",
              "name": "Title",
              "type": "string",
              "value": "={{ $json['Article title'] }}"
            },
            {
              "id": "c034402e-a7b9-4c91-aaed-f24a838c3d91",
              "name": "Guidelines",
              "type": "string",
              "value": "={{ $json['Article guidelines'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "86265d5e-ad97-429c-af6b-3876b8d14a83",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -880,
        752
      ],
      "parameters": {
        "jsonSchemaExample": "[\n  {\n    \"question\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit?\"\n  },\n  {\n    \"question\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua?\"\n  },\n  {\n    \"question\": \"Lorem ipsum dolor sit amet?\"\n  },\n  {\n    \"question\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua, ut enim ad minim veniam?\"\n  },\n  {\n    \"question\": \"Lorem ipsum dolor sit amet, consectetur?\"\n  }\n]"
      },
      "typeVersion": 1.2
    },
    {
      "id": "41053ca5-776c-4f11-84ee-9799a44546f6",
      "name": "GPT 5 mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1008,
        752
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini",
          "cachedResultName": "gpt-5-mini"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "a41214eb-8650-43ab-9a29-26709c89e838",
      "name": "Split Out Questions",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -608,
        528
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "output"
      },
      "typeVersion": 1
    },
    {
      "id": "fe8a86db-6972-4416-8223-ae7b9bc3c90f",
      "name": "Loop Over Questions",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -352,
        512
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "d6d46dbf-c20f-4c0d-a9f8-c3d3059d0678",
      "name": "Query Super Assistant",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -32,
        544
      ],
      "parameters": {
        "url": "https://api.super.work/v1/super",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "question",
              "value": "={{ $json.question }}"
            },
            {
              "name": "assistantId",
              "value": "YOUR-ASSISTANT-ID"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1e6c7b70-60e0-44f9-a418-82b806b8d9ae",
      "name": "GPT 5 chat",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        224,
        176
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-chat-latest",
          "cachedResultName": "gpt-5-chat-latest"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "8b34795b-bc61-4c27-88dd-8a942c50a44a",
      "name": "Article result",
      "type": "n8n-nodes-base.set",
      "position": [
        560,
        -48
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "d3b8c4bc-27d9-4d57-b8d6-3a40b84d7b7d",
              "name": "Article",
              "type": "string",
              "value": "={{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5afd58d4-99f9-48c2-9d34-3d353cbbfc6f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        512
      ],
      "parameters": {
        "color": 7,
        "width": 224,
        "height": 320,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\r\n\n\n\n\n\n### Connect your super.com credentials & replace your assistant ID"
      },
      "typeVersion": 1
    },
    {
      "id": "5429c604-cf0e-4635-b47e-7f436a5399c7",
      "name": "Aggregate research content",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -112,
        160
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "Content to leverage"
      },
      "typeVersion": 1
    },
    {
      "id": "b86d6f11-dd1a-4b65-8342-6420b8ee4b61",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        -256
      ],
      "parameters": {
        "width": 832,
        "height": 560,
        "content": "# AI Article Writer Based on Your Knowledge Base\n\nThis isn't just a writer; it's an automated research and content team. It generates high-quality, reliable articles by grounding the entire process in *your own* knowledge base.\n\n## How it works\n1.  **Decompose:** An AI planner breaks your article topic into a series of sub-questions.\n2.  **Research:** It queries your **Super assistant** to answer each question using *your* connected documents (Notion, Drive, etc.).\n3.  **Write:** A final, powerful AI writes the article based *only* on this verified research, including source links.\n\n## How to use\n1.  **Set up in Super:** First, build your assistant in **Super** with your knowledge sources and get your **API Token** & **Assistant ID**.\n2.  **Configure this workflow:**\n    * Connect your **AI provider** to the LLM nodes.\n    * In the **Query Super Assistant** node, add your **Assistant ID** and **API Token**.\n3.  **Run:** Use the form to enter a title and guidelines, and let the workflow generate your article.\n\n\n*A template built by Guillaume Duvernay*"
      },
      "typeVersion": 1
    },
    {
      "id": "615bc59d-5d05-4986-9bee-5a8ac089a390",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        384
      ],
      "parameters": {
        "color": 6,
        "width": 976,
        "height": 608,
        "content": "## Answering each sub-question one by one with Super"
      },
      "typeVersion": 1
    },
    {
      "id": "a256f168-dbac-4a99-9617-32641916fae2",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -208
      ],
      "parameters": {
        "color": 5,
        "width": 368,
        "height": 512,
        "content": "## AI step writing the final article based on the research and initial request"
      },
      "typeVersion": 1
    },
    {
      "id": "b909335e-7b65-41e8-b716-65605a278d29",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        384
      ],
      "parameters": {
        "color": 6,
        "width": 480,
        "height": 608,
        "content": "## Breaking down the topic into sub-questions"
      },
      "typeVersion": 1
    },
    {
      "id": "b0e02f1f-73b2-4834-8a0e-2251ac1f53e1",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1648,
        400
      ],
      "parameters": {
        "color": 4,
        "width": 272,
        "height": 304,
        "content": "## Fill in this form to request a new article"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "GPT 5 chat": {
      "ai_languageModel": [
        [
          {
            "node": "New content - Generate the AI output",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "GPT 5 mini": {
      "ai_languageModel": [
        [
          {
            "node": "New content - generate research questions",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "New article form": {
      "main": [
        [
          {
            "node": "Prepare form values",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Questions": {
      "main": [
        [
          {
            "node": "Aggregate research content",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Query Super Assistant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare form values": {
      "main": [
        [
          {
            "node": "New content - generate research questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Questions": {
      "main": [
        [
          {
            "node": "Loop Over Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Query Super Assistant": {
      "main": [
        [
          {
            "node": "Format question and answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "New content - generate research questions",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate research content": {
      "main": [
        [
          {
            "node": "New content - Generate the AI output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format question and answer": {
      "main": [
        [
          {
            "node": "Loop Over Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New content - Generate the AI output": {
      "main": [
        [
          {
            "node": "Article result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New content - generate research questions": {
      "main": [
        [
          {
            "node": "Split Out Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}