Animated data flow diagram

AI-Powered Documentation Generator for n8n Workflows with Docsify & OpenAI

Version: 1.0.0 | Last Updated: 2025-05-16

Integrates with:

OpenAI Docsify Mermaid

Overview

Unlock Automated & Intelligent Workflow Documentation with this AI Agent

This n8n workflow acts as a sophisticated AI Agent dedicated to creating and maintaining documentation for your other n8n workflows. It intelligently scans your n8n instance, uses OpenAI (GPT-4 Turbo) to generate descriptive content and node setting summaries, visualizes workflows with Mermaid.js, and serves it all through a clean, interactive Docsify website. Say goodbye to tedious manual documentation and keep your team aligned with always up-to-date insights into your automations.

Key Features & Benefits

  • AI-Powered Content Generation: Leverages OpenAI (GPT-4 Turbo) to intelligently create detailed descriptions and node configuration summaries for your n8n workflows.
  • Automated Docsify Site: Instantly generates a clean, searchable, and navigable documentation website using Docsify.js.
  • Dynamic Workflow Visualization: Automatically renders Mermaid.js flowcharts, providing a clear visual representation of each workflow's structure.
  • Interactive Markdown Editor: Includes a built-in live editor to review, refine, and save documentation pages, with real-time Docsify preview.
  • Centralized Workflow Overview: Offers a main dashboard listing all your n8n workflows, showing their status, and providing direct links to view, edit, or recreate documentation.
  • Tag-Based Navigation: Allows for easy filtering and browsing of workflow documentation by assigned tags.
  • Reduced Manual Effort: Significantly cuts down the time and resources needed for creating and maintaining workflow documentation, empowering your team to focus on building.
  • Version Control Friendly: Stores documentation as Markdown files, making it easy to integrate with version control systems.

Use Cases

  • Streamline internal knowledge management: Automatically generate and maintain up-to-date documentation for all your n8n automation workflows, making it easier for your team to understand, manage, and troubleshoot.
  • Accelerate developer onboarding: Provide new team members with a comprehensive, AI-assisted, and searchable documentation site for your n8n automations, reducing ramp-up time.
  • Ensure process consistency: Keep a clear, versioned record of your n8n workflows, complete with visual diagrams and AI-generated explanations, supporting governance and change management.
  • Boost productivity for solopreneurs & small teams: Quickly document your critical n8n-powered processes without the manual overhead, freeing up time to focus on core business activities.

Prerequisites

  • An n8n instance (Cloud or self-hosted) with an n8n API credential configured (for fetching workflow data).
  • OpenAI API Key with access to a GPT-4 model (e.g., gpt-4-turbo is used by default).
  • A writable directory accessible by your n8n instance for storing documentation Markdown files (e.g., on the server running n8n).
  • For self-hosted n8n: Ensure N8N_PROTOCOL and N8N_HOST environment variables are correctly set. For n8n Cloud, verify the instance_url in the 'CONFIG' node is correctly derived or manually set.
  • The n8n instance must have permissions to execute the mkdir command if the specified documentation project path doesn't exist.

Setup Instructions

  1. Download the n8n workflow JSON file.
  2. Import the workflow into your n8n instance.
  3. Configure the 'CONFIG' node:
    • Set project_path to your desired writable directory for documentation (e.g., ./.n8n/workflow_docs). The workflow will attempt to create this directory.
    • Verify instance_url is correctly resolving to your n8n instance's public URL. It uses $env["N8N_PROTOCOL"]}}://{{$env["N8N_HOST"]}} by default.
  4. In the 'OpenAI Chat Model' node (located within the 'Basic LLM Chain' group, which is connected to 'Auto-fixing Output Parser'), enter your OpenAI API Key and confirm the model (default is gpt-4-turbo).
  5. Update the n8n API credentials in the following nodes: 'Get All Workflows', 'Fetch Single Workflow1', and 'Get Workflow tags'.
  6. Review the main prompt in the 'Basic LLM Chain' node. You can customize the instructions given to the AI for generating documentation to match your preferred style or detail level.
  7. The workflow uses two webhook nodes: 'docsify' (path: 135bc21f-c7d0-4afe-be73-f984d444b43b) and 'single workflow' (path: /:file, ID also 135bc21f-c7d0-4afe-be73-f984d444b43b). Ensure these paths are accessible externally and don't conflict with other webhooks.
  8. Activate the workflow.
  9. Access the main documentation portal using the URL of the 'docsify' webhook node, typically YOUR_N8N_URL/webhook/135bc21f-c7d0-4afe-be73-f984d444b43b (replace YOUR_N8N_URL with your actual n8n instance URL).

Tags:

AI AgentDocumentation AutomationOpenAIDocsifyMermaidJSDeveloper ToolsProductivityContent Generation

Want your own unique AI agent?

Talk to us - we know how to build custom AI agents for your specific needs.

Schedule a Consultation