Quick overview
This workflow runs weekly to audit your n8n workflows with OpenAI, posts improvement reports to Slack, and stores per-workflow scan preferences in an n8n Data Table that users can toggle by reacting with :x: in Slack.
How it works
- Runs weekly on a schedule, retrieves all workflows via the n8n API, and merges them with an n8n Data Table list of workflows that are excluded from scanning.
- Iterates through the workflows that should be scanned and prepares a cleaned representation of each workflow (nodes, connections, and AI sub-node relationships) for analysis.
- Uses OpenAI to group the workflow canvas into logical sections and generates a structured overview, then creates and collision-resolves sticky notes to document the workflow before exporting the updated workflow JSON.
- Parses the exported workflow and uses OpenAI to produce a scored audit report with workflow-level and node-level improvement suggestions.
- Sends the audit summary, scores, and issues to a Slack channel as a rich block message and adds an :x: reaction to the posted message.
- Waits briefly and then upserts the workflow’s ID, name, scan flag, and Slack message timestamp into the n8n Data Table for tracking and future runs.
- Listens for Slack reaction events, and when a user adds or removes an :x: reaction on a report message, updates the Data Table to disable or re-enable scanning for the associated workflow and posts a confirmation to Slack.
Setup
- Create an n8n API key credential and ensure the instance has permission to list workflows.
- Add OpenAI API credentials for the OpenAI Chat Model nodes.
- Add Slack OAuth credentials for both the Slack action nodes and the Slack Trigger, and set the target channel where reports and reactions are handled.
- Run the manual trigger once to create the “AI Workflow Improvements” n8n Data Table and confirm the workflow uses the correct table ID in the Data Table nodes.
- In Slack, enable event subscriptions for the Slack Trigger and configure the generated webhook so reaction_added and reaction_removed events are delivered for the selected channel.
Requirements
- OpenAI API Key, Slack Account
Additional info
Need help? Contact us here or visit sailingbyte.com!
Happy auditing!