Sync Clockify Time Entries to QuickBooks Online (n8n)
Automate billable hours and project costing using n8n's visual node-based workflows.
Tools: Clockify → QuickBooks
Platform: n8n
Short Answer
A seamless, automated flow where approved Clockify time entries are instantly converted into QuickBooks Time Activities or Invoices. This ensures 100% data accuracy, faster client billing, and real-time project profitability reporting within QuickBooks.
The Problem
Manual entry of time logs from tracking apps into accounting software is time-consuming and prone to human error, often leading to missed billable minutes or inaccurate project costing. This process delays invoicing cycles and creates discrepancies between tracked work and client bills.
The Outcome
A seamless, automated flow where approved Clockify time entries are instantly converted into QuickBooks Time Activities or Invoices. This ensures 100% data accuracy, faster client billing, and real-time project profitability reporting within QuickBooks.
Step-by-Step Guide
1. **Setup Clockify Trigger**: Add the 'Clockify Trigger' node. Set the event to 'New Time Entry'. Use a Webhook to receive data in real-time.
2. **Configure Credentials**: In n8n, create new credentials for Clockify using your API Key and QuickBooks Online using OAuth2 (follow the redirect URL prompt).
3. **Search Customer**: Add a 'QuickBooks Online' node. Set the resource to 'Customer' and operation to 'Get All'. Use a Filter expression to match the Clockify 'Client' name.
4. **Logic Check (If Node)**: Use an 'IF' node to check if the Customer search returned a result. If `{{ $node["QuickBooks"].json["id"] }}` is empty, route to a 'Create Customer' node.
5. **Format Time (Code Node)**: Clockify provides duration in seconds. Create a 'Code' node to convert seconds to hours for QuickBooks. Use: `item.hours = item.duration / 3600;`.
6. **Map Employees**: Add a 'Match' or 'Set' node to map Clockify User Emails to QuickBooks Employee IDs. This ensures the time log is attributed to the correct person.
7. **Create Time Activity**: Add another QuickBooks node. Set Resource to 'Time Activity'. Map `hours` from the Code node, `customerId` from the search step, and the `description` from Clockify.
8. **Data Transformation**: Use n8n Expressions to format the date: `{{ $json.timeInterval.start.toDate().toISOString() }}` to satisfy QuickBooks API requirements.
9. **Add Error Handling**: Create an 'Error Trigger' node to catch failed executions. Connect it to an email or Slack node to notify the admin if a sync fails (e.g., due to a missing service item).
Data Mapping
| Clockify Field | QuickBooks Field | n8n Expression / Transformation |
| :--- | :--- | :--- |
| `timeInterval.duration` | `Hours` | `{{ $json.duration / 3600 }}` (Decimal format) |
| `clientName` | `CustomerRef` | `{{ $node["Search Customer"].json["Id"] }}` |
| `description` | `Description` | `{{ $json.description || 'No description provided' }}` |
| `user.email` | `EmployeeRef` | Requires a lookup table or QuickBooks search by Email |
| `timeInterval.start` | `TxnDate` | `{{ $json.timeInterval.start.split('T')[0] }}` |
| `billable` | `BillableStatus` | `{{ $json.billable ? 'Billable' : 'NotBillable' }}` |
Gotchas & Failure Modes
• **Rate Limiting**: QuickBooks Online API has strict concurrency limits. If syncing bulk historical data, use the **Split In Batches** node in n8n to process entries 10 at a time.
• **Time Formatting**: QuickBooks requires duration in decimal hours (1.5) or hours/minutes. Clockify's raw seconds must be converted using an n8n Expression or Code node to avoid 400 Bad Request errors.
• **Rounding Discrepancies**: ensure your n8n math expression rounds to 2 decimal places `(.toFixed(2))` to match QuickBooks ledger precision.
• **Connection Expiry**: QuickBooks OAuth2 tokens can expire if the workflow isn't run frequently. Ensure the n8n environment's base URL is correctly configured for token refresh logic.
Verification Checklist
- [ ] **Webhook Test**: Trigger a 'Test Step' in the Clockify node and verify the JSON payload arrives in n8n.
- [ ] **Lookup Validation**: Ensure the 'Search Customer' node correctly identifies an existing QuickBooks customer by name.
- [ ] **Math Check**: Verify that a 30-minute entry in Clockify results in exactly '0.5' in the QuickBooks Time Activity node.
- [ ] **Execution Log**: Check the n8n 'Executions' tab to ensure the workflow finishes with a green status.
- [ ] **Target Check**: Log into QuickBooks Online and verify the Time Activity appears in the 'Weekly Timesheet' view.
Ready to Automate?
Build this automation with n8n in minutes.