Templates / Optimize Klaviyo campaign send times and email reports with Gmail

Optimize Klaviyo campaign send times and email reports with Gmail

Ready for 3.0

by Afeez ✓ · 98 views · created 2026-05-08 · Social Media, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This workflow has 11 nodes and runs on a schedule (every week at 08:00) (plus 1 other trigger). Along the way it connects Gmail. It also calls a.klaviyo.com over HTTP.

How it runs

Trigger: On a schedule (every week at 08:00) (plus 1 other trigger).

  1. Config (Edit Fields (Set)): sets 4 fields: lookback_days, min_campaigns_per_slot, start_date…
  2. Gmail: uses Gmail
  3. Get Sent Campaigns (HTTP Request): calls an HTTP API
  4. Flatten Campaigns (Code): runs custom JavaScript code
  5. Fetch Lists (HTTP Request): calls a.klaviyo.com
  6. Get Campaign Stats (HTTP Request): calls a.klaviyo.com (POST)
  7. Aggregate by Hour (Code): runs custom JavaScript code
  8. Format Email Report (Code): runs custom JavaScript code
  9. Gmail: uses Gmail

Services it uses

Gmail

HTTP calls to: a.klaviyo.com

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Check at runtime on n8n 3.0
  • Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Informational: a static scan can't see the data, so test these on your own instance. Status above is unchanged.

Nodes used (6)

From the author

How it works Every Monday at 8 AM, the workflow pulls all sent email campaigns from Klaviyo for the past 90 days It fetches open rate and click rate for each campaign, then groups results by audience segment and send hour Time slots with at least 3 campaigns…

Excerpt from Afeez's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.