Automated Service-to-Billing: Clockify to QuickBooks Online (n8n)

Streamline client invoicing by syncing billable time entries into QuickBooks Time Activities using n8n’s powerful node-based logic.

Tools: ClockifyQuickBooks

Platform: n8n

Short Answer

A self-hosted or cloud n8n workflow that automatically detects completed time entries in Clockify, maps them to the correct QuickBooks Customer, and creates a 'Time Activity' record ready for payroll or instant invoicing.

The Problem

Manual entry of billable hours from tracking apps to accounting software is prone to human error and delays. Without automation, businesses often miss billable minutes or fail to reconcile employee labor costs against specific project budgets.

The Outcome

A self-hosted or cloud n8n workflow that automatically detects completed time entries in Clockify, maps them to the correct QuickBooks Customer, and creates a 'Time Activity' record ready for payroll or instant invoicing.

Step-by-Step Guide

1. **Establish Credentials**: In n8n, go to 'Credentials' and set up 'Clockify API' (using your API Key) and 'QuickBooks Online OAuth2'. 2. **Configure Clockify Trigger**: Add the 'Clockify Trigger' node. Set the 'Resource' to `Time Entry` and 'Event' to `New Time Entry`. Ensure you select the correct Workspace ID. 3. **Filter Billable Hours**: Add an 'IF Node' to check if `{{ $json.billable }}` is true. This prevents internal administrative time from cluttering QuickBooks. 4. **Map Customer via Search**: QuickBooks requires a unique `Customer ID`. Add a 'QuickBooks Online' node, set Resource to `Customer` and Operation to `Get All`. Use a Query parameter `DisplayName = '{{ $json.clientName }}'` to retrieve the matching ID. 5. **Format Duration**: Clockify often sends duration in ISO8601 or seconds. Use an 'Expression' in the next node to convert this to hours and minutes, as QuickBooks expects `Hours` and `Minutes` integers or a decimal format. 6. **Create Time Activity**: Add another 'QuickBooks Online' node. Set Operation to `Create` for the `Time Activity` resource. Map the `Customer ID` from Step 4 and the `Duration` and `Description` from the Trigger node. 7. **Handle Multi-Employee Mapping**: Use an n8n 'Switch Node' or a static mapping JSON if your Clockify User emails don't perfectly match QuickBooks Employee names. 8. **Implement Error Handling**: Create an 'Error Trigger' workflow. In your main workflow 'Settings', set 'Error Workflow' to this new scratchpad to catch API timeouts or 404s. 9. **Test with Execution Data**: Click 'Execute Workflow' and stop a timer in Clockify. Verify the data flow in the n8n execution canvas before setting the workflow to 'Active'.

Data Mapping

| Clockify Field | QuickBooks Field | n8n Expression / Transformation | | :--- | :--- | :--- | | `description` | `Description` | `{{ $json.description }}` (Required) | | `timeInterval.duration` | `Hours` / `Minutes` | `{{ $json.timeInterval.duration.asHours() }}` (Use Luxon/n8n expressions) | | `clientName` | `CustomerRef` | Lookup result from QuickBooks Search Node | | `project.name` | `Class` | `{{ $json.projectName }}` (Requires QB Plus/Advanced) | | `user.email` | `EmployeeRef` | Map via `Name` or `Email` using QB search | | `billable` | `BillableStatus` | `{{ $json.billable ? 'Billable' : 'NotBillable' }}` |

Gotchas & Failure Modes

* **Format Mismatches**: Clockify returns time in a unique string format (e.g., `PT1H30M`). You must use an n8n Expression node with JavaScript or the Date/Time node to parse this into decimals (1.5) for QuickBooks. * **Rate Limiting**: Clockify and QuickBooks both have API limits. If syncing 100+ entries at once, use the 'Split in Batches' node in n8n (recommending batches of 10) to avoid 429 errors. * **Duplicate Prevention**: The 'New Time Entry' trigger fires every time a timer stops. If a user restarts/edits a timer, it may fire again. Consider using a 'Wait' node or a 'Check existence' step in QuickBooks before creating. * **OAuth Refresh**: Ensure your n8n instance is reachable via a public URL (or use n8n Cloud) to allow QuickBooks OAuth tokens to refresh properly; otherwise, the workflow will break every 24 hours.

Verification Checklist

- [ ] **Credentials Check**: Both Clockify and QuickBooks nodes show 'Connection successful'. - [ ] **Trigger Test**: Stopping a timer in Clockify populates the 'Output' data in the n8n Trigger node. - [ ] **Search Logic**: The workflow correctly finds a QuickBooks Customer ID based on the Clockify Client name. - [ ] **Data Integrity**: Decimals (e.g., 45 minutes = 0.75 hours) transfer accurately without rounding errors. - [ ] **Activation**: The 'Active' toggle is switched on and the workflow appears in the 'Executions' tab. - [ ] **End-to-End**: A 'Time Activity' appears in QuickBooks Online > Reports > Time Activities by Customer.

Ready to Automate?

Build this automation with n8n in minutes.