https://github.com/spydisec/spydi-n8n-automation
Various n8n automation
https://github.com/spydisec/spydi-n8n-automation
Last synced: about 2 months ago
JSON representation
Various n8n automation
- Host: GitHub
- URL: https://github.com/spydisec/spydi-n8n-automation
- Owner: spydisec
- License: mit
- Created: 2025-12-21T21:39:40.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-12-22T12:15:32.000Z (7 months ago)
- Last Synced: 2025-12-23T11:23:06.599Z (7 months ago)
- Language: Python
- Size: 206 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# n8n Automation Workflows
> Production-ready n8n workflow automations for infrastructure management, monitoring, and operations
[](https://github.com/spydisec/spydi-n8n-automation/actions/workflows/validate-workflows.yml)
[](https://opensource.org/licenses/MIT)
[](https://n8n.io)
## π― 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](#-security-guidelines) below.
## π Quick Start
### Prerequisites
- n8n installed (>= 1.15.0) - [Installation Guide](https://docs.n8n.io/hosting/)
- Access to target systems (servers, APIs, etc.)
- Required credentials configured in n8n
### Installation
1. **Clone this repository:**
```bash
git clone https://github.com/spydi/spydi-n8n-automation.git
cd spydi-n8n-automation
```
2. **Configure server inventory:**
```bash
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/](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/](docs/getting-started/) for detailed setup instructions.
## π Workflows
### Infrastructure Automation
| Workflow | Version | Description | Status |
|----------|---------|-------------|--------|
| [Portainer Upgrade](workflows/infrastructure/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 β](workflows/README.md)
## π 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/](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:**
```bash
# 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:**
- **[Development Workflow](DEVELOPMENT.md)** - Complete branching strategy, 16-step development lifecycle
- **[Testing Workflows](docs/guides/testing-workflows.md)** - 3-stage testing process with validation checklists
- **[Workflow Versioning](docs/guides/workflow-versioning.md)** - Semantic versioning and CHANGELOG management
- **[Using Workflows Safely](docs/guides/using-workflows-safely.md)** - End-user safety guidelines
### Adding a New Workflow
1. **Create workflow directory:**
```bash
git checkout develop
git checkout -b feature/new-workflow
mkdir -p workflows/[category]/[workflow-name]
cd workflows/[category]/[workflow-name]
```
2. **Use templates:**
```bash
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:**
```json
{
"meta": {
"templateVersion": "1.0.0",
"author": "your-name",
"category": "infrastructure",
"description": "Brief description",
...
}
}
```
5. **Test locally (Stage 1):**
```bash
# Validate workflow
python scripts/check-version.py
bash scripts/check-sensitive-data.sh
# Test on development servers
```
6. **Submit PR to develop:**
```bash
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](CONTRIBUTING.md)** for complete contribution guidelines.
### Running Validation Locally
```bash
# 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
- **[Getting Started](docs/getting-started/)** - Installation and setup guides
- **[Using Workflows Safely](docs/guides/using-workflows-safely.md)** - Safety guidelines for workflow usage
- **[Workflow Catalog](workflows/README.md)** - Complete workflow listing
### For Contributors & Developers
- **[Contributing Guide](CONTRIBUTING.md)** - How to contribute workflows
- **[Development Workflow](DEVELOPMENT.md)** - Branching strategy and development lifecycle
- **[Testing Workflows](docs/guides/testing-workflows.md)** - 3-stage testing process
- **[Workflow Versioning](docs/guides/workflow-versioning.md)** - Semantic versioning and CHANGELOG management
- **[Repository Structure](docs/reference/repository-structure.md)** - Complete repo organization guide
### Technical Reference
- **[Reference Documentation](docs/reference/)** - Technical reference and API docs
- **[Validation Scripts](scripts/)** - Script documentation
## π§ͺ 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
```bash
# 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](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](templates/_workflow-template/)
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:**
- **[CONTRIBUTING.md](CONTRIBUTING.md)** - Full contribution guidelines
- **[DEVELOPMENT.md](DEVELOPMENT.md)** - Development workflow and lifecycle
- **[Testing Guide](docs/guides/testing-workflows.md)** - Testing process and checklists
## π License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## π Support
- **Documentation:** [docs/](docs/)
- **Issues:** [GitHub Issues](https://github.com/spydi/spydi-n8n-automation/issues)
- **Discussions:** [GitHub Discussions](https://github.com/spydi/spydi-n8n-automation/discussions)
- **n8n Community:** [community.n8n.io](https://community.n8n.io)
## πΊοΈ 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
- [n8n](https://github.com/n8n-io/n8n) - Workflow automation tool
- [n8n-nodes-base](https://github.com/n8n-io/n8n/tree/master/packages/nodes-base) - n8n core nodes
- [Awesome n8n](https://github.com/n8n-io/awesome-n8n) - Curated list of n8n resources
## π Acknowledgments
- n8n team for the amazing workflow automation platform
- Community contributors
- Open source projects that inspired this repository
---
**Maintained by:** [spydi](https://github.com/spydisec)
**Last Updated:** 2025-12-21
**Repository Version:** 1.0.0
β **Star this repo if you find it useful!**