Google Calendar How do I set up a notification in advance?

I need 15 minutes notice, how do I set it up?

Hi @Panupol_Sonnuam, this would make a great feature request.

Until that’s implemented I think you could also use something like this:

This workflow runs every minute, fetches the upcoming events and then uses Luxon inside the IF node and then checks if the event starts in less than 15 but more than 14 minutes.

The notification logic (emails or other messages) would come after the true output of the IF node.

I have not tested this first hand yet though, so you might want to do some testing before using this in a production scenario.

Your flow actually triggers 15 minutes after the meeting starts. So if the meeting is at 10:00 AM, it triggers 10:15 am.

You’re quite right, sorry for that :see_no_evil:

It should work though once you replace $now.minus with $now.plus.

Thanks, easy mistake to do. :slight_smile:

But I’m not getting it to work at all now, changing both of $now.minus to $now.plus. Not too experienced yet. :slight_smile:

Hm, I have not used this workflow in a while, but from quickly reviewing it I think you might also need to swap the before and after on the IF node like so:

If you are using a recent version of n8n, you can simply hover over any of your input items on the IF node and see previews for each expression, which will make debugging a lot easier:

You could also tune the workflow a bit further to always have it compare precise boundaries covering a full minute by using expressions such as {{$now.plus({ minutes: 15 }).set({ second: 0, millisecond: 1 }) }} or {{$now.plus({ minutes: 14 }).set({ second: 0, millisecond: 0 }) }}.

This would make sure that a slightly longer response time on the Google API doesn’t result in missing a few milliseconds to be checked.

Hope this makes sense! Let me know if you have any questions on this :slight_smile:

1 Like

Awesome! Thanks for the explaination! Worked like a charm! :slight_smile:

For anyone looking for the final solution, see below. I output this to RocketChat via a webhook URL, but you could use whatever – just switch out the last one. :slight_smile:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.