{
  "name": "Generate knowledge base articles with GPT & Perplexity AI for Contentful CMS",
  "nodes": [
    {
      "id": "17900021-8da3-4bd9-9d79-5d20d879ddc7",
      "name": "Create Perplexity Content",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1220,
        380
      ]
    },
    {
      "id": "0cb3f3a7-92bd-4ff3-8a89-b6fc29513e65",
      "name": "AI Writer Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        720,
        380
      ]
    },
    {
      "id": "bc62facb-c5cb-465d-89b1-a65a893c3ce1",
      "name": "AI Editor Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2280,
        380
      ]
    },
    {
      "id": "8c08d67a-b916-4cfd-89cd-16b34250bcb2",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        680,
        640
      ]
    },
    {
      "id": "97bb1374-f502-4152-a5a3-bc5d46a18171",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2200,
        660
      ]
    },
    {
      "id": "1c422e76-5b1a-4615-b379-ab39d4bd13b4",
      "name": "Accept and Publish",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        2420,
        660
      ]
    },
    {
      "id": "b6807e84-900a-48fc-a869-862824c62ba1",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -60,
        660
      ]
    },
    {
      "id": "e3021ac4-9444-4689-af0c-a4bbd4729c35",
      "name": "JSON.parse1",
      "type": "n8n-nodes-base.code",
      "position": [
        1320,
        120
      ]
    },
    {
      "id": "d6a5eccd-c8e3-4ee0-beb0-7b8fc8428b91",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1840,
        380
      ]
    },
    {
      "id": "8461a1a0-a984-4ec1-bc93-3a1a312caf55",
      "name": "Format",
      "type": "n8n-nodes-base.code",
      "position": [
        2060,
        380
      ]
    },
    {
      "id": "9b9a82fb-990c-4be0-aee9-ed80f0631c28",
      "name": "JSON.parse",
      "type": "n8n-nodes-base.code",
      "position": [
        3300,
        840
      ]
    },
    {
      "id": "066dfd10-e97a-44a8-89e0-5b2b5c4a6244",
      "name": "Format Perplexity Output & Add Citations",
      "type": "n8n-nodes-base.code",
      "position": [
        1480,
        380
      ]
    },
    {
      "id": "fc9d9e93-568a-41af-a295-8736617b157e",
      "name": "Initialize Count",
      "type": "n8n-nodes-base.set",
      "position": [
        340,
        660
      ]
    },
    {
      "id": "b0e636dd-f572-4ee2-832f-4bb4167b011b",
      "name": "Increment Count",
      "type": "n8n-nodes-base.function",
      "position": [
        1400,
        740
      ]
    },
    {
      "id": "86689f0e-9607-4eda-bcd6-36241d0cbe63",
      "name": "Check Limit",
      "type": "n8n-nodes-base.if",
      "position": [
        2660,
        380
      ]
    },
    {
      "id": "0f42b0f3-0b96-40df-9c06-2a6d31e142d9",
      "name": "Stop Here",
      "type": "n8n-nodes-base.noOp",
      "position": [
        2980,
        300
      ]
    },
    {
      "id": "1e61b3ba-e9bd-43c7-8217-d4a22f707318",
      "name": "Execute Workflow",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        3680,
        320
      ]
    },
    {
      "id": "04526224-e48c-4032-9c92-475c6bf9cd0a",
      "name": "JSON.parse3",
      "type": "n8n-nodes-base.code",
      "position": [
        3280,
        300
      ]
    },
    {
      "id": "0303ab91-b788-4074-a15d-239565528dec",
      "name": "should submit",
      "type": "n8n-nodes-base.if",
      "position": [
        2980,
        680
      ]
    },
    {
      "id": "4f68e1ad-0b7c-41ca-a9cc-d220017cc1bd",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        540,
        80
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "f5e9968a-0681-4b72-9bb3-98750f55565e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2620,
        120
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "462e6c9a-162a-4f66-b846-14b29517454c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2120,
        160
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "27149a0a-ab95-4f73-a20c-34167ac56d2a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3520,
        60
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "3b6386cc-7965-47ae-88e3-8841ada43579",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -220,
        -180
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "376c9b0d-8ef6-4681-900d-745d4353cc83",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3520,
        580
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format": {
      "main": [
        [
          {
            "node": "AI Editor Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Stop Here": {
      "main": [
        [
          {
            "node": "JSON.parse3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "JSON.parse": {
      "main": [
        [
          {
            "node": "AI Writer Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Increment Count",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Limit": {
      "main": [
        [
          {
            "node": "Stop Here",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "should submit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "JSON.parse1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "JSON.parse3": {
      "main": [
        [
          {
            "node": "Execute Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "should submit": {
      "main": [
        [
          {
            "node": "JSON.parse3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "JSON.parse",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Editor Agent": {
      "main": [
        [
          {
            "node": "Check Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Writer Agent": {
      "main": [
        [
          {
            "node": "Create Perplexity Content",
            "type": "main",
            "index": 0
          },
          {
            "node": "JSON.parse1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Increment Count": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Initialize Count": {
      "main": [
        [
          {
            "node": "AI Writer Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Increment Count",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Writer Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Accept and Publish": {
      "ai_tool": [
        [
          {
            "node": "AI Editor Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Editor Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Create Perplexity Content": {
      "main": [
        [
          {
            "node": "Format Perplexity Output & Add Citations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Initialize Count",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Perplexity Output & Add Citations": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}