Dropbox: monitor folder and document new files

This workflow automates the documentation of newly added or modified code files in a Dropbox folder. Every 15 minutes it scans a target directory, filters for recent code changes, leverages DocuWriter.ai to generate documentation, comments, and UML diagrams, then uploads the outputs back to Dropbox, updates an index, creates a shareable link, and notifies the team via Slack and email.

Workflow Overview

flowchart TD
  A[⏰ File Monitor Schedule (15min)] --> B[🔎 Scan Dropbox Code Folder]
  B --> C[🗂️ Filter New Code Files]
  C --> D[⬇️ Download File Content]
  D --> E[🛠️ Prepare Source Code]
  E --> F1[📝 Generate Documentation]
  E --> F2[💬 Generate Code Comments]
  E --> F3[📊 Generate UML Diagrams]
  F1 & F2 & F3 --> G[🔗 Aggregate All Results]
  G --> H[📄 Create Documentation Files]
  H --> I1[☁️ Upload Documentation to Dropbox]
  H --> I2[☁️ Upload Commented Code]
  I1 & I2 --> J[📑 Get Existing Index]
  J --> K[📝 Update Documentation Index]
  K --> L[🔄 Upload Updated Index]
  L --> M[🌐 Create Shared Documentation Link]
  M --> N1[📣 Notify Team via Slack]
  M --> N2[✉️ Send Email Notification]

Nodes and Descriptions

Node Name Type Purpose
File Monitor Schedule (15min) n8n-nodes-base.cron Triggers the workflow every 15 minutes
Scan Dropbox Code Folder n8n-nodes-base.dropbox Searches /Code-to-Document for all files
Filter New Code Files n8n-nodes-base.code Filters code extensions modified in last 15 min
Download File Content n8n-nodes-base.dropbox Downloads the filtered file contents
Prepare Source Code n8n-nodes-base.code Normalizes payload for DocuWriter.ai
Generate Documentation docuwriter-ai Creates comprehensive code docs
Generate Code Comments docuwriter-ai Inserts inline comments
Generate UML Diagrams docuwriter-ai Produces UML visualizations
Aggregate All Results n8n-nodes-base.itemLists Combines multiple AI outputs into one payload
Create Documentation Files n8n-nodes-base.code Builds Markdown content and filenames
Upload Documentation to Dropbox n8n-nodes-base.dropbox Saves _documentation.md to /Documented-Code/
Upload Commented Code n8n-nodes-base.dropbox Saves commented source under /Documented-Code/Commented/
Get Existing Index n8n-nodes-base.dropbox Fetches documentation-index.json (fails gracefully)
Update Documentation Index n8n-nodes-base.code Merges new summary, sorts, and serializes index
Upload Updated Index n8n-nodes-base.dropbox Overwrites documentation-index.json with updated data
Create Shared Documentation Link n8n-nodes-base.dropbox Generates a public URL for the new doc
Notify Team via Slack n8n-nodes-base.slack Posts channel message with file info and link
Send Email Notification n8n-nodes-base.gmail Emails dev team with details and link

Key Configuration Snippet

{
  "id": "file-monitor-schedule",
  "name": "File Monitor Schedule (15min)",
  "type": "n8n-nodes-base.cron",
  "typeVersion": 1,
  "parameters": {
    "minutesInterval": 15
  }
}

This cron node ensures the workflow runs every 15 minutes .

Adaptation Tips

  • Folder Path: Change the path in Scan Dropbox Code Folder to monitor a different directory.
  • Time Window: Adjust the filter logic duration (currently 15 minutes) in Filter New Code Files.
  • Generation Instructions: Tweak prompts in Generate Documentation, Code Comments, and UML Diagrams for custom requirements.
  • Notification Channels: Swap Slack or Gmail nodes with Teams, Discord, or SMS integrations as needed.
  • Indexing: Enhance documentation-index.json schema to include tags, reviewers, or status flags.

By adapting parameters and nodes, you can repurpose this template for other cloud storage providers (e.g., Google Drive) or different output formats.