Auto-audit n8n workflows and generate Notion docs with Claude Sonnet
Upload n8n workflow JSON → auto-audit for reliability & security → Claude drafts business summary & tech report → write to Notion in batches
- Who
- Operators or automation developers who need to audit n8n workflows and produce documentation pages
- You get
- After submitting a workflow JSON, a formatted Notion page with audit score, business summary, and technical audit report appears within 30–60 seconds
- You need
- n8n · notion
Constraints
Prerequisites: a running n8n instance; an Anthropic API account with Claude Sonnet access; a Notion integration token with write access to the target workspace, and the integration added to the target parent page under Connections. Costs: Anthropic API usage billed by tokens; Notion API is typically within free-tier limits.
What they did
Author mychel-garzon published this workflow template on the n8n official template gallery. The template receives a user-uploaded workflow JSON via an n8n form trigger, validates structure through custom code nodes, performs topological sorting and static security auditing, calls Claude Sonnet to generate a business summary and technical audit report, then converts the output to Notion blocks and writes them paginated to a new page.
How it went
The source description states that the Notion documentation page appears within 30–60 seconds after form submission, depending on workflow size. (author_report)
Worth knowing
Wait node: description.md describes a 350 ms wait, but workflow.json shows Wait node parameter amount=35 with no unit specified; verify and manually adjust to 350 ms after import. Split In Batches node does not explicitly set batchSize, using the default. Notion writes use batched appends to respect API rate limits. This site has not imported or run the workflow (reproduction=not_tested); behavior may differ from latest n8n/Anthropic/Notion APIs. Keep high-privilege credentials secure and do not hardcode them in prompts or node parameters.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- Create Notion Document node: connect Notion API credentials.
- Append to Notion Document node: connect Notion API credentials.
Configuration to replace
- Source template is n8n public workflow #16658 (~22 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-24
Steps
Import template and connect credentials
Import the workflow template into n8n. Bind your Anthropic account credential to the Claude Model Interaction node; bind your Notion account credential to both the Create Notion Document and Append to Notion Document nodes. In Notion, open the target parent page, go to page settings → Connections, and add your integration to grant write access.
Submit workflow JSON via form
Activate the workflow and open the form URL. Upload an exported n8n workflow JSON file (.json), enter the Client Name, and paste the 32-character Notion parent page ID (from the page URL, without dashes). Form fields: Workflow JSON (required, .json only), Client Name (required), Notion Parent Page ID (required).
Validate JSON and run static audit
The workflow automatically reads the uploaded JSON, validates that nodes array and connections object exist, then performs graph analysis: Kahn topological sort for execution order, cycle and unreachable-node detection, plus security scanning for hardcoded secrets, missing timeouts, unauthenticated webhooks, and missing error-handling branches, producing a scored findings list.
Construct AI prompt
Audit results are assembled into a structured prompt for Claude Sonnet. The system instruction demands raw JSON with exactly two keys (businessLogic + auditReport), no markdown fences. The user payload includes workflow name, node count, audit score, execution order, and findings list.
Execution prompt · Source text。Construct AI Prompt node system field
You are an automation consultant writing client documentation. Return ONLY a raw JSON object with two keys — no markdown fences, no preamble: { "businessLogic": "<150-300 word plain-English summary of what this workflow does, when it runs, and what outcomes it produces. No technical node names.>", "auditReport": "<Developer-facing audit findings in Markdown. Bold each severity label. End with an overall assessment paragraph. If no findings, say so.>" }Execution prompt · Source text。Construct AI Prompt node user template field
Workflow: ${d.workflowName} Client: ${d.clientName} Nodes: ${d.nodeCount} | Audit Score: ${d.score}/100 ${d.hasCycles ? 'WARNING: cycles detected in ' + d.cycleNodes.join(', ') : ''} EXECUTION ORDER: ${d.nodeList} AUDIT FINDINGS: ${d.findingsSummary}Generate documentation and parse response
After Claude Sonnet returns text, the Interpret AI Response node strips markdown fences and parses JSON, validating that both businessLogic and auditReport fields exist. If the model returns empty or malformed output, the workflow throws an error into the error-handling branch.
Create Notion page and append blocks in batches
The Formulate Notion Blocks node converts parsed content into Notion block objects (score callout, business summary, technical audit report, plus cycle/unreachable warnings). Create Notion Document creates a new page under the specified parent, then Split In Batches loops to append blocks with a wait of ~350 ms between batches to avoid Notion rate limits. The source description says 350 ms, but the workflow.json Wait node has amount=35 with no unit specified; after import, verify and adjust to 350 ms or reconfigure based on current Notion API limits. [First-test safety] Before the first test, use a test Notion workspace/parent page, or temporarily disconnect the Notion page-create write nodes; write to production only after the doc content looks correct.
Prompt you can copy
Setup guidance · Editorial suggestion。Setup assistant to help complete credential configuration and form field confirmation
This block is the prompt. Ads are never placed here.
You are a setup assistant for the n8n Workflow Auditor & Notion Doc Generator. The user needs to: 1) configure Anthropic and Notion credentials; 2) confirm form fields and the target Notion parent page ID; 3) know how to export an n8n workflow JSON. Provide a next-step checklist based on the user's credential status and page ID.
Confirm Anthropic API key and Notion integration token are ready before obtaining the parent page ID.
Source
Generate workflow audit docs from JSON with Claude Sonnet and Notion · mychel-garzon · n8n.io · 2026-06-27
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.