Daily
Get warned 30 days before a certificate expires
Each certificate close to expiry is flagged once, a month ahead, so you have time to renew it.
- Runs
- Daily
- Apps
- Cloudflare
- AI
- Not needed
- Access
- Zone: Read, SSL and Certificates: Read (confirmed for both endpoints)
Send this to your assistant
Create a ClickRuntime automation: every day at 8am, check the SSL certificates on my Cloudflare zones and post to #ops in Slack any that expire within 30 days, with the zone and expiry date. Only alert once per certificate.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
An expired certificate takes a site offline in the most public way possible. Browsers show a full-screen warning, API clients refuse to connect, and customers assume you have been hacked. It happens most often with certificates that are not renewed automatically, such as custom or uploaded ones that someone installed two years ago and forgot.
Every day, this lists your Cloudflare zones, checks the certificate packs and custom certificates on each, and flags any that expire within 30 days. Certificates that do not report an expiry date are skipped, and each certificate triggers only one alert, so you are not nagged daily.
Teams with custom certificates or many domains use it as insurance against the quiet renewal that never happens. The check is made against expiry dates that Cloudflare reports, so you see the same dates that would apply if nobody renewed anything, and no guessing is needed.
What you get out of it
Avoid an outage from a forgotten certificate
Thirty days is enough time to reissue and install a certificate without panic. The warning arrives while renewal is routine, not after customers see an error page. Thirty days is time enough to reissue and deploy a certificate calmly, without a rushed late-night fix and apologies to customers.
Protect revenue on checkout and login pages
An expired certificate on a shop or login page stops sales and sign-ins immediately. A single early warning is far cheaper than hours of lost orders. A shop or login page with an expired certificate stops taking orders and sign-ins at once, and every hour of that costs real money.
Cover certificates nobody owns
Custom certificates often outlive the person who installed them. A daily check across all zones makes sure ownerless certificates still get noticed. Certificates installed years ago by someone who has since left are exactly the ones that expire unnoticed, and a daily check covers them.
Keep many domains under control
Agencies with dozens of zones cannot track expiry dates by hand. One alert per certificate gives a clear, de-duplicated worklist. An agency with dozens of zones cannot track expiry dates by hand, and a single de-duplicated alert per certificate gives a clean worklist.
Meet security and client requirements
Many contracts and audits require valid certificates at all times. A recorded warning shows that you monitored expiry and acted well before it mattered. Many contracts require valid certificates at all times, and a recorded warning shows you were monitoring expiry well before a deadline.
How it works
What happens, step by step
Every day ClickRuntime checks the SSL certificates on each of your Cloudflare domains.
It looks for any that expire in the next 30 days.
It warns you only once per certificate, so you aren't reminded every day.
Your Slack channel gets the domain and the expiry date.
Before it runs live
- Connect Cloudflare
What you get
Build your own
Need it to work differently?
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 Cloudflare steps into one automation
Under the hood
The code that runs this automation
from datetime import datetime, timedelta, timezone
from clickruntime import on_trigger, credentials, http, notify, state
CF = "https://api.cloudflare.com/client/v4"
def cf(path, **params):
resp = http.get(f"{CF}{path}", params=params, headers={"Authorization": f"Bearer {credentials.secret('CLOUDFLARE_API_TOKEN')}"})
resp.raise_for_status()
return resp.json()["result"]
@on_trigger
def run(event):
soon = datetime.now(timezone.utc) + timedelta(days=30)
alerted = set(state.get("alerted") or [])
for zone in cf("/zones", per_page=50):
certs = [c for p in cf(f"/zones/{zone['id']}/ssl/certificate_packs") for c in p.get("certificates", [])]
certs += cf(f"/zones/{zone['id']}/custom_certificates")
for c in certs:
if not c.get("expires_on") or c["id"] in alerted:
continue
expires = datetime.fromisoformat(c["expires_on"].replace("Z", "+00:00"))
if expires < soon:
notify.slack(f"SSL certificate for {zone['name']} ({', '.join(c.get('hosts', []))}) expires {expires:%Y-%m-%d}", channel="#ops")
alerted.add(c["id"])
state.set("alerted", list(alerted))
return {"alerted": len(alerted)}FAQ
Common questions
Does it cover Cloudflare's automatically renewed certificates?
Why would a certificate be skipped?
Can I change the 30 day warning period?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Get a weekly Cloudflare traffic report
Every Monday you see requests, bandwidth and blocked threats for each site, with the change from the week before.
See how it worksEmail yourself a weekly DNS backup
Each week a copy of every DNS record in your zones lands in your inbox, ready to restore from.
See how it worksGet a Slack alert when a DNS record changes
Within the hour you know about any DNS record that was added, removed or edited, and what it looked like before.
See how it worksKeep exploring
Set up “Get warned 30 days before a certificate expires” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.