Kimai Project Deadline & Budget Monitor — Daily Email Alert
Automatically get notified every morning when a billable project is approaching its deadline or burning through its hours budget.
What This Workflow Does
This workflow runs every weekday at 9:00 AM, queries your Kimai time-tracking instance, and sends a formatted HTML digest email whenever one or more billable projects need your attention — either because their end date is near, or because their hour budget is running low.
If nothing requires attention that day, no email is sent.
Features
-
Scheduled daily — runs Monday–Friday at 9:00 AM (fully configurable) -
Filters billable projects only — ignores non-billable work -
Deadline tracking — alerts when a project ends within a configurable number of days (default: 10 days) -
Budget tracking — alerts when logged hours exceed 80% of the project’s time budget -
Color-coded urgency levels — expired, urgent, warning, on track, or missing data -
Rich HTML email — includes deadline status, a visual progress bar for hours, and a direct link to your Kimai instance -
Silent on quiet days — the email is only sent when at least one project requires attention
Workflow Steps
Schedule Trigger (9 AM, Mon–Fri)
└── GET /api/projects (visible only)
└── Filter: billable === true
├── GET /api/projects/:id ← project details (end date, budget, customer)
└── GET /api/timesheets ← all time entries per project
└── Sum total seconds per project
└── Merge details + totals (by project ID)
└── Calculate urgency & filter reportable projects
└── [IF count > 0]
└── Build HTML email
└── Send via SMTP
Alert Logic
A project appears in the report if at least one of these conditions is true:
| Condition | Threshold |
|---|---|
| Days until project end | ≤ 10 days (configurable) |
| Budget consumption | ≥ 80% of time budget |
Urgency Levels
| Level | Trigger | Color |
|---|---|---|
| End date is in the past | Red | |
| ≤ 3 days remaining | Orange | |
| ≤ 7 days remaining | Amber | |
| ≤ 10 days remaining | Green | |
| No end date set | Indigo |
Setup & Configuration
Requirements
-
A running Kimai instance with API access
-
A Bearer token for a Kimai service account
-
SMTP credentials for sending email
-
n8n (self-hosted or cloud)
Credentials to configure
| Node | Credential Type | Notes |
|---|---|---|
GET Projects |
HTTP Bearer Auth | Kimai service account token |
GET Projects Details |
HTTP Bearer Auth | Same token |
GET Timesheet Records |
HTTP Bearer Auth | Same token |
Send an Email |
SMTP | Your mail server credentials |
Customization
Change the alert window (days threshold) Open the Calculate expiration Code node and edit line 1:
const daysThreshold = 10; // Change to your preferred number of days
Change the budget alert threshold In the same node, find getBudgetInfo() and edit:
shouldReport: percentage >= 80 // Change 80 to your preferred percentage
Change the schedule Edit the Every Day at 9:00 Schedule Trigger node. The default cron expression 0 9 * * 1-5 runs at 9 AM Monday–Friday.
Change email sender / recipient Update the Send an Email node fields: fromEmail and toEmail.
Update the Kimai URL Replace https://kimai with your actual Kimai instance URL in all three HTTP Request nodes and in the Open Timesheet button link inside Build Email HTML - Report.
Email Preview
The generated email includes one card per project, showing:
-
Customer name and project name
-
Order Deadline (PO) — date, urgency badge, and days remaining
-
Hours Monitoring — visual progress bar with used/total hours and percentage
If a project has no end date or no budget configured, the card highlights it clearly so you can act on it.
Notes
-
Timesheet records are fetched with
size=1000000000to retrieve all entries in a single call. For very large datasets, consider paginating or filtering by date range. -
Dates are displayed in
DD/MM/YYYYformat. This can be adjusted in theformatIsoToItalian()function inside theCalculate expirationnode. -
The workflow uses
enrichInput1merge mode — project detail fields take precedence, and budget totals are appended.