workflows.fit
Back to n8n workflows
n8n templateFreeBy Geoffroy

Automated meta token renewal system with Graph API and data storage

Meta long-lived user tokens typically expire after ~60 days. If a token expires, any workflows that rely on it start failing. Manual renewal is easy to forget and time consuming. This template monitors the token you s...

DevelopmentCore NodesSchedule TriggerNo OpData TableIf
Loading interactive preview...

Template notes

Meta long-lived user tokens typically expire after ~60 days. If a token expires, any workflows that rely on it start failing. Manual renewal is easy to forget and time consuming. This template monitors the token you store in an n8n Data Table and refreshes it automatically before expiration, so your social automations keep running without surprises or late-night fire drills.

Who’s it for

Agencies, marketing team, creators managing Meta apps or scheduled social automations Anyone tired of “token expired” errors breaking flows at 2 a.m.

How it works / What it does

Triggers: scheduled every 10 days, plus a Manual Trigger for testing. Reads: pulls the current token row from your "Meta credential" Data Table (fields: token and expiresat). Decides: IF the token expires in ≤ 15 days, proceed to renewal; otherwise do nothing. Calls the Graph API to get a new access token Updates: computes the new ISO expiresat from expiresin and writes the fresh token + expiresat back to the Data Table. Note: Meta typically issues ~60-day long-lived tokens; confirm for your app.

Requirements

A Meta app with an initial (short-lived or long-lived) user access token n8n Data Tables enabled (you might need to update your instance to see the option) and a table named "Meta credential" with: token (string) expiresat (datetime)

How to set up