Skip to content

Every 15 minutes

Hear who enters a key segment

New members of a segment such as 'At risk' are posted to Slack so someone can follow up.

Runs
Every 15 minutes
Apps
Klaviyo
AI
Not needed
Access
read (segments, profiles)

Send this to your assistant

Create a ClickRuntime automation: every 15 minutes, check my Klaviyo 'At risk' segment and post anyone new to #retention in Slack.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Segments in Klaviyo describe moments that matter: customers who have spent over $1,000, subscribers who viewed a product three times without buying, people who just reached a loyalty tier. Membership changes on its own as behavior changes, and no one is told. A high-value customer might join the VIP segment on Monday and wait two weeks for the personal outreach that the program promised.

Every fifteen minutes, ClickRuntime lists the profiles currently in the segment you choose, compares them with the IDs it stored last time and treats the difference as new members. Each new member is posted to Slack, and the stored list is updated so the same person is not announced again.

Account managers and customer experience teams use it to make outreach feel timely and personal. No export or manual comparison is involved at any point.

What you get out of it

  • Timely outreach to valuable customers

    A thank-you or a personal offer sent shortly after someone reaches a top spending tier feels earned. Sent three weeks later, it feels like an afterthought from a mailing list.

  • Interest signals are acted on

    A segment of people who viewed a product repeatedly shows intent. Notifying a human lets someone reach out, answer a question or offer help while the shopper is still considering.

  • Segment definitions get tested in practice

    Seeing who actually enters the segment tells you whether its rules are right. If strange profiles keep appearing, you can fix the conditions before a campaign targets them. That is cheaper than discovering the mistake after a big send.

  • Hand-offs between teams are quicker

    When a profile enters a segment that sales or support cares about, the right person sees it without a request. That cuts the lag created by emailing around lists. Nobody has to chase a list through email first.

  • No recurring manual comparison

    Without this, someone would export the segment each week and compare it to the previous one by hand. A stored list and a diff replace that and cannot be forgotten.

How it works

What happens, step by step

  1. Every 15 minutes ClickRuntime gets everyone currently in a Klaviyo segment you care about, such as "At risk".

  2. It compares them with the members it saw last time and keeps only the people who are new to the segment.

  3. The new members are posted to your #retention Slack channel with their name and email, so someone can follow up.

Before it runs live

  • Connect Klaviyo

What you get

RunsEvery 15 minutes
Hear who enters a key segmenttoday, 9:00Succeeded
Slack · #retentionNew in At risk: • Sam sam@northwind.example

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Klaviyo steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
new_segment_member_alert.pyexample
from clickruntime import on_trigger, credentials, http, state, notify, report_fetched

API = "https://a.klaviyo.com/api"
AT_RISK_SEGMENT_ID = "Rk7Sgm"

def klaviyo():
    return {"Authorization": f"Klaviyo-API-Key {credentials.secret('KLAVIYO_API_KEY')}",
            "revision": "2024-10-15", "accept": "application/vnd.api+json", "content-type": "application/vnd.api+json"}

@on_trigger
def run(event):
    h, url, members = klaviyo(), f"{API}/segments/{AT_RISK_SEGMENT_ID}/profiles", []
    while url:
        page = http.get(url, headers=h, params={"fields[profile]": "email,first_name", "page[size]": 100}).json()
        members += page["data"]
        url = page["links"].get("next")
    known = state.get("members")
    new = [p for p in members if known is not None and p["id"] not in set(known)]
    report_fetched(len(new))
    state.set("members", [p["id"] for p in members])
    if not new:
        return {"summary": "Nothing new"}
    notify.slack("New in At risk:\n" + "\n".join(f"• {p['attributes'].get('first_name') or ''} {p['attributes']['email']}"
                                                  for p in new), channel="#retention")
    return {"posted": len(new)}

FAQ

Common questions

How does it tell who is new in the segment?
It keeps the profile IDs it saw on its last run. On each new run it fetches the current members and treats any ID that was not in the saved list as new. The first run only records the starting members, so it does not post hundreds of existing profiles.
What if someone leaves the segment and rejoins?
Because the comparison is against the previous run, a person who left and came back between runs would not appear as new, but one who was gone during a run and returns later would. Tell your assistant if you want rejoining members announced again.
Is there a size limit for the segment?
Klaviyo returns segment members in pages, and the automation reads through them. Very large segments take longer to check and are better handled with a less frequent schedule. For segments of a few thousand profiles, a fifteen-minute check works fine.
What permissions does it need?
read (segments, profiles). Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it checks. Checks that find nothing new and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Hear who enters a key segment” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.