klaviyo icon
SlackIncomingWebhook icon
Get icon
Request icon
Write icon
JsonToIon icon
IonToCsv icon
Schedule icon

Weekly Klaviyo Campaign Performance Report to Slack

Weekly Kestra flow that pulls real Klaviyo campaign KPIs, exports them to CSV, and posts a performance summary to Slack.

Categories
Business

Automate a recurring Klaviyo email marketing performance report with Kestra. Every week this flow fetches your selected Klaviyo campaigns, pulls real per-campaign KPIs (opens, open rate, clicks, click rate, delivered, bounced, unsubscribes, and attributed conversion revenue) from the Klaviyo Campaign Values Reporting API, exports the metrics to a clean CSV for archiving or BI ingestion, and posts a performance summary to Slack. It solves the recurring problem of marketers manually exporting campaign analytics from the Klaviyo dashboard each week: instead you get a scheduled, reproducible, hands-off report with the actual engagement and revenue numbers, not just a row count.

How it works

  1. The weekly_report Schedule trigger (io.kestra.plugin.core.trigger.Schedule) fires every Monday at 08:00 UTC. The window_start and window_end variables derive a seven-day window from the trigger date (or the execution start date on a manual run), so backfills compute the correct window.
  2. get_campaigns (io.kestra.plugin.klaviyo.campaign.Get) fetches the campaigns listed in the campaign_ids input so the report knows each campaign's name and status.
  3. campaign_values_report (io.kestra.plugin.core.http.Request) POSTs to the Campaign Values Reporting endpoint, requesting the KPIs in the statistics input for the window, scoped to the selected campaigns and attributed against conversion_metric_id.
  4. write_metrics_json (io.kestra.plugin.core.storage.Write) projects the JSON:API response into a flat array, then metrics_to_ion (io.kestra.plugin.serdes.json.JsonToIon) and metrics_to_csv (io.kestra.plugin.serdes.csv.IonToCsv) convert it to a clean CSV.
  5. notify_summary (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) posts the window, campaign count, KPI row count, and execution id to Slack.

What you get

  • A CSV of per-campaign KPIs (opens, clicks, delivered, attributed revenue) attached to each execution, ready for archiving or BI.
  • A weekly Slack summary with the report window, campaigns reported, and KPI row count.
  • A reproducible, scheduled report that runs without anyone opening the Klaviyo dashboard.

Who it's for

  • Email and lifecycle marketers who report Klaviyo performance on a weekly cadence.
  • Marketing ops and analytics engineers who need campaign KPIs landed as CSV for downstream BI.
  • Growth teams that want revenue-attributed campaign metrics surfaced in Slack automatically.

Why orchestrate this with Kestra

Klaviyo's own scheduling cannot pull a multi-campaign reporting export, flatten the JSON:API payload, and broadcast it to Slack on a cron. Kestra adds an event-driven Schedule trigger, per-task retries (constant, 4 attempts, 30s apart) and 10-minute timeouts so a transient 429 or 5xx self-heals, an errors block that alerts Slack if the run fails so a missed Monday report is never silent, full execution lineage and downloadable artifacts, and declarative YAML you can version control. Shared credentials live once in pluginDefaults instead of being repeated on every task.

Prerequisites

  • A Klaviyo account with a Private API Key that has read access to campaigns and campaign reporting (analytics).
  • The conversion metric ID used for revenue attribution (for example the "Placed Order" metric ID from your account).
  • A Slack incoming webhook pointing at the channel that should receive the report.

Secrets

  • KLAVIYO_API_KEY: Klaviyo Private API Key, sent as the Klaviyo-API-Key header by the Klaviyo task and the reporting HTTP call.
  • SLACK_WEBHOOK_URL: Slack incoming webhook URL used to post the summary and any failure alert.

Quick start

  1. Add the KLAVIYO_API_KEY and SLACK_WEBHOOK_URL secrets to your Kestra namespace.
  2. Set the campaign_ids input to the campaigns you want to report on and conversion_metric_id to your account's conversion metric.
  3. Adjust the statistics input if you want a different KPI set.
  4. Enable the flow and let the Monday schedule run it, or trigger it manually to test.

How to extend

  • Add a discovery step in front of the flow that lists campaigns sent in the last seven days and feeds their IDs in, so the report stays current without manual edits.
  • Change the weekly_report cron for a daily or monthly cadence.
  • Push the CSV to S3, GCS, or a warehouse, or load the flat metrics straight into BigQuery or Snowflake for dashboards.
  • Branch the Slack summary on thresholds (for example, alert when open rate drops below a target).

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.