Automate Clockify Monthly Backups to GitHub with n8n

This n8n workflow automates backing up detailed monthly Clockify reports to GitHub, eliminating manual export errors and time drain. Save hours each month by automatically fetching, comparing, and storing your time tracking data securely in your GitHub repo.
clockify
github
httpRequest
+7
Workflow Identifier: 2207
NODES in Use: Schedule Trigger, Clockify, Set, Split Out, HTTP Request, GitHub, Extract From File, Compare Datasets, Stop and Error, Filter

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What this workflow does

This workflow automatically backs up monthly detailed reports from Clockify to a GitHub repository daily. It solves the problem of manual exporting, renaming, and uploading reports, preventing data loss and errors. The result is a reliable, up-to-date backup of time tracking data stored in GitHub.

The workflow runs every day to fetch Clockify workspace data, generate reports for the last three months, check if report files exist on GitHub, compare new report data with existing backups, and create or update files as needed.


Who should use this workflow

Project managers or teams who manually export Clockify reports for backups and want to save time daily. It is useful for companies needing accurate, historical records of tracked hours for audits or billing.

This workflow fits users with basic knowledge of n8n and access to Clockify and GitHub with required API credentials.


Tools and services used

  • Clockify API: Provides workspace IDs and detailed monthly time reports in JSON format.
  • GitHub API: Manages backup files by checking, creating, or updating JSON reports in the repository.
  • n8n workflow automation platform: Orchestrates scheduled triggers and API calls to automate the backup process.

How the workflow works (Input → Process → Output)

Inputs

  • Clockify API key to access workspace and reports.
  • GitHub API key with repo write permissions.
  • Settings for GitHub repository owner and name.
  • Date information to generate reports for the current and previous two months.

Processing Steps

  • Schedule daily trigger at 5 AM starts the workflow.
  • Retrieve first Clockify workspace ID for API calls.
  • Store global variables like workspace ID and GitHub repo info.
  • Define three month indexes [0,1,2] meaning current month and previous two.
  • Split month indexes to process separately in sequence.
  • Calculate start and end dates for each month and build report file name (e.g., detailed_report_2024-06.json).
  • Request detailed report JSON from Clockify API for each month.
  • Check if report file exists in GitHub repository.
  • If file exists, extract existing JSON data for comparison.
  • Compare new report data with existing data to detect any changes.
  • Skip empty reports with no time entries.
  • Create new file or update existing file on GitHub if there are changes.
  • Stop workflow with error message if API requests fail or data is missing.

Outputs

  • JSON report files in GitHub repository for three months, named with consistent date-encoded filenames.
  • Accurate historical backups stored in version-controlled GitHub.
  • Error messages logged in workflow if issues occur.

Beginner step-by-step: How to run this workflow in n8n

1. Import Workflow

  1. Download the provided workflow file from this page.
  2. In the n8n editor, click on the menu and select Import from File.
  3. Choose the downloaded workflow file to load it.

2. Configure API Credentials

  1. Add your Clockify API Key credential in n8n’s credential manager.
  2. Add your GitHub API Key credential with write access to the target repository.
  3. In the Globals node, update the repository owner and repository name fields to match your GitHub repo.
  4. Verify the workspace ID is set automatically, or update manually if needed.

3. Test the Workflow

  1. Manually run the workflow once in n8n to check if the reports create in GitHub properly.
  2. Look at the execution logs for any errors or failures and fix configuration issues.

4. Activate the Workflow

  1. After successful test, activate the Schedule Trigger node to make it run daily at 5 AM automatically.
  2. Monitor the workflow executions periodically to confirm backups are working as expected.

Optional: For more control or privacy, consider self-host n8n to run this workflow on your own server or VPS.


Edge cases and failures

If the GitHub report file path is wrong or the file doesn’t exist, the workflow may error when checking existence. Check and fix repo owner/name in the Globals node.

Clockify API calls may fail if API keys are invalid or expired, causing no reports to be fetched. Refresh Clockify API credentials if needed.

If GitHub API token lacks write permission, file creation or updates will fail. Make sure the token scopes include write access for the repository.


Customization ideas

  • Increase backup range by changing month indexes array to more months, like [0,1,2,3,4].
  • Change the Schedule Trigger node settings to run at different times or frequencies.
  • Switch GitHub repository owner or name in the Globals node for backups in another repo.
  • Adjust Get detailed monthly report node’s pageSize parameter to fetch larger report pages.
  • Add notification nodes (email or Slack) after GitHub updates for alerting backup status.

Summary of results

✓ Saves 3+ hours monthly by automating report export.
✓ Prevents manual errors and data loss in backups.
✓ Stores time tracking reports reliably in GitHub with version control.
✓ Automatically runs daily to keep reports up-to-date.
✓ Provides error stopping and messages for troubleshooting.

Frequently Asked Questions

Yes, if the GitHub API credentials have access and write permissions for the private repository.
The workflow runs daily and backs up reports for the current and previous two months.
The GitHub API key must have write access to create or update files in the target repository.
The workflow will fail when calling the Clockify API and stop with an error message. The API key must be valid and active.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free