Skip to main content

Automate Facebook page token renewal with data tables storage

Workflow preview

Workflow preview
100%
Automate Facebook page token renewal with data tables storage preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Get Long Lived Facebook Page Access Token with Data Table Set up n8n self hosted via Tino.vn VPS — use code VPSN8N for up to 39% off (affiliate link) . Goo...

Best for

  • Social Media automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.set, n8n-nodes-base.splitout, n8n-nodes-base.datatable, n8n-nodes-base.scheduletrigger, n8n-nodes-base.stickynote, n8n-nodes-base.httprequest

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Đỗ Thành Nguyên.

Original n8n.io source

1.1 Workflow description

Title
Automate Facebook page token renewal with data tables storage
Workflow name
Automate Facebook page token renewal with data tables storage

Get Long-Lived Facebook Page Access Token with Data Table

> Set up n8n self-hosted via Tino.vn VPS — use code VPSN8N for up to 39% off (affiliate link).

Good to Know

This workflow automatically solves the common issue of Facebook Page Access Tokens expiring. It proactively renews your Page Tokens and stores them in an n8n Data Table.

It runs every two months, ensuring your Page Access Tokens remain valid. This guarantees seamless and uninterrupted automation for all your Facebook API integrations.

How It Works

The workflow performs the following steps to keep your tokens up to date:

  1. Schedule Trigger: The workflow runs on a set schedule — every two months by default.
  2. Set Parameters: It initializes the required credentials: client_id, client_secret, a short-lived user_access_token, and the app_scoped_user_id (all obtained from Facebook Developer Tools).
  3. Get Long-Lived User Token: It exchanges the short-lived User Access Token for a long-lived one.
  4. Get Page Tokens: Using the long-lived User Token, it fetches all pages you manage and their corresponding Page Access Tokens.
  5. Update Data Table: For each page, it extracts the access_token, name, and id, then performs an Upsert operation to update or insert rows in your n8n Data Table, ensuring the stored tokens are always current.

How to Use

  1. Import: Import this JSON file into your n8n instance.

  2. Configure Credentials: Open the Set Parameters node and replace the placeholder values for client_id, client_secret, user_access_token, and app_scoped_user_id with your actual credentials from Facebook.

  3. Configure Data Table: Open the Upsert row(s) node.

    • Select or create an n8n Data Table to store your tokens.
    • Make sure the column mapping (token, name_page, id_page) matches your table schema.
  4. Activate: Save and activate the workflow. It will now run automatically based on your configured schedule.

Requirements

  • n8n instance : > Set up n8n self-hosted via Tino.vn VPS — use code VPSN8N for up to 39% off (affiliate link).

  • Facebook App: A Facebook Developer App to generate the following credentials:

    • client_id and client_secret
    • A short-lived user_access_token
    • app_scoped_user_id
  • Data Table: An n8n Data Table configured with columns to store token information (e.g., token, name_page, id_page).

Customizing This Workflow

  • Change Schedule: To modify how often tokens are renewed, edit the Schedule Trigger node. You can change the interval from 2 months to 1 month, or schedule it for a specific day.
  • Filter Pages: If you only want to store tokens for specific pages, insert a Filter node right after Split Out. Use the page name or ID to filter before sending data to Upsert row(s).
  • Alternative Storage: Instead of an n8n Data Table, you can replace the Upsert row(s) node with another option (e.g., Google Sheets, a database, or a Set node) to store tokens elsewhere.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Set Parameter

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 2 - Split Out

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 3 - Edit Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 4 - Upsert row(s)

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 5 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 6 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Get long lived facebook user token

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 10 - Get list facebook page

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 11 - Get long lived facebook page token

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 12 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Automate Facebook page token renewal with data tables storage
Complexity intermediate
Nodes 12
Categories Social Media
Author Đỗ Thành Nguyên
Published 22 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10038/10038.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automate Facebook page token renewal with data tables storage do?

Get Long Lived Facebook Page Access Token with Data Table Set up n8n self hosted via Tino.vn VPS — use code VPSN8N for up to 39% off (affiliate link) . Goo...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Social Media use case.