Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Social Media Publishing

Social Media Publishing

Post to Instagram and Facebook with Auto-Refreshed Meta Tokens

On a schedule or when you run it, this publishes posts to Instagram and Facebook through the Meta Graph API and refreshes the system user token.

What it does

How to Generate a Facebook Short-Lived Access Token for Instagram + Facebook Page Posting ### What You Need * A Facebook account * A Facebook Page (must be linked to an Instagram Business account if you plan to post to IG) * Access to Meta for Developers --- Step-by-Step: How to Generate Your Short-Lived Token #### 1. Go to Meta for Developers * Visit: https://developers.facebook.com/apps * Log in with your Facebook credentials #### 2. Create a New App * Click the blue Create App button * Choose Other as the app type * On the next screen, select Business * Enter an app name and contact email, then click Create App #### 3. Open the App Dashboard * After creation, you’ll be redirected to the app’s dashboard * This is where you’ll manage products, permissions, and tokens #### 4. Add Products * In the left sidebar, scroll down to Add Product * Click Set Up on both: * Instagram Graph API * Facebook Graph API (If missing it is automatically setup when you create the app) > If you do not see the "Add Product" section, your app may already be locked to a specific template or be in Live mode. You can still continue to the Graph API Explorer. #### 5. Go to the Graph API Explorer * Visit: https://developers.facebook.com/tools/explorer/ * In the top-right dropdown, select your app * Under "User or Page", keep User Token selected #### 6. Generate a User Access Token * Click Get Token > Get User Access Token * A permissions dialog will appear #### 7. Select the Required Permissions (Scopes) Check the following boxes: * pages_show_list * pages_read_engagement * pages_manage_posts * instagram_basic * instagram_content_publish > These allow you to post to both Facebook Pages and Instagram accounts. Some may require approval for production use. #### 8. Authenticate and Authorize * A pop-up will prompt you to log into Facebook and approve the app * Be sure to authorize access to your Facebook Page and linked Instagram account #### 9. Copy the Short-Lived Token * After successful login, the Graph API Explorer will refresh * Your new short-lived token will appear in the top bar * Copy it immediately — this token is valid for 1–2 hours

The steps

  1. When clicking ‘Execute workflow’
  2. Post to Instagram
  3. Publish instagram post
  4. Refresh token
  5. Schedule Trigger
  6. Get Current Token
  7. Push to Static Data
  8. Get Token from static Data
  9. Post to Instagram1
  10. Publish instagram post1
  11. Post to Facebook
  12. Use System token to get page token
  13. Get Correct Page Token
  14. Wait 2 Second

18 steps in total.

Similar automations