Skip to content

Daily

Get warned before your Facebook token expires

You get an email a week before your token stops working, so your Page automations don't fail quietly.

Runs
Daily
Apps
Facebook Pages
AI
Not needed
Access
app token

Send this to your assistant

Create a ClickRuntime automation: check my Facebook token every day and email me if it expires in the next 7 days.

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

A Facebook Page connection runs on an access token, and when that token expires every automation that depends on it stops working at once. Auto-posts do not go out, comment moderation goes quiet, and reports stop arriving. Nothing warns you, so the first sign is a customer saying you have not posted for a week, and a person with Page admin access has to reconnect. Renewing in advance avoids all of it.

Each day, ClickRuntime asks Facebook to inspect the token, reads its expiry date, and sends you an email only if fewer than seven days remain. On the other days it stays silent, so the message is a clear signal that action is due.

This is worth having for any Page that runs scheduled posts or monitoring, especially where the admin is not the person who built the setup.

What you get out of it

  • Avoid a silent outage

    A token that lapses over a weekend can mean several missed posts and unreviewed comments. A warning a week ahead gives you time to renew on a quiet weekday. Consistent posting matters to followers who expect it.

  • Protect scheduled campaigns

    Launches and promotions depend on posts going out on time. Renewing before expiry means the campaign never pauses because the credential behind it quietly ran out. A launch that stalls halfway is hard to recover.

  • Find the right person early

    Reconnecting needs someone with admin rights on the Page. A week's notice gives you time to reach that person, who may be traveling or on leave, before it becomes urgent.

  • Cut debugging time

    When automations fail, token expiry is a common cause that takes time to find. Knowing the date in advance rules it out and keeps real problems easier to diagnose. One less mystery in a long list of possible causes.

  • Stay quiet until needed

    The reminder only appears inside the final seven days, so it does not add to your daily email. When it arrives, it means something real. Warning fatigue never sets in.

How it works

What happens, step by step

  1. Every day ClickRuntime checks the Facebook connection your Page automations use.

  2. If it has already stopped working, you get an email asking you to reconnect Facebook in the ClickRuntime dashboard.

  3. If it will expire within 7 days, you get an email saying how many days are left, so you can renew it before anything fails. Otherwise it stays quiet.

Before it runs live

  • Connect Facebook Pages

What you get

RunsDaily
Get warned before your Facebook token expirestoday, 9:00Succeeded
Email · Facebook token expires in 5 daysReconnect Facebook in the ClickRuntime dashboard to renew it.

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 Facebook Pages 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.
page_token_expiry_reminder.pyexample
from datetime import datetime, timezone
from clickruntime import on_trigger, credentials, http, notify

@on_trigger
def run(event):
    app = f"{credentials.secret('FB_APP_ID')}|{credentials.secret('FB_APP_SECRET')}"
    data = http.get("https://graph.facebook.com/v21.0/debug_token",
                    params={"input_token": credentials.connection("facebook", "work"), "access_token": app}).json()["data"]
    expires = data.get("expires_at") or 0
    if not data["is_valid"]:
        notify.email_me("Facebook token is no longer valid", "Reconnect Facebook in the ClickRuntime dashboard.")
        return {"valid": False}
    if expires == 0:
        return {"valid": True, "expires": "never"}
    days = (datetime.fromtimestamp(expires, timezone.utc) - datetime.now(timezone.utc)).days
    if days < 7:
        notify.email_me(f"Facebook token expires in {days} day(s)", "Reconnect Facebook in the ClickRuntime dashboard to renew it.")
    return {"valid": True, "days_left": days}

FAQ

Common questions

How long does a Facebook Page token last?
It depends on the type. Some tokens last about sixty days, while others tied to a long-lived user token may not expire on a fixed date. The daily check reads the actual expiry from Facebook, so you do not need to guess. The check is reliable.
Is seven days fixed?
No. You can ask for a longer warning, such as fourteen days, or a second reminder on the final day. The only rule is that the check compares the stored expiry date with the date it runs.
What if the token has no expiry date?
Facebook reports some tokens as never expiring. In that case the check finds nothing to warn about and stays silent. It will still tell you if the token becomes invalid, for example after a password change.
What permissions does it need?
app token. 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 (daily). 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 warned before your Facebook token expires” from your assistant

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