This workflow corresponds to n8n.io template #13462 — we link there as the canonical source.
This workflow follows the Facebookgraphapi → Google Sheets recipe pattern — see all workflows that pair these two integrations.
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 →
{
"id": "Vkpuases5ZSfi3GW",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Facebook Page Posts Engagement Tracker",
"tags": [],
"nodes": [
{
"id": "b938db86-8dd7-445a-8f92-0d81046734a3",
"name": "When clicking \u2018Execute workflow\u2019",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-608,
352
],
"parameters": {},
"typeVersion": 1
},
{
"id": "1213ff29-4b1b-4b71-bb76-afb32304e9d2",
"name": "Split Out",
"type": "n8n-nodes-base.splitOut",
"position": [
368,
352
],
"parameters": {
"options": {},
"fieldToSplitOut": "data"
},
"typeVersion": 1
},
{
"id": "5cd6ab51-8cde-41e0-91f4-066729f04db0",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
688,
32
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "598703c8-9a88-4a09-8c50-812a788c746d",
"name": "Loop Over Items1",
"type": "n8n-nodes-base.splitInBatches",
"position": [
688,
352
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "f1657659-e735-4735-910e-6952b0f31d61",
"name": "Loop Over Items2",
"type": "n8n-nodes-base.splitInBatches",
"position": [
688,
720
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "62faf25e-2a7c-47e1-84c2-374c2694c9d5",
"name": "Wait",
"type": "n8n-nodes-base.wait",
"position": [
1424,
48
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "a5390558-7e9f-42d1-a792-82b3fee37875",
"name": "Wait1",
"type": "n8n-nodes-base.wait",
"position": [
1424,
368
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "9948a1c1-428a-42ea-8d38-a06aff4f58fe",
"name": "Wait2",
"type": "n8n-nodes-base.wait",
"position": [
1408,
736
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "c5754ded-c608-41c9-899c-9d81fa87f9f3",
"name": "Set Max Posts",
"type": "n8n-nodes-base.set",
"position": [
-320,
352
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "2e0b493d-87f3-443f-9b30-6a9d69fd9c2f",
"name": "max_post",
"type": "string",
"value": "3"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "582164d9-ff55-4e63-a76b-341a3ec6f978",
"name": "Get Page Info",
"type": "n8n-nodes-base.facebookGraphApi",
"position": [
-16,
352
],
"parameters": {
"node": "me",
"options": {},
"graphApiVersion": "v21.0"
},
"credentials": {
"facebookGraphApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "e9eeb903-18d3-406e-8536-691302905564",
"name": "Get Page Feed",
"type": "n8n-nodes-base.facebookGraphApi",
"position": [
160,
352
],
"parameters": {
"node": "={{ $json.id }}/feed",
"options": {
"queryParameters": {
"parameter": [
{
"name": "limit",
"value": "={{ $('Set Max Posts').item.json.max_post }}"
}
]
}
},
"graphApiVersion": "v21.0"
},
"credentials": {
"facebookGraphApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "9b882dd0-9e3e-4501-9461-c1373b3294e4",
"name": "Get comments",
"type": "n8n-nodes-base.facebookGraphApi",
"position": [
960,
48
],
"parameters": {
"edge": "comments",
"node": "={{ $json.id }}",
"options": {
"fields": {
"field": [
{
"name": "id,from,message,created_time,comments"
}
]
},
"queryParameters": {
"parameter": [
{
"name": "order",
"value": "reverse_chronological"
},
{
"name": "summary",
"value": "true"
},
{
"name": "filter",
"value": "stream"
}
]
}
},
"graphApiVersion": "v21.0"
},
"credentials": {
"facebookGraphApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "c6c2c7eb-8a22-4ff4-b7b0-a0ee1b2468cc",
"name": "Get Likes",
"type": "n8n-nodes-base.facebookGraphApi",
"position": [
960,
368
],
"parameters": {
"edge": "reactions",
"node": "={{ $json.id }}",
"options": {
"fields": {
"field": [
{
"name": "type"
}
]
},
"queryParameters": {
"parameter": [
{
"name": "order",
"value": "reverse_chronological"
},
{
"name": "summary",
"value": "true"
}
]
}
},
"graphApiVersion": "v21.0"
},
"credentials": {
"facebookGraphApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "836f8e5f-3606-4a4d-ab47-1a4c30f8537f",
"name": "Get Shares",
"type": "n8n-nodes-base.facebookGraphApi",
"position": [
944,
736
],
"parameters": {
"node": "={{ $json.id }}",
"options": {
"fields": {
"field": [
{
"name": "id,message,created_time,shares"
}
]
},
"queryParameters": {
"parameter": [
{
"name": "order",
"value": "reverse_chronological"
}
]
}
},
"graphApiVersion": "v21.0"
},
"credentials": {
"facebookGraphApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "033ead37-39a4-474d-be9c-e09ebfe6f6f6",
"name": "Add n. likes",
"type": "n8n-nodes-base.googleSheets",
"position": [
1216,
368
],
"parameters": {
"columns": {
"value": {
"LIKES": "={{ $json.summary.total_count }}",
"POST ID": "={{ $('Loop Over Items1').item.json.id }}"
},
"schema": [
{
"id": "POST ID",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "POST ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "POST",
"type": "string",
"display": true,
"required": false,
"displayName": "POST",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "LIKES",
"type": "string",
"display": true,
"required": false,
"displayName": "LIKES",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "COMMENTS",
"type": "string",
"display": true,
"required": false,
"displayName": "COMMENTS",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "SHARES",
"type": "string",
"display": true,
"required": false,
"displayName": "SHARES",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"POST ID"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1tZgsygFZ4xXNJ-CYWzib9zlaw6ZH2AHS8JoAjlvY65A/edit#gid=0",
"cachedResultName": "Foglio1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1tZgsygFZ4xXNJ-CYWzib9zlaw6ZH2AHS8JoAjlvY65A",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1tZgsygFZ4xXNJ-CYWzib9zlaw6ZH2AHS8JoAjlvY65A/edit?usp=drivesdk",
"cachedResultName": "Count Facebook Engagement"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "f8b05bc9-1cf6-4272-8f77-e54f38b0659b",
"name": "Add n. comments",
"type": "n8n-nodes-base.googleSheets",
"position": [
1216,
48
],
"parameters": {
"columns": {
"value": {
"POST": "={{ $('Loop Over Items').item.json.message }}",
"POST ID": "={{ $('Loop Over Items').item.json.id }}",
"COMMENTS": "={{ $json.summary.total_count }}"
},
"schema": [
{
"id": "POST ID",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "POST ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "POST",
"type": "string",
"display": true,
"required": false,
"displayName": "POST",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "LIKES",
"type": "string",
"display": true,
"required": false,
"displayName": "LIKES",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "COMMENTS",
"type": "string",
"display": true,
"required": false,
"displayName": "COMMENTS",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "SHARES",
"type": "string",
"display": true,
"required": false,
"displayName": "SHARES",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"POST ID"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1tZgsygFZ4xXNJ-CYWzib9zlaw6ZH2AHS8JoAjlvY65A/edit#gid=0",
"cachedResultName": "Foglio1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1tZgsygFZ4xXNJ-CYWzib9zlaw6ZH2AHS8JoAjlvY65A",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1tZgsygFZ4xXNJ-CYWzib9zlaw6ZH2AHS8JoAjlvY65A/edit?usp=drivesdk",
"cachedResultName": "Count Facebook Engagement"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "4d2c1a4c-7c79-41d9-bf34-90a51a1c7d9d",
"name": "Add n. shares",
"type": "n8n-nodes-base.googleSheets",
"position": [
1200,
736
],
"parameters": {
"columns": {
"value": {
"SHARES": "={{ $json.shares.count }}",
"POST ID": "={{ $('Loop Over Items2').item.json.id }}"
},
"schema": [
{
"id": "POST ID",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "POST ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "POST",
"type": "string",
"display": true,
"required": false,
"displayName": "POST",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "LIKES",
"type": "string",
"display": true,
"required": false,
"displayName": "LIKES",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "COMMENTS",
"type": "string",
"display": true,
"required": false,
"displayName": "COMMENTS",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "SHARES",
"type": "string",
"display": true,
"required": false,
"displayName": "SHARES",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"POST ID"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1tZgsygFZ4xXNJ-CYWzib9zlaw6ZH2AHS8JoAjlvY65A/edit#gid=0",
"cachedResultName": "Foglio1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1tZgsygFZ4xXNJ-CYWzib9zlaw6ZH2AHS8JoAjlvY65A",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1tZgsygFZ4xXNJ-CYWzib9zlaw6ZH2AHS8JoAjlvY65A/edit?usp=drivesdk",
"cachedResultName": "Count Facebook Engagement"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "eabe79a2-53a4-4bf8-a9fe-ca5f8acb2ca7",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-416,
-656
],
"parameters": {
"width": 752,
"height": 848,
"content": "## Facebook Page Posts Engagement Tracker Automation with Google Sheets\n\nThis workflow automatically **retrieves engagement data (likes, comments, and shares) from a Facebook Page** and stores the results in a Google Sheets document for reporting and analysis\n\n\nThis workflow is particularly useful for:\n\n* Social Media Managers\n* Marketing Agencies\n* Performance Analysts\n* Client reporting automation\n\nIt provides a lightweight but powerful engagement monitoring system without requiring expensive analytics tools.\n\n### **How it works:**\n\nThe workflow is manually triggered and starts by defining a maximum number of Facebook posts to analyze. It retrieves page details and feed data via the Facebook Graph API, then splits the feed into individual post items. Three parallel branches process comments, reactions (likes), and shares separately, making dedicated API calls for each metric with summary data.\n\nEach branch writes results to Google Sheets using POST ID as a unique key to append or update rows without duplication. Wait nodes are placed after Google Sheets operations to reduce the risk of hitting API rate limits. This modular structure ensures scalable, maintainable engagement tracking with structured data storage.\n\n\n### **Setup steps:**\n\nConfigure a Facebook Graph API credential in n8n using an access token from the Graph API Explorer, ensuring your page ID is accessible via the appropriate endpoint. Clone the provided Google Sheet or create one with required columns (POST ID, POST, LIKES, COMMENTS, SHARES), then set up Google Sheets OAuth2 credentials in n8n.\n\nAdjust the `max_post` value in the Set node to control how many posts are analyzed, and update the spreadsheet ID if needed. Test the workflow manually to verify API connectivity and data accuracy. Optionally, replace the manual trigger with a Schedule Trigger node to automate regular engagement tracking.\n"
},
"typeVersion": 1
},
{
"id": "04bc34cd-892b-4620-8bdf-dabf03f0c407",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-416,
224
],
"parameters": {
"color": 7,
"width": 288,
"height": 320,
"content": "## STEP 1 - Set Max Posts\n\nSet number max posts to analyze"
},
"typeVersion": 1
},
{
"id": "c0b431d1-78e5-4609-b6b4-39a3ce3fa6fc",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-96,
224
],
"parameters": {
"color": 7,
"width": 432,
"height": 320,
"content": "## STEP 2 - Obtain Access Token\n\nGet a temporary [access token](https://developers.facebook.com/tools/explorer/) for your Facebook Page\n"
},
"typeVersion": 1
},
{
"id": "25110bdd-1a9c-4337-a21a-fb946a687a55",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
624,
-64
],
"parameters": {
"color": 7,
"width": 960,
"height": 336,
"content": "## STEP 3- Get Facebook Comments"
},
"typeVersion": 1
},
{
"id": "93e35405-0406-429a-bef5-0a9f678f0bd0",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
624,
304
],
"parameters": {
"color": 7,
"width": 960,
"height": 288,
"content": "## STEP 4- Get Facebook Likes"
},
"typeVersion": 1
},
{
"id": "394c59a7-5fdb-4624-aade-bcc4ac020ba8",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
624,
640
],
"parameters": {
"color": 7,
"width": 960,
"height": 336,
"content": "## STEP 5 - Get Facebook Shares"
},
"typeVersion": 1
},
{
"id": "a73f7c0b-8cc4-4e5a-ad45-bb3c3b5e297b",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1184,
-656
],
"parameters": {
"color": 7,
"width": 736,
"height": 736,
"content": "## MY NEW YOUTUBE CHANNEL\n\ud83d\udc49 [Subscribe to my new **YouTube channel**](https://youtube.com/@n3witalia). Here I\u2019ll share videos and Shorts with practical tutorials and **FREE templates for n8n**.\n\n[](https://youtube.com/@n3witalia)"
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"binaryMode": "separate",
"availableInMCP": false,
"executionOrder": "v1"
},
"versionId": "9a999787-c1d5-4fe8-a2e6-f5a2879726ec",
"connections": {
"Wait": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Wait1": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
},
"Wait2": {
"main": [
[
{
"node": "Loop Over Items2",
"type": "main",
"index": 0
}
]
]
},
"Get Likes": {
"main": [
[
{
"node": "Add n. likes",
"type": "main",
"index": 0
}
]
]
},
"Split Out": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
},
{
"node": "Loop Over Items2",
"type": "main",
"index": 0
},
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
},
"Get Shares": {
"main": [
[
{
"node": "Add n. shares",
"type": "main",
"index": 0
}
]
]
},
"Add n. likes": {
"main": [
[
{
"node": "Wait1",
"type": "main",
"index": 0
}
]
]
},
"Get comments": {
"main": [
[
{
"node": "Add n. comments",
"type": "main",
"index": 0
}
]
]
},
"Add n. shares": {
"main": [
[
{
"node": "Wait2",
"type": "main",
"index": 0
}
]
]
},
"Get Page Feed": {
"main": [
[
{
"node": "Split Out",
"type": "main",
"index": 0
}
]
]
},
"Get Page Info": {
"main": [
[
{
"node": "Get Page Feed",
"type": "main",
"index": 0
}
]
]
},
"Set Max Posts": {
"main": [
[
{
"node": "Get Page Info",
"type": "main",
"index": 0
}
]
]
},
"Add n. comments": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Get comments",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items1": {
"main": [
[],
[
{
"node": "Get Likes",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items2": {
"main": [
[],
[
{
"node": "Get Shares",
"type": "main",
"index": 0
}
]
]
},
"When clicking \u2018Execute workflow\u2019": {
"main": [
[
{
"node": "Set Max Posts",
"type": "main",
"index": 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.
facebookGraphApigoogleSheetsOAuth2Api
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow automatically retrieves engagement data (likes, comments, and shares) from a Facebook Page and stores the results in a Google Sheets document for reporting and analysis.
Source: https://n8n.io/workflows/13462/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Triggers when a Telegram callback query is received. Evaluates the message with a conditional statement. Directs the flow based on language or action choice. Fetches data from Google Sheets once confi
This workflow automates posting Instagram Stories directly from a list of video URLs in a Google Sheet. Simply add a video link to the sheet, and this template will schedule and post it for you. It's
This workflow enables multi-platform social media posting using Google Sheets as the control center.
Okay, here are the "How It Works" and "Setup Steps" for your "Automated Social Media Content Distribution System," presented clearly in Markdown.
This workflow is ideal for individuals, marketers, agencies, and brands who want to effortlessly automate the entire blogging and social media process—from idea generation to promotion. Its primary go