n8n

How to Automate Clockify GitHub Report Backup?

Keep your time tracking records safe without manual work. A daily run collects detailed time entries from your time tracker and stores them in a code repo. This fits agencies and teams that bill clients and need month by month history.

Each day the schedule starts, grabs your main workspace, and builds date ranges for the current month and the two before it. For every month, it calls the detailed report API and gets JSON data. It checks the repo under a reports folder to see if a month file already exists. If it does, it reads the old JSON, compares it to the new dataset, and updates only when changes are found. If no file exists, it filters out empty months and creates a new file with a clear month based name. Errors like not found are handled cleanly, and other issues are stopped with a clear error message.

Setup is simple: choose the repo owner and name, connect your accounts, and adjust how many months to back up. Expect fewer exports, fewer mistakes, and a clean audit trail with version history in GitHub. This helps with billing reviews, audits, and end of month reporting, while saving hours of manual work.

What are the key features?

  • Daily schedule runs automatically to keep backups current
  • Auto detects the first workspace, with an option to override in settings
  • Loops through the current month and two previous months
  • Builds precise start and end dates for each month
  • Requests detailed time entry data from the Clockify Reports API in JSON
  • Checks if a month file already exists in the repo under a reports folder
  • Compares old and new datasets and updates only when there are changes
  • Skips empty months to avoid creating empty files
  • Handles 404 not found cleanly and stops with clear errors for other issues

What are the benefits?

  • Reduce manual exports from hours to minutes each month
  • Automate 100 percent of monthly report backups for the last three months
  • Improve data accuracy by removing copy and paste errors
  • Keep a clear audit trail with GitHub version history
  • Connect Clockify and GitHub without writing scripts
  • Update only when data changes to cut noise and save commits

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Clockify and GitHub. See the Tools Required section above for links to create accounts with these services.
  3. In the n8n credentials manager, create a Clockify credential. If unsure, double click the Clockify nodes, choose the 'Credential to connect with' dropdown, click 'Create new credential', and follow the on screen steps. Use your Clockify API key from the Clockify account settings API page.
  4. In the n8n credentials manager, create a GitHub credential. Use a Personal Access Token with repo scope. Double click each GitHub node, select 'Credential to connect with', click 'Create new credential', and paste your token.
  5. Open the node named Get first workspace and assign the Clockify credential. Do the same for the detailed report request node so both use the same Clockify credential.
  6. Open the Globals node and set the GitHub repository owner and repository name. Optionally set a workspace id here if you do not want to use the first workspace.
  7. Open the Schedule Trigger and pick the daily time you want this to run.
  8. Open the Set month indexes node to change how many months are backed up. For example, add 3 or 4 to include more months.
  9. Check the GitHub nodes for the file path expression that writes files under a reports folder. Confirm the repository and default branch are correct.
  10. Click Execute Workflow to test. After it finishes, open your repo and look for month based files in the reports folder. Open a file to confirm it contains JSON time entries.
  11. If you see no files and the month is not empty, increase pageSize in the detailed report request body or add pagination if needed. If you get a permission error, check your GitHub token scopes and repo access.
  12. If the wrong workspace is used, set the workspace id in the Globals node to override the auto selection.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Clockify

Sign up

Free plan: $0 / mo, API available on all plans

GitHub

Sign up

Free tier: $0 / mo

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.