{
  "name": "Generate PII-safe Helpdocs from Crisp Support chats with GPT-4.1-mini",
  "nodes": [
    {
      "id": "8e5d273c-6e7b-4478-83b1-9ee5c2647749",
      "name": "crisp",
      "type": "n8n-nodes-base.webhook",
      "position": [
        640,
        736
      ]
    },
    {
      "id": "c7617483-2442-4349-ac9b-1279baf0bed9",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1616,
        864
      ]
    },
    {
      "id": "f651678d-6155-40e4-abe5-c9a97f9563fa",
      "name": "get",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1088,
        640
      ]
    },
    {
      "id": "89620a25-f766-4f8b-933e-b8a070fca336",
      "name": "closed",
      "type": "n8n-nodes-base.if",
      "position": [
        864,
        736
      ]
    },
    {
      "id": "f6ee5bc3-953a-4f2a-a4be-b62e06bdf907",
      "name": "insert",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1088,
        832
      ]
    },
    {
      "id": "b8cc6245-5337-4846-ba98-4bd685595f46",
      "name": "format",
      "type": "n8n-nodes-base.code",
      "position": [
        1312,
        640
      ]
    },
    {
      "id": "1f63d5e0-4f3a-462d-b6aa-f9a6bdeb0571",
      "name": "Gen Help",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1536,
        640
      ]
    },
    {
      "id": "70bd923d-664b-44ac-abda-d5f0844487d2",
      "name": "store-doc",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1888,
        640
      ]
    },
    {
      "id": "1463b4c3-69c6-4ed8-8c40-57c9fbf76c7c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        368
      ],
      "parameters": {
        "width": 1072,
        "height": 176,
        "content": "## Crisp chat → Helpdoc generator\n\n### How it works\n1. Receive Crisp chat events via a webhook and trigger when a session is marked resolved.\n2. Save the chat messages to a raw chats datatable to capt"
      }
    },
    {
      "id": "eb65cade-fed9-443b-89bd-805b4e485e3d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        640
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "### Check if resolved"
      }
    },
    {
      "id": "9c653b23-4870-43e1-8dbb-84ea7249451d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        800
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "### Add chat to table"
      }
    },
    {
      "id": "129ad5e4-3ff0-4a8f-acc3-bf4731a788c8",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        560
      ],
      "parameters": {
        "width": 384,
        "height": 208,
        "content": "### Chat finished, format the chats into a Q+A "
      }
    },
    {
      "id": "dac54ef9-abe8-4f03-a080-17ff67fe4130",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        560
      ],
      "parameters": {
        "width": 528,
        "height": 208,
        "content": "### Create the Helpdoc and store it.\n#### You could add an email node or Google docs node after here too."
      }
    },
    {
      "id": "768593a2-0ffd-4ac4-b69d-46e1bbab3e17",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        640
      ],
      "parameters": {
        "width": null,
        "height": 224,
        "content": "### Use this in Crisp/Settings/Workspace settings/Advanced"
      }
    }
  ],
  "connections": {
    "get": {
      "main": [
        [
          {
            "node": "format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "crisp": {
      "main": [
        [
          {
            "node": "closed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "closed": {
      "main": [
        [
          {
            "node": "get",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "insert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "format": {
      "main": [
        [
          {
            "node": "Gen Help",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gen Help": {
      "main": [
        [
          {
            "node": "store-doc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Gen Help",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}