See llms.txt for all machine-readable content.

Back to Templates

Check scheduled Klaviyo campaign offers and links with Claude, Sheets and Slack

Quick overview

This workflow runs hourly to review upcoming Klaviyo campaign emails, test links and images for errors, extract codes/offers/dates with Anthropic Claude, validate them against a Google Sheets offers list, and post results to Slack while logging each check back to Google Sheets.

How it works

  1. Runs every hour and validates that required configuration values (Google Sheets URL/tabs, Slack channel ID, time zone, and limits) are set.
  2. Reads the Offers and Checks tabs from Google Sheets to load valid promo codes/discount windows and determine which email versions have already been checked.
  3. Fetches Klaviyo campaign messages (scheduled only, plus drafts if enabled) and selects up to the configured limit that send within the next configured time window, split by A/B variation.
  4. For each selected email, retrieves the Klaviyo template HTML/text, extracts plain-text content, codes, and up to the configured number of non-personalized links and images, and skips unchanged versions unless a near-send reminder is due.
  5. Sends each extracted URL as a HEAD request to flag dead destinations and note sites that block automated checks.
  6. Uses Anthropic Claude to list discount codes, offers, and dates found in the email text, then validates quotes, codes, discount amounts, and deadlines against the offers sheet and the email’s send date.
  7. Posts a per-email status message to Slack (pass/warn/fail, plus reminders when applicable) and appends a detailed log row to the Checks tab in Google Sheets.

Setup

  1. Create a Klaviyo private API key with campaigns:read and templates:read, and configure it as an HTTP Header Auth credential used by the Klaviyo HTTP requests (Authorization: Klaviyo-API-Key <key>) and set the correct API revision date.
  2. Create a Google Sheet with an Offers tab (including columns like Code, Discount, Starts, Ends) and an empty Checks tab, then connect Google Sheets credentials and paste the sheet URL and tab names into the Config values.
  3. Connect an Anthropic credential for Claude and ensure the selected Claude chat model is available in your account.
  4. Connect Slack OAuth2 credentials and set the target Slack channel ID in Config (use the channel ID, not the channel name).
  5. Review Config limits and behavior (hoursAhead, remindHoursBefore, maxEmailsPerRun, maxLinksPerEmail, checkDrafts, postPasses, and time zone) to match your email volume and notification preferences.

Requirements

  • Klaviyo account with a private API key that has read access to Campaigns and Templates
  • Google Sheets account for the offers sheet and the check log
  • Slack workspace and the ID of the channel for the reports
  • Anthropic API key for Claude
  • Hourly runs use about 720 executions a month

Customization

  • In Config, change hoursAhead, remindHoursBefore or maxLinksPerEmail to match how far ahead you schedule and how many links your emails carry.
  • Set postPasses to false to hear only about problems.
  • Set checkDrafts to true to also check drafts edited in the last 7 days.
  • Swap the Claude model for any chat model.

Additional info

The workflow only reads from Klaviyo: nothing is changed or sent there. Each A/B version is checked on its own, and personalised links are skipped and counted. Check Email Against Offers is plain code that drops anything Claude quoted that is not in the email, so a wrong reading cannot reach Slack as a fact.