Library / Code, Git & Developer Tools
Code, Git & Developer Tools
Reactivate nightly maintenance workflows with Data Tables and the n8n API
On a schedule, it automates developer work using Data Table.
What it does
## 🌙 Maintenance ON — Nightly Workflow Shutdown Deactivates every currently active workflow on this n8n instance on a schedule, then logs what it turned off so a companion "Maintenance OFF" workflow can bring everything back the next morning. ### What it does 1. Fires on a schedule (default 22:30) 2. Fetches all active workflows via the n8n API 3. Skips itself and any workflow you list as excluded 4. Deactivates each remaining workflow 5. Logs workflow_id, workflow_name and deactivated_at to a Data Table, so "Maintenance OFF" knows exactly what to turn back on ### You need - An n8n API key (Settings → n8n API), added as credentials on both HTTP Request nodes - A Data Table with columns workflow_id (string), workflow_name (string), deactivated_at (date/time) - A companion "Maintenance OFF" workflow that reads that table and reactivates the listed workflows (not included in this template) ### Before you activate 1. Open Config and set base_url to your own instance URL 2. In excluded_workflow_ids, list — comma-separated — the workflow IDs to never touch (this workflow excludes itself automatically) 3. Connect your n8n API credential on both HTTP Request nodes 4. Pick or create your Data Table on Save to maintenance_log ⚠️ The "fetch active workflows" call uses limit=250. With more than 250 active workflows, add pagination (nextCursor).
The steps
- Ogni sera alle 22:30
- Config
- Recupera workflow pubblicati
- Estrai singoli workflow
- Escludi self e workflow esclusi
- Salva in maintenance_log
- Disattiva workflow
- Loop su ogni workflow
Similar automations
Customer Support & HelpdeskLog maintenance form requests to Google Sheets and email manager via Gmail4 stepsRAG & Knowledge BasesPlan Wind Farm Maintenance with OpenAI RAG and Weaviate10 stepsRAG & Knowledge BasesRemind About Farm Equipment Maintenance with OpenAI RAG10 stepsRAG & Knowledge BasesAlert on Predictive Maintenance Needs with OpenAI RAG10 steps