Skip to content

On a schedule

Get a Slack list of Chargebee trials ending soon

Every weekday at 9am, Chargebee trials ending in the next 3 days are posted to Slack with the customer, plan, end date and whether a payment method is on file.

Runs
On a schedule
Apps
Chargebee
AI
Not needed
Access
read-only key; chat:write

Send this to your assistant

Create a ClickRuntime automation: every weekday at 9am, post to #sales in Slack the Chargebee subscriptions whose trial ends in the next 3 days, with customer, plan, trial end date and whether they have a card on file.

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

The last days of a trial are when a short, helpful message changes the outcome. Chargebee knows exactly when each trial ends, but the sales team usually finds out after the subscription has already cancelled.

This checks Chargebee every weekday morning and posts the trials ending within three days to Slack. Trials with no saved card are marked and listed first, since those are the ones that will not convert on their own.

It suits SaaS teams with self-serve trials, founders who handle sales themselves and customer success teams that run onboarding calls.

What you get out of it

  • Reach out before the trial ends

    Three days' notice leaves time for a check-in email or a short call. After the end date, the customer has already moved on.

  • Focus on trials at risk

    Flagging no-card trials shows where effort makes a difference. Customers who already added a card need less attention.

  • Daily habit in the sales channel

    A morning post in Slack fits into how the team already works. No one needs to build a saved view in Chargebee.

  • Plan names included

    Knowing whether a trial is on the starter or growth plan helps decide who should follow up and what to say.

  • Read-only key

    The automation reads subscriptions and customers. It cannot extend trials, change plans or charge anyone.

How it works

What happens, step by step

  1. Every weekday morning ClickRuntime asks Chargebee for subscriptions still in trial.

  2. It keeps those whose trial ends within the next three days.

  3. For each one it notes the customer, plan, end date and whether a payment method is saved.

  4. The list is posted to your Slack channel, with no-card trials flagged first.

Before it runs live

  • Connect Chargebee

What you get

RunsOn a schedule
Get a Slack list of Chargebee trials ending soontoday, 9:00Succeeded
Slack · #sales⏳ 4 Chargebee trials end in the next 3 days ⚠️ Bluefin Labs (ops@bluefin.io) · growth-USD-monthly · ends Wed 12 Nov · no card ⚠️ Harbor & Co (sam@harborco.com) · starter-USD-monthly · ends Thu 13 Nov · no card ✅ Kestrel Media · growth-USD-yearly · ends Wed 12 Nov · card on file ✅ Ana Ruiz · starter-USD-monthly · ends Thu 13 Nov · card on file

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

  • Run it at a different time, more or less often, or only on weekdays
  • 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 Chargebee 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.
get_a_slack_list_of_chargebee_trials_ending_soon.pyexample
import time
from datetime import datetime
from clickruntime import on_trigger, credentials, http, notify

SITE = "yourcompany"  # yourcompany.chargebee.com
DAYS = 3

@on_trigger
def run(event):
    api, auth = f"https://{SITE}.chargebee.com/api/v2", (credentials.secret("CHARGEBEE_API_KEY"), "")
    params = {"status[is]": "in_trial", "trial_end[before]": int(time.time()) + DAYS * 86400,
              "sort_by[asc]": "updated_at", "limit": 100}
    rows = http.get(f"{api}/subscriptions", auth=auth, params=params).json()["list"]
    if not rows:
        return {"ending": 0}
    lines = []
    for r in sorted(rows, key=lambda r: (r["customer"].get("payment_method") is not None, r["subscription"]["trial_end"])):
        c, s = r["customer"], r["subscription"]
        name = c.get("company") or f"{c.get('first_name', '')} {c.get('last_name', '')}".strip() or c.get("email", c["id"])
        card = c.get("payment_method") is not None
        when = datetime.fromtimestamp(s["trial_end"]).strftime("%a %d %b")
        lines.append(f"{'✅' if card else '⚠️'} {name} ({c.get('email', '')}) · {s['subscription_items'][0]['item_price_id']} "
                     f"· ends {when} · {'card on file' if card else 'no card'}")
    notify.slack(f"⏳ {len(rows)} Chargebee trials end in the next {DAYS} days\n" + "\n".join(lines), channel="#sales")
    return {"ending": len(rows)}

FAQ

Common questions

Why does it matter whether there is a card on file?
A trial with a saved payment method usually converts on its own. A trial without one will cancel or go unpaid when it ends, so those are the customers worth a personal message first.
Can it skip weekends?
Yes, it runs Monday to Friday by default. Because it looks three days ahead, Monday's post already covers trials ending over the coming days.
Does it work with Chargebee's older product catalog?
This uses item price IDs from Product Catalog 2.0. On the older catalog the plan is in a plan_id field instead, and your assistant can switch to that.
What permissions does it need?
read-only key; chat:write. 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 runs (on a schedule). Checks that find nothing to do 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 “Get a Slack list of Chargebee trials ending soon” from your assistant

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