New to Kestra?
Use blueprints to kickstart your first workflows.
Weekly Kestra flow that pulls real Klaviyo campaign KPIs, exports them to CSV, and posts a performance summary to Slack.
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.
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.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.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.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.notify_summary (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) posts the window, campaign count, KPI row count, and execution id to Slack.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.
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.KLAVIYO_API_KEY and SLACK_WEBHOOK_URL secrets to your Kestra namespace.campaign_ids input to the campaigns you want to report on and conversion_metric_id to your account's conversion metric.statistics input if you want a different KPI set.weekly_report cron for a daily or monthly cadence.