AutomationFlowsWeb Scraping › Daily Instagram Token Refresh Automation

Daily Instagram Token Refresh Automation

Original n8n title: Ig Token Refresh

ig-token-refresh. Uses httpRequest. Scheduled trigger; 3 nodes.

Cron / scheduled trigger★★★★☆ complexity3 nodesHTTP Request
Web Scraping Trigger: Cron / scheduled Nodes: 3 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "ig-token-refresh",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 3 * * *"
            }
          ]
        }
      },
      "id": "trigger",
      "name": "Daily @ 03:00 UTC",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        200,
        320
      ]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "https://graph.instagram.com/refresh_access_token",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "httpHeaderAuth",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "grant_type",
              "value": "ig_refresh_token"
            }
          ]
        },
        "options": {}
      },
      "id": "refresh",
      "name": "Refresh IG token",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        320
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Log the new token + expiry. n8n credentials are NOT updatable via REST API\n// on most self-hosted instances without admin PAT, so this just emits a log.\n// You can wire a Slack / Email node below to notify you when the expiry is <14d.\n\nconst { access_token, token_type, expires_in } = $json;\nconst expiresInDays = Math.round((expires_in || 0) / 86400);\nreturn {\n  json: {\n    notice: 'New long-lived IG token issued. Paste it back into the `IG Login - Leo Luis` credential manually.',\n    expires_in_days: expiresInDays,\n    new_token_preview: (access_token || '').slice(0, 12) + '\u2026',\n  },\n};\n"
      },
      "id": "log",
      "name": "Log new token",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        700,
        320
      ]
    }
  ],
  "connections": {
    "Daily @ 03:00 UTC": {
      "main": [
        [
          {
            "node": "Refresh IG token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Refresh IG token": {
      "main": [
        [
          {
            "node": "Log new token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "active": false,
  "versionId": "refresh-v1",
  "triggerCount": 0
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

ig-token-refresh. Uses httpRequest. Scheduled trigger; 3 nodes.

Source: https://github.com/leoaoluis/heph-dashboard/blob/8f673db7675c0320b893df1b2410673e5ab42f99/n8n-workflows/ig-token-refresh.json — original creator credit. Request a take-down →

More Web Scraping workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Web Scraping

Birthday Automation - Production (Fixed). Uses stopAndError, httpRequest, emailSend, bannerbear. Scheduled trigger; 86 nodes.

Stop And Error, HTTP Request, Email Send +1
Web Scraping

This template runs two scheduled workflows to govern Microsoft Entra ID (Azure AD) guest accounts by detecting stale users via Microsoft Graph, staging deletions in SharePoint with a 72-hour window, n

Microsoft SharePoint, Microsoft Teams, Microsoft Entra +1
Web Scraping

Jira-Allure-Auto-Qa. Uses httpRequest, jira. Scheduled trigger; 68 nodes.

HTTP Request, Jira
Web Scraping

Spotify-Sync-Surrealdb-V1. Uses httpRequest, n8n-nodes-surrealdb, spotify. Scheduled trigger; 62 nodes.

HTTP Request, N8N Nodes Surrealdb, Spotify
Web Scraping

As n8n instances scale, teams often lose track of sub-workflows—who uses them, where they are referenced, and whether they can be safely updated. This leads to inefficiencies like unnecessary copies o

HTTP Request, n8n, N8N Trigger +1