Weather-triggered Klaviyo campaign drafts every morning

By General Input

Every morning at 6am ET, scan tomorrow's forecast for your regional Klaviyo audiences and stage on-brand campaign drafts for the regions where the weather warrants a send.

Integrations

  • NOAA Weather
  • Klaviyo

Type

Agentic Task

Categories

  • Marketing

Build me an agent workflow that runs on a cron every morning at 6am America/New_York and drafts weather-triggered marketing campaigns in Klaviyo for the U.S. regions where my audience is concentrated. The agent only drafts. It never sends.

Configuration the workflow should accept as inputs (with sensible defaults committed in the workflow itself, editable later): a list of regions where each region has a name, one representative U.S. city (or lat/lon), and the Klaviyo segment name it maps to; a set of trigger thresholds (heat wave: forecast high >= 95F or >= 15F above seasonal normal; cold snap: forecast low <= 20F or >= 15F below seasonal normal; heavy rain: precipitation probability >= 60% with meaningful accumulation; meaningful snow: accumulation >= 4 inches; or any active NWS severe alert covering the region); a short brand tone note; and a small map of weather condition to product angles (for example rain -> rain gear / waterproofing, cold snap -> warm layers / thermals, heat wave -> hydration / shade / lightweight fabrics, snow -> boots / traction, severe alert -> preparedness essentials, helpful tone only).

For each configured region, the agent should: (1) call NOAA Weather Get Point Metadata on the region's representative city to resolve the forecast grid; (2) call NOAA Weather Get 7-Day Forecast for that grid and focus on tomorrow's day and night periods; (3) call NOAA Weather Get Active Alerts scoped to that point to see if a severe NWS alert is in effect; (4) evaluate the configured thresholds against tomorrow's forecast and the active alerts, and decide whether the weather is notable enough to warrant a targeted send.

When a region qualifies, the agent should: (a) call Klaviyo Get Segments and match the configured segment name to a segment id (fail loudly if the segment doesn't exist); (b) generate a short subject line (about 40 to 55 characters), a preheader (about 60 to 90 characters), and a short body copy (roughly 80 to 140 words) that ties one or two product angles from the configured map to tomorrow's forecast, in the configured brand tone. During an active severe alert the copy must avoid alarmist language, avoid urgency countdowns, and lean into helpful, on-brand advice; do not exploit emergencies; (c) call Klaviyo Create Campaign to stage the campaign as a draft aimed at that segment, with the subject and preheader on the message and the body copy in the message content, named something like "Weather draft – <region> – <YYYY-MM-DD>". Do not schedule a send and do not set a send strategy that would auto-send. The output is a draft only.

At the end of the run, the agent should produce a short summary listing each region and either the campaign id it drafted or the reason it skipped ("no notable weather", "segment not found", etc.). If no region qualifies anywhere, the summary should be a single line like "Nothing to send today" and the workflow ends cleanly with no Klaviyo writes.

Guardrails: never send a campaign, only draft; never create or modify segments; if Klaviyo returns a rate limit or a validation error, retry once and then skip that region with a clear reason in the summary; treat NOAA 404s (point outside U.S. coverage or grid unavailable) as a skip with a reason, not a fatal error; cap the run at one draft per region per day so re-runs don't duplicate campaigns.

Related prompts

Explore more prompts
Klaviyo campaign calendar and draft studio for marketing teamsKlaviyo list health and sunset workbench for deliverabilityBigCommerce customer segment and lifetime value workbenchFind lapsed BigCommerce customers and win them back in KlaviyoSync every new Whop member to Klaviyo, Sheets and SlackRoute cancelled Recharge subscribers into Klaviyo win-back listsWeather-aware daily dispatch brief for your Jobber crewsPause Klaviyo emails to customers with open Zendesk complaintsDaily Klaviyo high-intent lead handoff to HubSpot and SlackWeekly Klaviyo campaign digest to Slack and Google Sheets