See llms.txt for all machine-readable content.

Back to Templates

Alert on missed or zero-row nightly imports with Doyouok

Quick overview

Sync rows from any API to Google Sheets every night, and get alerted when the sync silently fails. The verified Doyouok node reports each run, so you hear about API errors, empty or mostly invalid data, and runs that never happened, even when n8n is down.

How it works

  1. Every night at 02:00 a Schedule Trigger starts the sync and Fetch products calls a demo API (dummyjson.com). If the request fails, its error output goes to Report error to Doyouok.
  2. Any valid rows? checks that at least one row has a title and a price. If none does, Report no data to Doyouok sends a failure with the number of rows received.
  3. Split into rows, Keep valid rows and Pick columns turn the response into one clean item per row, with a synced_at timestamp.
  4. Upsert to sheet adds or updates each row in Google Sheets, matched on id. A Google Sheets error also goes to Report error to Doyouok.
  5. Build run summary counts fetched, written and invalid rows. Report run to Doyouok passes only if rows were written and under 10% were invalid; otherwise the alert says, for example, "Wrote 0 of 30 rows". If no report arrives within a day, Doyouok alerts you too.

Setup

  1. Install the verified Doyouok node (nodes panel, search "Doyouok"), create a free API token at doyouok.com (Profile > API tokens) and add it as a Doyouok API credential on the three Doyouok nodes.
  2. Create a Google Sheet with the headers id, title, price, stock, category and synced_at in row 1. In Upsert to sheet, connect your Google account, pick the sheet, and set Mapping Column Mode back to Map Automatically.
  3. Click Execute workflow once. The check appears in Doyouok under this workflow's name; choose email, Telegram, Slack or Discord alerts there, then activate the workflow.

Requirements

  • A Doyouok account (the free plan is enough) and a Google account for Google Sheets.

Customization

  • Replace Fetch products with your own API, database or file source, then adjust Keep valid rows and Pick columns to your fields. Change the 10% threshold or the 1-day interval on Report run to Doyouok to match your schedule.

Additional info

This replaces my first upload, which the AI review found too simple. The title above was generated for that first version; please rename it to "Sync an API to Google Sheets nightly with missed-run and bad-data alerts". Tested on n8n Cloud: success, API error and no-data paths.