See llms.txt for all machine-readable content.

Back to Templates

Audit n8n workflows weekly with OpenAI, GitHub, Google Sheets and Slack

Quick overview

This workflow runs every Monday to audit your n8n instance for risky or unhealthy workflows, using OpenAI to review flagged items, tracking findings in Google Sheets, opening GitHub issues for serious items, and posting a weekly summary to Slack and Gmail.

How it works

  1. Runs every Monday at 8 AM and loads audit thresholds and your n8n base URL.
  2. Pulls recent failed executions and all workflows from the n8n API, then computes risk signals like unauthenticated webhooks, possible inline secrets in HTTP Request nodes, missing error handling, repeated failures, heavy Code usage, and staleness.
  3. Sends only the risky workflows to an OpenAI agent, which fetches each workflow’s full JSON (and recent failed runs when needed) to confirm issues, assign severity, and propose concrete fixes.
  4. Splits the agent’s findings into individual records and normalizes them into rows keyed by workflow and finding type.
  5. Compares this week’s findings with currently open rows in a Google Sheets “Findings” tab to classify each as new, still open, or fixed.
  6. Creates GitHub issues for new findings whose severity matches your configured threshold, updates Google Sheets with first/last seen timestamps and status, and closes fixed findings.
  7. Runs the built-in n8n security audit, has OpenAI generate a short weekly report, then posts it to Slack and emails it via Gmail.

Setup

  1. Create an n8n API key and add an n8n API credential, then set your n8n base URL in the audit settings.
  2. Add OpenAI credentials for the agent and report generation models.
  3. Create a Google Sheet with a “Findings” tab and columns for findingKey, workflowId, workflowName, findingType, severity, title, fix, status, firstSeen, lastSeen, issueUrl, and fixedAt, then connect Google Sheets and select the document.
  4. Connect GitHub credentials and set the target owner and repository for issue creation (and adjust the severities that should open issues).
  5. Connect Slack credentials and choose the channel for the weekly report and failure alerts.
  6. Connect Gmail credentials and set the report recipient email and any desired threshold values (failed runs scanned, staleness days, code node alert count) before enabling the schedule.