Generate Live Docsify Docs with n8n Automation

This workflow automates generating, editing, and serving n8n workflow documentation as live Docsify Markdown pages hosted via n8n webhooks. It solves manual documentation drudgery by creating, editing, previewing, and saving workflow docs including Mermaid diagrams, saving hours of time.
webhook
set
html
+15
Workflow Identifier: 1941
NODES in Use: Set, ConvertToFile, If, ExtractFromFile, Html, RespondToWebhook, Switch, NoOp, ReadWriteFile, N8n, Code, Merge, ExecuteCommand, LangchainChainLlm, LangchainLmChatOpenAi, LangchainOutputParserStructured, LangchainOutputParserAutofixing, Webhook
Automate Docsify docs with n8n and Langchain

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What this workflow does

This workflow creates live documentation for n8n workflows. It solves the problem of manually writing and updating workflow docs, avoiding mistakes and outdated information. The result is a system that shows up-to-date Markdown documentation with diagrams, editable in a web page, all automated by n8n.

The workflow serves HTML pages using Docsify. It checks if requested doc files exist. If not, it makes new Markdown files with workflow info and Mermaid diagrams. Users can view, live-edit, and save docs through HTTP requests handled by n8n.


Who should use this workflow

If you spend too much time writing or fixing workflow documentation, this tool helps. Teams working with many n8n workflows that need clear, visual docs will find it useful. It fits well for people running self-host n8n or open n8n servers with write access to a docs folder.


Tools and services used

  • n8n platform: Manages the workflow automation and HTTP webhook endpoints.
  • Docsify: Generates live Markdown documentation and renders Mermaid diagrams on HTML pages.
  • Mermaid.js: Draws workflow node charts as flowcharts in docs.
  • OpenAI API: Generates natural language descriptions of workflows automatically.
  • File system access: Reads and writes Markdown documentation files in a project directory.

Inputs, Processing, and Outputs

Inputs

  • HTTP webhook requests specifying a documentation file or action.
  • n8n workflow data fetched via API based on requested files.
  • User-sent Markdown content for saving edited docs.

Processing steps

  • Check the requested filename and file type.
  • Load an existing Markdown doc file or auto-generate a new template for the workflow.
  • Use OpenAI API to create a text summary of the workflow JSON.
  • Generate Mermaid flowcharts based on workflow nodes and connections.
  • Merge AI text and Mermaid charts into a single Markdown doc.
  • Respond with Docsify HTML pages for viewing or live Markdown editing.
  • Write edited content back to Markdown file on save requests.

Outputs

  • Markdown documentation files with updated text and diagrams.
  • HTML pages that render Markdown live with Docsify and Mermaid visuals.
  • HTTP responses for success, error, or file content delivery.

Beginner step-by-step: How to build this in n8n

Import the workflow

  1. Download the provided workflow file using the Download button on this page.
  2. In the n8n editor, click “Import from File” and select the downloaded workflow JSON.

Configure credentials

  1. Add necessary API credentials: OpenAI API Key and n8n API access credentials.
  2. Update the CONFIG node with your file directory path (project_path) where Markdown docs will be saved.
  3. Set instance_url to your n8n instance URL, using environment variables if self-hosting.
  4. Check nodes that fetch workflows or save files and update any IDs, emails, or folder paths if required.

Test and activate

  1. Trigger the webhook URL with test HTTP requests for viewing or editing docs.
  2. Verify the documentation pages load with Mermaid diagrams and AI-generated text.
  3. If tests pass, activate the workflow in n8n to run automatically on HTTP requests.

This lets you produce and update live documentation easily without manual writing.


Common cases and errors

If your Mermaid diagrams do not show, verify Mermaid scripts load in HTML headers.

If docs do not load, check project_path is correct and n8n has file read/write access.

Saving edits may fail if permissions are missing or data format is invalid.

Ensure environment variables for URL and protocol match your n8n instance.


Customization ideas

  • Change project_path in CONFIG node to your preferred docs folder.
  • Edit Mermaid diagram shapes or node type mappings in the Generate Mermaid Chart node JavaScript.
  • Adjust live editor styles in the CSS of HTML_styles_editor.
  • Add authentication in webhook node settings to protect saving endpoints.
  • Add more Docsify plugins by inserting script lines into HTML_headers or HTML_docsify_include.

Summary of main results

✓ Automated live Markdown documentation generation for n8n workflows.
✓ Mermaid.js workflow diagrams built from real workflow node data.
✓ Web viewing and live editing of docs with instant preview.
✓ Docs saved back to filesystem, ensuring docs never get out of sync.
✓ HTTP APIs provided for easy access by teams or other tools.


Automate Docsify docs with n8n and Langchain

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

It fetches workflow data using the n8n API, generates text descriptions with OpenAI, then creates Mermaid diagrams from the workflow node structure. These are combined into Markdown docs served through HTTP.
Yes, users can open a live Markdown editor page via the HTTP webhook, edit docs with preview, and save changes back to the document files.
The workflow detects missing files and generates a default documentation template along with a Mermaid diagram, so docs are never missing.
No authentication is included by default. Users should add security measures like tokens or IP filtering to protect the edit and save endpoints.
Author
Written By
Ritu Sanjali

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.