Agent skill · marketing growth · jeremylongshore
klaviyo-core-workflow-b
Execute the Klaviyo secondary workflow: event tracking, segments, and campaigns. Use when you need to track customer events, query or size segments, build and send email campaigns, or inspect metric-triggered flows through the Klaviyo API. Trigger with phrases like "klaviyo events", "klaviyo segments", "klaviyo campaigns", "track klaviyo event", "klaviyo flow trigger".
Why this skill is useful
Provides specific API commands and workflows for managing Klaviyo events, segments, and campaigns that the AI wouldn't reliably generate on its own.
What it needs
Requires klaviyo-api installed locally. Requires klaviyo account access. About 3k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
Klaviyo Core Workflow B -- Events, Segments & Campaigns Overview Secondary workflow: track customer events, query segments, create/send campaigns, and trigger metric-based flows via the klaviyo-api SDK. This page summarizes the five steps and their skeletons; the full copy-ready code lives in references/implementation.md and worked scenarios in references/examples.md. Prerequisites Completed klaviyo-core-workflow-a (profiles/lists set up) API key scopes: events:write, segments:read, campaigns:read, campaigns:write, flows:read klaviyo-api installed and KLAVIYOPRIVATEKEY set in the environment Instructions Open one session, then use the API class each step needs. Full parameter shapes for every step are in references/implementation.md. 1. Step 1 — Track server-side events. new EventsApi(session).createEvent(...). Include metric.data.attributes.name (auto-creates the metric), a profile, a value for revenue attribution, and a uniqueId for deduplication. Custom metrics trigger listening flows. 2. Step 2 — Query events and metrics. MetricsApi.getMetrics() lists event types; EventsApi.getEvents({ sort: '-datetime', filter: 'equals(metricid,"...")' }) reads recent events. 3. Step 3 — Work with segments. SegmentsApi.getSegments() lists them, getSegmentProfiles() reads members, and getSegment({ additionalFieldsSegment: ['profilecount'] }) returns the size — check it before a send. 4. Step 4 — Create an email campaign. Four ordered calls: create a template, create the campaign (with audiences.included/excluded), assign the template to the campaign message, then create the campaign-send-job. Sending before the template is assigned returns a 400. 5. Step 5 — Query flows (read-only). FlowsApi.getFlows() lists flows; getFlowFlowActions({ id }) returns each flow's steps and their status. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/klaviyo-core-workflow-b