PII-Safe Help Documentation Generator from Support Chats using GPT - n8n Workflow

Use this powerful n8n workflow to automatically convert Crisp support chat transcripts into sanitized, PII-safe help documentation using the OpenAI GPT model. Ideal for knowledge base management.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Markdown-formatted:
Customer Support Managers seeking to automate knowledge base creation.
Technical writers needing rapid drafts of common customer solutions.
Organizations requiring strict PII compliance when handling internal support data.
Automation specialists looking for advanced examples of conditional logic and AI integration in an n8n workflow.

Overview

Generating high-quality, reusable help documentation from complex customer support transcripts is traditionally time-consuming and prone to exposing sensitive Personal Identifying Information (PII).

This specialized n8n workflow solves this by fully automating the process. It acts as an intelligent bridge between your live chat platform (Crisp) and your knowledge base. Every component in this n8n template works synergistically: the n8n trigger receives the resolution signal, custom code organizes the raw data, and the integrated OpenAI n8n node applies specific instructions to cleanse and format the output. This guarantees that your final help document is both accurate and compliant, saving significant manual effort and reducing risk. This sophisticated n8n workflow ensures your documentation scales efficiently.

How it Works

Markdown-formatted:
This automated process relies on two distinct branches handled by the initial n8n trigger and subsequent logic.


  1. Chat Logging (Continuous): The n8n workflow begins with the Webhook n8n node, acting as the primary n8n trigger for all Crisp events. Any message that is not a resolution signal is routed to the insert n8n node, which logs the raw chat data (message content, type, and session ID) into a dedicated 'raw chats' Data Table. This ensures the entire conversation history is captured.

  2. Resolution Trigger: When the state:resolved signal is received, the closed (If) n8n node directs the flow to the documentation generation path.

  3. Data Retrieval and Formatting: The get n8n node retrieves all related messages for that session ID from the 'raw chats' Data Table. The subsequent format (Code) n8n node then cleanses, sorts, and structures these messages into chronological Question & Answer pairs, preparing a clean formattedConversation string.

  4. AI Generation and PII Removal: The Gen Help (Chain LLM) n8n node, linked to the powerful OpenAI Chat Model n8n node, receives the formatted conversation. Crucially, the prompt enforces strict PII removal, replacing names and emails with generic placeholders like [USER_EMAIL]. The selected language model for this n8n workflow is gpt-4.1-mini.

  5. Final Storage: The resulting sanitized help document is stored in a separate 'helpdocs' Data Table via the store-doc n8n node, ready for final review or publishing.

Installation Guide

Markdown-formatted:


  1. Import the n8n Workflow: Copy the provided JSON data and import it directly into your n8n instance.

  2. Configure Crisp Webhook: Open the crisp (Webhook) n8n trigger node. Copy the unique URL generated by this n8n node. Navigate to your Crisp Workspace settings (Advanced -> Webhooks) and paste this URL to ensure Crisp sends chat events to your n8n workflow.

  3. Set up Credentials: Provide the API key for the OpenAI Chat Model n8n node. This connection is essential for the AI generation step of the n8n workflow.

  4. Configure Data Tables: Two internal Data Tables are required for this n8n template:

Find the ID of your 'raw chats' Data Table and update the dataTableId parameter in the get and insert n8n nodes.
Find the ID of your 'helpdocs' Data Table and update the dataTableId parameter in the store-doc n8n node.

  1. Activation: Ensure the n8n workflow is set to 'Active' to start listening for events.

Node Details

Markdown-formatted:
crisp (Webhook n8n trigger):
Function: Acts as the starting point (n8n trigger) of the n8n workflow, receiving POST requests from Crisp upon chat events.
Key Configuration: Uses a unique webhook path to ensure secure communication.
closed (If n8n node):
Function: Filters the incoming data stream, executing the documentation generation path only if the chat status matches state:resolved.
insert (Data Table n8n node):
Function: Logs all individual chat events (non-resolved) into the 'raw chats' Data Table for later full conversation retrieval. A crucial logging step in this n8n workflow.
get (Data Table n8n node):
Function: Retrieves all logged messages from the 'raw chats' Data Table matching the current session_id once the resolved signal is hit.
format (Code n8n node):
Function: Custom JavaScript n8n node to process raw JSON inputs, sort messages chronologically, separate them into user Questions and operator Answers, and compile them into a readable formattedConversation string for the LLM.
OpenAI Chat Model (LLM n8n node):
Function: Provides the computational engine for the AI processing. Uses the gpt-4.1-mini model.
Key Configuration: Requires OpenAI API credentials.
Gen Help (Chain LLM n8n node):
Function: Executes the core task of the n8n workflow. It uses a detailed prompt instructing the AI to transform the Q&A conversation into a structured help article and strictly remove or neutralize PII.
store-doc (Data Table n8n node):
Function: Saves the final, sanitized document text output by the AI into the 'helpdocs' Data Table.

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by

Coder.

Featured*