Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .claude/settings.local.json
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:*)"
]
Comment on lines +2 to +7

Copilot AI Feb 7, 2026

Copy link

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 .gitignore and 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.

Suggested change
"permissions": {
"allow": [
"Bash(git mv:*)",
"Bash(git add:*)",
"Bash(git rm:*)"
]
"_comment": "Template for Claude permissions. Per-developer local permissions should be defined in an untracked settings.local.json file.",
"permissions": {
"allow": []

Copilot uses AI. Check for mistakes.
}
}
113 changes: 113 additions & 0 deletions .github/workflows/backup-n8n.yml
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")

@cubic-dev-ai cubic-dev-ai Bot Feb 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The n8n workflows list endpoint is paginated (default 100 results with nextCursor). This workflow only fetches the first page, so instances with >100 workflows will have incomplete backups.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/backup-n8n.yml, line 45:

<comment>The n8n workflows list endpoint is paginated (default 100 results with `nextCursor`). This workflow only fetches the first page, so instances with >100 workflows will have incomplete backups.</comment>

<file context>
@@ -0,0 +1,113 @@
+          # Fetch all workflows
+          response=$(curl -s \
+            -H "X-N8N-API-KEY: $N8N_API_KEY" \
+            "$N8N_URL/api/v1/workflows")
+
+          # Check if request was successful
</file context>
Fix with Cubic


# 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
96 changes: 96 additions & 0 deletions .gitignore
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/
Loading
Loading