Skip to main content
SpireSlip

Automating document expiry reminders

The Document expiry approaching automation trigger fires when an employee-uploaded document is approaching the date after which it stops being useful. Today the only document SpireSlip stores per employee is the sick-leave medical certificate (attached via the portal when an employee submits a sick-leave request), so the trigger currently fires on sick-leave records whose end date is within a configurable number of days.

The scope is intentionally narrow for now. A future build will add a general employee documents table (driving licences, visas, professional certifications, regulatory clearances), at which point this trigger will fire against those rows too without any change to how you configure it.

What the trigger does today

For every active non-contractor employee, the daily automation sweep looks for sick-leave records that meet all of:

  • leave_type = 'sick'
  • A medical certificate was attached at submission (supporting_doc_url is set)
  • The leave's end_date is between today and today plus N days, where N is your configured threshold

The trigger projects one context row per matching record so the action template can render the employee's name, the entity name, the expiry date, the days remaining, and the document type (sick_leave_certificate today).

Configuring the trigger

  1. Open Automations and click Add automation.
  2. Trigger: pick When an employee document is expiring.
  3. Set Days before document expiry between 7 and 90. Default 30.
  4. Pair with an action: a dashboard notification to HR officers, an email to the HR officer, or an employee email reminding them to extend their leave or submit an updated certificate.

Suggested action pairings

  • Notify HR officer with a short subject like "Sick leave ending in {{days_until_expiry}} days for {{employee_name}}" and a body that includes the expiry date and the certificate link from the leave management page.
  • Dashboard notification at severity info, visible on the owner and admin bells.
  • Send email to the employee reminding them to submit a renewal certificate or request an extension if the leave needs to continue.

Deduplication

The trigger fires at most once per calendar month per employee. The dedupe key carries year and month, so an employee whose certificate end-date passes the threshold in March will trigger once in March; if you still have not acted by 1 April, a fresh key opens and the reminder fires again.

Contractors are excluded

The trigger skips employees with employment_type = contractor. Contractor documentation is managed at contract renewal rather than via leave certificates.

Future scope

When SpireSlip ships a general employee documents table with per-document expiry dates, this trigger will fire on those rows as well. The configuration field stays the same (days before expiry); the underlying query adds the new table to its scan. You will not need to recreate or reconfigure existing automations.