# Detect lifecycle email fatigue

> Correlate email volume, opens, clicks, unsubscribes, activation, and churn to find where lifecycle messaging helps or hurts.

## Agent adaptation contract

- Canonical human page: https://agentry.sh/workflows/lifecycle-email-fatigue
- Execution mode: on_demand
- Immutable automation template: none
- Applies to: b2c-saas, b2b-saas, ecommerce, content-media
- Required example events: email_sent, email_clicked, email_unsubscribed
- Required Agentry resources: none declared
- Do not use when:
  - Do not use until the example events are mapped to observed project signals, the current onboarding state is verified, and live event/property reads prove the required data is present.
- Ask before using:
  - Which observed events map to email_sent, email_clicked, email_unsubscribed? Is the current onboarding state verified, and do live event/property reads show non-synthetic traffic for them?
  - Which live properties provide email_sent.sequence, email_sent.message_id, email_clicked.sequence, email_unsubscribed.sequence, and which stable user or account identifier joins the signals?

This is an adaptable workflow example, not an API recipe. Map event and property names to the project's saved signal map, require status: "verified" from GET /v1/projects/:project_id/onboarding, and confirm the required signals through live event/property metadata and rows. Fetch current OpenAPI or query-blueprint details before making calls. Do not infer unattended authority from this page.

## Why this matters

Lifecycle email can activate users or annoy them into leaving. The difference is visible when email events are joined with product behavior.

## What you get

- Sends, opens, clicks, and unsubscribes by sequence
- Activation after email clicks
- Churn or inactivity after high-volume sequences
- Recommendations to pause, rewrite, or segment messages

## Walk through it

**You:**
> Are our lifecycle emails helping or hurting?

**Agent:**
> I'll compare email engagement with activation and churn signals.

```text
Endpoint: POST /v1/projects/:project_id/analytics/query
Exact shape: /v1/openapi.json?path=%2Fv1%2Fprojects%2F%7Bproject_id%7D%2Fanalytics%2Fquery&method=post
Custom HogQL goes in the OpenAPI-defined `query` field.
Concept fields:
  query: "SELECT properties.sequence AS sequence, countIf(event = 'email_sent') AS sent, countIf(event = 'email_clicked') AS clicked, countIf(event = 'email_unsubscribed') AS unsubscribed FROM events WHERE event IN ('email_sent','email_clicked','email_unsubscribed') AND timestamp > now() - INTERVAL 30 DAY GROUP BY sequence ORDER BY sent DESC"
```

## The output

The agent returns sequences to keep, improve, or stop. It should segment by lifecycle stage before making broad recommendations.

## Setting it up

Forward email provider webhooks into Agentry as analytics events. Keep `distinct_id` stable with product events.

## Variations

- *"Show onboarding emails only."*
- *"Find messages with high clicks but low activation."*
- *"Draft improvements for the worst-performing sequence."*
