Weather-triggered Klaviyo campaign drafts every morning

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.

Agentic Task
NOAA WeatherKlaviyoMarketingEmail AutomationContent GenerationAI Reports
PromptCreate

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.

Additional information

What does this prompt do?
  • Every morning at 6am Eastern, reads the next day's forecast and any active severe weather alerts for each of the U.S. regions where your Klaviyo audience is concentrated.
  • Decides which regions have notable weather worth marketing around, like a heat wave, cold snap, meaningful snow, heavy rain, or an active severe weather alert.
  • For each region that qualifies, drafts a subject line, preheader, and short body copy tying one or two on-brand product angles to the forecast.
  • Stages the draft as a Klaviyo campaign aimed at that region's segment so a marketer can review, tweak, and send. On quiet weather days, it simply reports that nothing needs sending.
What do I need to use this?
  • A Klaviyo account with a private API key and the regional segments you want to target already set up (for example, Northeast, Southeast, Midwest, West).
  • A short list of the U.S. cities or metros that represent each region, so the workflow knows where to pull forecasts from.
  • A rough brand tone note and a few product angles per weather condition (rain gear, warm layers, hydration, and so on) so the copy sounds like you.
How can I customize it?
  • Change the run time or run more than once a day if your team wants an evening pass for next-morning sends.
  • Adjust what counts as notable weather. Raise or lower the temperature swing, precipitation chance, or snow accumulation thresholds that trigger a draft.
  • Add, remove, or rename regions and their matching Klaviyo segments, or swap in the product angles and tone rules that fit your catalog.

Frequently asked questions

Will the workflow actually send the campaigns?
No. It only stages campaigns as drafts inside Klaviyo, aimed at the right regional segment. A marketer still opens Klaviyo, reviews the subject line, preheader, and body, and clicks send.
What happens on days with no notable weather anywhere?
The workflow posts a short note saying nothing needs sending and stops. You will not get empty or filler drafts cluttering Klaviyo.
How does it handle severe weather alerts?
When a region has an active severe alert, the workflow flags it and keeps the copy helpful and on-brand. It avoids alarmist language and does not try to piggyback on emergencies in a tone-deaf way.
Do I need to know coordinates for each region?
No. You just give the workflow a city or metro per region. It looks up the forecast grid automatically before pulling the seven-day outlook and any active alerts.
Can I use this if my regions are not one-to-one with U.S. states?
Yes. Regions can be metros, groups of ZIPs, or custom areas, as long as each one has a matching segment in Klaviyo and at least one representative city for the forecast lookup.

Stop missing weather moments your competitors turn into revenue.

Connect NOAA and Klaviyo once, and every morning you wake up to on-brand regional drafts ready to review and send.