Building a Date-Difference Workflow in n8n for Automated Relationship Milestone Tracking

Hi everyone,

I’m exploring how to build a more reliable date-calculation workflow in n8n that can track relationship milestones and automatically generate useful updates.

The idea is to accept a relationship start date through a form or webhook, calculate the elapsed time, and trigger notifications when milestones such as 100 days, six months, or one year are reached.

For the calculation layer, I’m considering using n8n expressions with Luxon or a Code node for more control over date validation and duration calculations. A small date calculator such as can also serve as a simple reference for the user-facing experience.

The workflow I have in mind is:

  1. Webhook/Form Trigger: Receive the start date and optional user details.

  2. Validation: Check the date format and reject invalid or future dates where appropriate.

  3. Date Calculation: Calculate the elapsed duration in days, hours, minutes, and seconds.

  4. Schedule Trigger: Check whether a predefined milestone has been reached.

  5. Notification: Send a personalized message through email or another connected service.

One challenge is handling timezone differences and ensuring the workflow doesn’t send duplicate notifications when it runs repeatedly. I’d also like to distinguish calendar-based milestones, such as six months, from fixed-duration milestones, such as 180 days.

My questions for the community:

  • Would you use a Schedule Trigger with a database lookup, or a date-driven workflow for milestone detection?

  • What is the best way to handle timezone consistency and daylight-saving changes?

  • How would you prevent duplicate notifications if a workflow retries after a failed execution?

  • Would you keep the calculation logic in a Code node or use built-in date expressions wherever possible?

I’d appreciate suggestions on the workflow architecture and any relevant examples. The goal is to make the process reliable, maintainable, and easy to extend to other date-based reminders.

Hey @Brodie_Hodgson, while you wait for a response, here are some things that might help:

Suggested resources

Automatically matched to your question.

Docs:

Forum:

@mohamed3nan - you’ve helped with similar issues before, can you take a look?

Automatically suggested by n8n’s community bot. It’s a pilot - please share feedback here.

Schedule trigger plus a database lookup is the right shape for this. A webhook only fires at registration, so milestone detection has to be re-evaluated on a timer anyway: let the form/webhook be the registration step that writes the start date and user details into a store (Google Sheet, Postgres, or n8n’s Data Table node), and let a daily Schedule Trigger do the detection.

Timezones: set the instance timezone once (Settings → Timezone, or N8N_DEFAULT_TIMEZONE when self-hosted), then compare in the user’s zone with Luxon, which is built into expressions: ={{ $now.setZone('America/Toronto') }}.

Calendar vs fixed milestones fall out of Luxon directly:

  • fixed duration: ={{ DateTime.fromISO($json.startDate).plus({ days: 180 }) }}
  • calendar-based: ={{ DateTime.fromISO($json.startDate).plus({ months: 6 }) }} (month-aware, so six months is not the same as 180 days)

An IF node then passes only when the milestone date is <= $now and that milestone is not yet recorded.

Duplicate prevention has to live in the store, not in memory: keep a “milestones_sent” column (or one row per milestone). After the IF passes, write the milestone back before the notification node runs, so a re-run or a retried execution sees it as already sent.

For the elapsed-time display: ={{ DateTime.fromISO($json.startDate).until($now).length('days') }}.