This workflow automates nightly backups of n8n workflows to a GitHub repository. Key nodes include Daily Backup (cron trigger), Validate Environment (sets backup parameters), Get All Workflows (fetches workflow list), API Response Check (validates response), Validate Workflows Data (checks data), Split Workflows (processes workflows), Create Item List (splits workflows), Get Workflow Details (fetches details), Prepare GitHub Data (formats backup), Check File Exists (verifies GitHub file), Create/Update GitHub File (saves backup), and Log Backup Success (logs results). It uses n8n and GitHub APIs.\n\nSetup Requirements: Install n8n from n8n.io or sign up at cloud.n8n.io. Import the JSON into n8n’s workflow editor. Create a GitHub account at github.com and generate a Personal Access Token (Settings > Developer settings > Personal access tokens > Generate new token, select repo scope). Create a repository (e.g., n8n-workflows-backup). In n8n, configure GitHub credentials (Header Auth, Token). Set up n8n instance credentials (Basic Auth, username/password from n8n config). Update Validate Environment with your n8n instance URL and GitHub repo details. Handle errors like invalid n8n credentials (401: Unauthorized) or GitHub token issues (500: github_backup_failed).\n\nTesting and Deployment: Import the JSON into n8n. Manually trigger Daily Backup to test. Verify Get All Workflows retrieves data, and API Response Check confirms status 200. Check Split Workflows and Create Item List process workflows correctly. Confirm Create/Update GitHub File saves JSON files to the repository and logs metadata for Backup Success logs metadata. Test with invalid n8n credentials to trigger API Error Handler (500: Failed to fetch workflows). Use an incorrect GitHub token to trigger GitHub Error Handler (500: Failed to save workflow). Test with no workflows to trigger No Workflows Handler (completed: No workflows found). Monitor logs for rate limits (429: Too Many Requests). If backups fail, verify n8n URL, credentials, and GitHub repo access. Activate the workflow in n8n for daily execution at 23:59. Deploy for automated workflow backups to GitHub.
$6.99
Workflow steps: 20
Integrated apps: scheduleTrigger, set, httpRequest