Skip to content

spydisec/spydi-n8n-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

n8n Automation Workflows

Production-ready n8n workflow automations for infrastructure management, monitoring, and operations

Validate Workflows License: MIT n8n

🎯 Overview

This repository contains automated workflows for n8n, covering:

  • πŸ—οΈ Infrastructure - Server and container management (Portainer, Docker, system updates)
  • πŸ“Š Monitoring - System health checks, alerts, and observability
  • πŸ’Ύ Backup - Automated backup routines and verification
  • πŸ“’ Notifications - Centralized alerting and reporting

All workflows are:

  • βœ… Production-tested
  • βœ… Fully documented with setup guides
  • βœ… Versioned with semantic versioning
  • βœ… Secure (no credentials in repository)
  • βœ… CI/CD validated on every commit

⚠️ Security Notice

This is a PUBLIC repository.

  • ❌ NO credentials or sensitive data are stored here
  • βœ… All credentials must be configured via n8n GUI
  • βœ… Example files use placeholder values only
  • βœ… .gitignore prevents accidental credential commits
  • βœ… GitHub Actions scans for sensitive data

See Security Guidelines below.

πŸš€ Quick Start

Prerequisites

  • n8n installed (>= 1.15.0) - Installation Guide
  • Access to target systems (servers, APIs, etc.)
  • Required credentials configured in n8n

Installation

  1. Clone this repository:

    git clone https://github.com/spydi/spydi-n8n-automation.git
    cd spydi-n8n-automation
  2. Configure server inventory:

    cp examples/configs/servers.example.json servers.json
    nano servers.json  # Update with your actual server details
  3. Set up credentials in n8n:

    • See examples/credentials/ for templates
    • Configure SSH, SMTP, Slack, etc. in n8n GUI
    • Never store actual credentials in files!
  4. Import workflows:

    • Open n8n β†’ Workflows β†’ Import from File
    • Select workflow JSON from workflows/ directory
    • Map credentials to your n8n credentials
    • Test in development first!

See docs/getting-started/ for detailed setup instructions.

πŸ“– Workflows

Infrastructure Automation

Workflow Version Description Status
Portainer Upgrade 1.0.0 Automated Portainer container upgrades with validation βœ… Stable

Monitoring & Alerts

Workflow Version Description Status
Coming soon - Server health monitoring 🚧 Planned

Backup Automation

Workflow Version Description Status
Coming soon - Database backup automation 🚧 Planned

Notifications

Workflow Version Description Status
Coming soon - Centralized notification router 🚧 Planned

View full workflow catalog β†’

πŸ“ Repository Structure

spydi-n8n-automation/
β”œβ”€β”€ workflows/              # n8n workflow files organized by category
β”‚   β”œβ”€β”€ infrastructure/     # Infrastructure management workflows
β”‚   β”œβ”€β”€ monitoring/         # Monitoring and alerting
β”‚   β”œβ”€β”€ backup/            # Backup automation
β”‚   └── notifications/     # Notification workflows
β”œβ”€β”€ docs/                  # Comprehensive documentation
β”‚   β”œβ”€β”€ getting-started/   # Setup and installation guides
β”‚   β”œβ”€β”€ guides/           # How-to guides and best practices
β”‚   β”œβ”€β”€ reference/        # Technical reference docs
β”‚   └── contributing/     # Contribution guidelines
β”œβ”€β”€ examples/             # Example configurations (NO sensitive data)
β”‚   β”œβ”€β”€ configs/         # Server inventory examples
β”‚   └── credentials/     # Credential setup templates
β”œβ”€β”€ templates/           # Workflow templates for new automations
β”œβ”€β”€ scripts/            # Validation and helper scripts
└── .github/workflows/  # CI/CD automation

πŸ” Security Guidelines

Never Commit:

❌ Credentials or API keys
❌ Server IPs/hostnames (use servers.example.json for templates)
❌ Environment-specific data
❌ Database connection strings
❌ SSH keys or certificates
❌ Real webhook URLs
❌ Email passwords

Always:

βœ… Use .example suffix for template files
βœ… Configure credentials via n8n GUI
βœ… Use n8n variables ($vars) for environment-specific data
βœ… Review files before committing
βœ… Let CI/CD catch sensitive data before merge

Credential Management

All sensitive credentials must be stored in n8n's credential manager:

  1. n8n β†’ Credentials β†’ New Credential
  2. Select type (SSH, SMTP, API, etc.)
  3. Enter credentials
  4. Reference by name in workflows

Never hardcode credentials in workflow JSON files.

See examples/credentials/ for setup guides.

πŸ› οΈ Development

Development Workflow

This project uses a branch-based development workflow to ensure stability:

  • main - Production-ready workflows (stable releases only)
  • develop - Pre-release testing (beta features, integration testing)
  • feature/* - Development branches for new workflows/features

Testing Stages:

  1. Local Testing - Test on development servers first
  2. Staging Testing - Integration testing in staging environment (24-48 hours)
  3. Production Release - Phased rollout with monitoring

Quick Start:

# Create feature branch
git checkout -b feature/my-new-workflow

# Develop and test locally
# ... make changes ...

# Create PR to develop branch
git push origin feature/my-new-workflow
# Open PR: feature/my-new-workflow β†’ develop

πŸ“– Complete Guides:

Adding a New Workflow

  1. Create workflow directory:

    git checkout develop
    git checkout -b feature/new-workflow
    mkdir -p workflows/[category]/[workflow-name]
    cd workflows/[category]/[workflow-name]
  2. Use templates:

    cp ../../../templates/_workflow-template/*.template.md .
    # Rename .template.md to .md and customize
  3. Required files:

    • workflow-name.json - n8n workflow export with metadata
    • README.md - Usage documentation
    • prerequisites.md - Setup requirements
    • troubleshooting.md - Common issues
    • CHANGELOG.md - Version history
  4. Add metadata to JSON:

    {
      "meta": {
        "templateVersion": "1.0.0",
        "author": "your-name",
        "category": "infrastructure",
        "description": "Brief description",
        ...
      }
    }
  5. Test locally (Stage 1):

    # Validate workflow
    python scripts/check-version.py
    bash scripts/check-sensitive-data.sh
    # Test on development servers
  6. Submit PR to develop:

    git add workflows/[category]/[workflow-name]
    git commit -m "feat: add [workflow-name] automation"
    git push origin feature/new-workflow
  7. Staging testing (Stage 2):

    • PR merged to develop
    • Test in staging environment for 24-48 hours
    • Monitor execution logs
  8. Production release (Stage 3):

    • PR from develop β†’ main
    • Tag release (e.g., v1.1.0)
    • Phased rollout with monitoring

See CONTRIBUTING.md for complete contribution guidelines.

Running Validation Locally

# Validate all workflows
./scripts/check-version.py           # Check version metadata
./scripts/validate-changelogs.sh     # Validate CHANGELOG format
./scripts/check-sensitive-data.sh    # Scan for credentials
./scripts/check-workflow-consistency.py  # Check file structure

πŸ“š Documentation

For End Users

For Contributors & Developers

Technical Reference

πŸ§ͺ Testing

Never test untested workflows on production servers!

This project uses a 3-stage testing process:

Stage 1: Local Testing (Development)

  • Test workflows on development/test servers only
  • Validate JSON syntax and metadata
  • Check for sensitive data exposure
  • Verify expected outcomes
# Validation
python scripts/check-version.py
bash scripts/check-sensitive-data.sh

# Test execution on dev servers

Stage 2: Staging Testing (Pre-Production)

  • Deploy to staging environment
  • Run workflows for 24-48 hours
  • Monitor execution logs
  • Verify integration with other systems
  • Performance and error rate monitoring

Stage 3: Production Deployment

  • Phased rollout (1-5 servers β†’ 25% β†’ 50% β†’ 100%)
  • Continuous monitoring
  • Rollback plan ready
  • Post-deployment verification

πŸ“– Complete Testing Guide: docs/guides/testing-workflows.md

See individual workflow documentation for specific testing instructions.

🀝 Contributing

We welcome contributions! This project follows a structured development workflow to ensure quality and stability.

Quick Start

  1. Fork this repository
  2. Create feature branch from develop: git checkout -b feature/new-automation
  3. Add your workflow following templates
  4. Test locally (Stage 1 testing required)
  5. Ensure all validations pass
  6. Update documentation
  7. Submit pull request to develop branch

Branching Strategy

  • main β†’ Production releases only (stable workflows)
  • develop β†’ Integration and staging testing
  • feature/* β†’ New workflow development
  • bugfix/* β†’ Bug fixes
  • hotfix/* β†’ Critical production fixes

Required Before PR

βœ… Local testing complete (Stage 1)
βœ… All validation scripts pass
βœ… Documentation updated (README, prerequisites, troubleshooting, CHANGELOG)
βœ… No sensitive data in commits
βœ… Semantic versioning followed
βœ… CHANGELOG updated

πŸ“– Complete Guides:

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

πŸ—ΊοΈ Roadmap

v1.0 (Current)

  • βœ… Repository structure and documentation
  • βœ… Portainer upgrade automation
  • βœ… CI/CD validation pipeline
  • βœ… Security scanning

v1.1 (Next)

  • πŸ”„ Docker cleanup automation
  • πŸ”„ Server health monitoring
  • πŸ”„ Slack notification integration
  • πŸ”„ Batch server processing

v2.0 (Future)

  • πŸ“‹ Database backup automation
  • πŸ“‹ SSL certificate renewal
  • πŸ“‹ Log aggregation workflows
  • πŸ“‹ Incident response automation

πŸ“Š Project Stats

  • Workflows: 1 (more coming soon!)
  • Categories: 4
  • Documentation Pages: 15+
  • Automated Validations: 5

πŸ’‘ Related Projects

πŸ™ Acknowledgments

  • n8n team for the amazing workflow automation platform
  • Community contributors
  • Open source projects that inspired this repository

Maintained by: spydi
Last Updated: 2025-12-21
Repository Version: 1.0.0

⭐ Star this repo if you find it useful!

About

Various n8n automation

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors