-
Notifications
You must be signed in to change notification settings - Fork 861
2026 02 07 2171 999b2 #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
williamsforeal
wants to merge
4
commits into
n8n-io:main
Choose a base branch
from
williamsforeal:2026-02-07-2171-999b2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e6ecc09
feat: restructure repository as Cyclone-S5
williamsforeal e30ecf7
Enhance backup workflow script and update README. Added error handlin…
williamsforeal 7a0eb1f
Refactor backup workflow script and enhance error handling. Improved …
williamsforeal 7a9a1bb
Update backup workflow script to improve logging and error reporting.…
williamsforeal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "permissions": { | ||
| "allow": [ | ||
| "Bash(git mv:*)", | ||
| "Bash(git add:*)", | ||
| "Bash(git rm:*)" | ||
| ] | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| name: Backup n8n Workflows | ||
|
|
||
| on: | ||
| # Run daily at 2 AM UTC | ||
| schedule: | ||
| - cron: '0 2 * * *' | ||
|
|
||
| # Allow manual triggering | ||
| workflow_dispatch: | ||
|
|
||
| # Run on pushes to main (optional - comment out if not needed) | ||
| # push: | ||
| # branches: | ||
| # - main | ||
|
|
||
| jobs: | ||
| backup: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '18' | ||
|
|
||
| - name: Install jq (for JSON processing) | ||
| run: sudo apt-get update && sudo apt-get install -y jq | ||
|
|
||
| - name: Backup workflows from n8n | ||
| env: | ||
| N8N_URL: ${{ secrets.N8N_URL }} | ||
| N8N_API_KEY: ${{ secrets.N8N_API_KEY }} | ||
| run: | | ||
| set -euo pipefail | ||
| echo "Fetching workflows from $N8N_URL..." | ||
|
|
||
| # Fetch all workflows | ||
| response=$(curl -s \ | ||
| -H "X-N8N-API-KEY: $N8N_API_KEY" \ | ||
| "$N8N_URL/api/v1/workflows") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The n8n workflows list endpoint is paginated (default 100 results with Prompt for AI agents |
||
|
|
||
| # Check if request was successful | ||
| if [ $? -ne 0 ]; then | ||
| echo "Error: Failed to fetch workflows" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Create backups directory | ||
| mkdir -p workflows/backups | ||
|
|
||
| # Track counts for summary | ||
| saved_count=0 | ||
| error_count=0 | ||
| timestamp=$(date +%Y%m%d_%H%M%S) | ||
|
|
||
| # Process each workflow | ||
| if ! workflows=$(echo "$response" | jq -c '.data[]'); then | ||
| echo "Error: Failed to parse workflows response" | ||
| exit 1 | ||
| fi | ||
|
|
||
| while IFS= read -r workflow; do | ||
| workflow_id=$(echo "$workflow" | jq -r '.id') | ||
| workflow_name=$(echo "$workflow" | jq -r '.name') | ||
|
|
||
| # Sanitize filename | ||
| safe_name=$(echo "$workflow_name" | tr ' ' '-' | tr -cd '[:alnum:]-_') | ||
|
|
||
| if [ -z "$safe_name" ]; then | ||
| safe_name="workflow-${workflow_id}" | ||
| fi | ||
|
|
||
| echo "Backing up: $workflow_name ($workflow_id)" | ||
|
|
||
| # Save to workflows directory | ||
| if echo "$workflow" | jq '.' > "workflows/${safe_name}.json"; then | ||
| # Also save timestamped backup | ||
| echo "$workflow" | jq '.' > "workflows/backups/${safe_name}_${timestamp}.json" | ||
| echo "Saved: ${safe_name}.json" | ||
| saved_count=$((saved_count + 1)) | ||
| else | ||
| echo "ERROR: Failed to save ${safe_name}.json" | ||
| error_count=$((error_count + 1)) | ||
| fi | ||
| done <<< "$workflows" | ||
|
|
||
| # Summary and exit status | ||
| echo "" | ||
| echo "Backup complete: $saved_count workflows saved" | ||
| if [ $error_count -gt 0 ]; then | ||
| echo "ERROR: $error_count workflows failed to backup" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Configure Git | ||
| run: | | ||
| git config user.name "GitHub Actions" | ||
| git config user.email "actions@github.com" | ||
|
|
||
| - name: Commit and push changes | ||
| run: | | ||
| git add workflows/ | ||
| if git diff --staged --quiet; then | ||
| echo "No changes to commit" | ||
| else | ||
| git commit -m "chore: automated workflow backup $(date +%Y-%m-%d)" | ||
| git push | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| # Environment files | ||
| .env | ||
| .env.local | ||
| .env.*.local | ||
| *.env | ||
| !.env.example | ||
|
|
||
| # n8n data | ||
| .n8n/ | ||
| n8n_storage/ | ||
|
|
||
| # Database | ||
| db_storage/ | ||
| *.db | ||
| *.sqlite | ||
|
|
||
| # Logs | ||
| logs/ | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # OS files | ||
| .DS_Store | ||
| .DS_Store? | ||
| ._* | ||
| .Spotlight-V100 | ||
| .Trashes | ||
| ehthumbs.db | ||
| Thumbs.db | ||
|
|
||
| # Secrets and credentials | ||
| *secret* | ||
| *credentials* | ||
| *credential* | ||
| !*-example | ||
| *.key | ||
| *.pem | ||
| *.p12 | ||
| *.pfx | ||
|
|
||
| # API keys (additional protection) | ||
| *apikey* | ||
| *api-key* | ||
| *api_key* | ||
|
|
||
| # Node modules (for future JavaScript projects) | ||
| node_modules/ | ||
| package-lock.json | ||
| yarn.lock | ||
| pnpm-lock.yaml | ||
|
|
||
| # Build outputs | ||
| dist/ | ||
| build/ | ||
| *.tsbuildinfo | ||
| *.js.map | ||
|
|
||
| # IDE | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
| .project | ||
| .classpath | ||
| .settings/ | ||
|
|
||
| # Backup files | ||
| *.bak | ||
| *.backup | ||
| *~ | ||
| *.tmp | ||
| *.temp | ||
|
|
||
| # Workflow backups (keep in git, but ignore temp backups) | ||
| workflows/backups/* | ||
| !workflows/backups/.gitkeep | ||
|
|
||
| # Test files | ||
| *.test.local.* | ||
| test-data/local-* | ||
|
|
||
| # Docker | ||
| docker-compose.override.yml | ||
|
|
||
| # Certificates | ||
| *.crt | ||
| *.cert | ||
| *.cer | ||
|
|
||
| # Coverage | ||
| coverage/ | ||
| *.lcov | ||
| .nyc_output/ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be a machine-local configuration file (
settings.local.json) but it’s being committed. Consider adding it to.gitignoreand providing a checked-in non-local template (or rename to a repo-scoped settings file) to avoid accidental local config drift and leaking developer-specific permissions.