Clockify Monthly Time Reports Backup to GitHub - n8n Workflow

Securely automate your Clockify data backup using this robust n8n workflow. Archive monthly time reports directly to a GitHub repository, ensuring data integrity and historical accuracy using powerful n8n templates.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Technical project managers and agency owners needing verifiable historical time data.

  • Users who require automated, version-controlled backups of their Clockify reports.

  • Developers looking for advanced examples of conditional logic within an n8n workflow.

  • Teams integrating Clockify data archival with DevOps or financial pipelines.

Overview

Maintaining historical accuracy for time tracking data is critical, especially when dealing with client invoicing or compliance. This powerful n8n workflow solves the problem of manual data extraction by automatically pulling detailed monthly reports from Clockify and storing them securely in a designated GitHub repository. By utilizing a specific n8n trigger and several specialized n8n node configurations, this system ensures that not only are new reports created, but existing reports are updated if the underlying Clockify data changes (e.g., tags or entries are edited post-facto). This particular n8n template focuses on resilience, checking for existing files, comparing data integrity, and skipping empty reports, making it a reliable archival solution. Setting up this n8n automation provides peace of mind that your time data is permanently preserved and versioned.

How it Works

This n8n workflow begins with the Schedule Trigger n8n node, configured to run daily (by default, at 5 AM).


  1. Configuration and Scope: First, the workflow uses a Clockify n8n node to retrieve the primary workspace ID. A subsequent Globals n8n node defines critical parameters, including the GitHub repository owner and name, which are mandatory user inputs. The workflow then sets the processing scope, typically targeting the last three months, using the Set month indexes n8n node.

  2. Interval Calculation: The indices are split out, and the Set intervals n8n node calculates the exact start date, end date, and the required filename (e.g., detailedreportYYYY-MM) for each month.

  3. Data Retrieval: The Get detailed monthly report HTTP Request n8n node connects to the Clockify API to pull all detailed time entries for the calculated month, retrieving the data as a JSON object.

  4. GitHub Check: The Check if file exists in GitHub n8n node attempts to locate the corresponding monthly report file in the GitHub repository.

  5. Update Path (File Exists): If the file exists, the n8n workflow follows the success path. It extracts the new time entries and uses the Extract from File n8n node to parse the existing GitHub report content. The Compare Datasets n8n node determines if any changes have occurred. If there are updates, the Update file in GitHub n8n node executes, committing the new, potentially revised, JSON data.

  6. Creation Path (File Not Found): If the GitHub check returns a 404 error (handled by the Check for 404 error message n8n node), the workflow verifies that the report is not empty using the Skip empty reports n8n node. If data exists, the Create file in GitHub n8n node saves the monthly report as a new JSON file. Any other API errors cause the workflow to stop with the Stop and Error n8n node.

Installation Guide

To deploy this n8n template, follow these steps:


  1. Import: Copy the provided n8n workflow JSON code and paste it into your n8n instance's workflow editor using the 'New' -> 'Import from JSON' option.

  2. Clockify Credentials: Ensure you have valid Clockify API credentials set up within n8n. The workflow references existing credentials named 'Clockify (octionictest)' but you must replace this with your own Clockify API key.

  3. GitHub Credentials: Set up GitHub API credentials, providing necessary scopes for creating, editing, and reading files in a repository. The n8n node is configured to use 'GitHub (n8n-test-01)'.

  4. Configure Globals: Open the Globals n8n node. You must manually enter the githubrepo.owner (your username or organization) and githubrepo.name (the target repository name) where the backups will be stored.

  5. Activate: Save the n8n workflow and activate the Schedule Trigger to begin automated daily execution.

Node Details

Schedule Trigger (n8n trigger): The starting n8n node. It schedules the automated execution of this n8n workflow, running daily at 5 AM by default.
Get first workspace (Clockify n8n node): Retrieves the ID of the first available Clockify workspace, which is required for the reports API calls.
Globals (Set n8n node): Defines global variables, including the Clockify workspace ID (set dynamically) and the GitHub repository owner and name (must be manually set).
Set month indexes & Split Out indexes (Set/Split Out n8n node): Sets the scope of the backup (defaulting to the last three months) and iterates over each month individually for processing by the core n8n logic.
Get detailed monthly report (HTTP Request n8n node): Performs a POST request to the Clockify Reports API to fetch detailed time entries for the calculated monthly interval. This crucial n8n node retrieves the source data.
Check if file exists in GitHub (GitHub n8n node): Attempts a GET operation on the expected report file path in GitHub. It uses an error-handling configuration (onError: continueErrorOutput) essential for handling 404 responses, enabling the n8n workflow to switch between update and creation paths.
Compare Datasets (Compare Datasets n8n node): Compares the newly retrieved Clockify data against the existing file content parsed from GitHub. This step ensures that the Update file in GitHub n8n node only executes if the data has genuinely changed, minimizing unnecessary commits and noise in the repository history.
Create file in GitHub (GitHub n8n node): Creates the new JSON report file when no existing backup is found, ensuring a complete historical record. This is a core action of this n8n template.

Related n8n Workflows

Free

Nodes: 12 Nodes
Updated: December 26 2025
View all
Created by

Workflow Optimization Expert | Software Architect. Use my link to book an initial consultation for custom built workflows using n8n.

Featured*