workflows.fit
Back to n8n workflows
n8n templateFreeBy Mychel Garzon

Delay football goal alerts with API-Football, Google Sheets and Gmail

Your streaming service is 45 seconds behind live. Your phone notifications aren't. This workflow fixes that. Real-time alerts arrive before they happen on your screen. You're watching a corner kick, your phone buzzes ...

Data & StorageProductivityDevelopmentCore NodesCommunicationHITLSticky NoteSchedule Trigger
Loading interactive preview...

Template notes

Your streaming service is 45 seconds behind live. Your phone notifications aren't. This workflow fixes that.

Real-time alerts arrive before they happen on your screen. You're watching a corner kick, your phone buzzes with a goal notification, moment destroyed. This workflow monitors live match data, detects goals for your team, then holds the notification for however long your stream is lagging. Test your delay once, never get spoiled again.

How it actually works

The schedule runs every 10 minutes, but here's the thing: it doesn't just blindly hit the API 144 times a day (which would blow through the free tier in like 18 hours). There's a timing check that reads your match kickoff from a Google Sheet and does the math: if you're more than 2 hours before or after the match, it just skips the whole thing. Saves about 80-90% of your rate limit for when matches are actually live.

Once you're inside the match window, the API call happens, and the data splits into two parallel branches (this took me forever to get right, more on that in a second):

Branch 1 - Goal Detection: Parses the event feed, checks if any goals happened that aren't already in your "notified" log (stored in the Sheet as a comma-separated string—yeah, I know, but it works). If there are new goals, it logs them, waits for your delay (you set this once, like 45 seconds or whatever your service needs), then fires off an email via Gmail with the scorer, minute, score, opponent. Done.

Branch 2 - Auto Reset: Reads the match status from the same API response. If it says FT (full time) or any of the finished codes (AET, PEN, CANC, etc.), it flips your Active column to "No" in the Sheet. This stops the polling automatically so you're not burning API calls after the match ends.

Setup