Google Calendar reminder 3h before and send e-mail

Hi everyone, I’m making a workflow in n8n to send an e-mail to my customers 3 hours before they appoint me. I tried to follow these instructions: Google Calendar How do I set up a notification in advance?

But doesn’t work because “Google Calendar nodes” retrieve many events in 3 hours, and the workflow sent 30 emails to my customer for the same appointment.

So I tried to use a MySQL database to check duplicates from Google Calendar, maybe you can give me a better solution to use only n8n tools? And optimize the process?

The problem is between the Loop items node and MySQL insert because when I have more records to manage at one time, I can’t retrieve only TRUE records (from the IF node). After all, the MySQL Check does not return data (obviously) for true elements.

Information on your n8n setup

  • n8n version: 1.44.1
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system:

hello @Francesco

Can you provide samples for the Calendar Node? You can remove any sensitive info from it.

Hello @barn4k
Of course, thank you

[
  {
    "kind": "calendar#event",
    "etag": "\"xxxxxx\"",
    "id": "xxxxx",
    "status": "confirmed",
    "htmlLink": "https://www.google.com/calendar/event?eid=xxxxxx",
    "created": "2024-06-25T07:32:15.000Z",
    "updated": "2024-06-25T08:01:38.723Z",
    "summary": "Test Rossi : Jacob",
    "description": "Cosa:\nTest Rossi : Jacob\n  \n\n",
    "location": "Milan, Italy",
    "creator": {
      "email": "[email protected]",
      "self": true
    },
    "organizer": {
      "email": "[email protected]",
      "self": true
    },
    "start": {
      "dateTime": "2024-06-25T13:05:00+02:00",
      "timeZone": "Europe/Rome"
    },
    "end": {
      "dateTime": "2024-06-25T13:35:00+02:00",
      "timeZone": "Europe/Rome"
    },
    "iCalUID": "[email protected]",
    "sequence": 1,
    "attendees": [
      {
        "email": "[email protected]",
        "responseStatus": "needsAction"
      },
      {
        "email": "[email protected]",
        "organizer": true,
        "self": true,
        "responseStatus": "accepted"
      }
    ],
    "reminders": {
      "useDefault": true
    },
    "eventType": "default"
  }
]

Better to send couple of examples where the “duplication” is occurring :slight_smile:

As i should be quite straightforward for that task

The solution is following this guide Google Calendar How do I set up a notification in advance?

And set a Cron Job every 3 hours (for my needs) 0 */3 * * *

Removing Loop Over Items and MySQL Check/Insert nodes, this help also to reduce the calls to Google APIs

Thank you!

2 Likes

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