This workflow corresponds to n8n.io template #4929 β we link there as the canonical source.
This workflow follows the Executecommand β HTTP Request 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": "chcfJgqm2NoGDQCU",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "PageFB-FB-SchedulePost",
"tags": [
{
"id": "6E0gIDsPI6Rume0O",
"name": "Social media",
"createdAt": "2025-06-03T16:42:32.022Z",
"updatedAt": "2025-06-03T16:42:32.022Z"
},
{
"id": "q7URTQC723lARcBj",
"name": "Facebook",
"createdAt": "2025-06-03T16:45:27.162Z",
"updatedAt": "2025-06-03T16:45:27.162Z"
}
],
"nodes": [
{
"id": "e7cc6080-d4f3-4f3d-886a-2313aed9c697",
"name": "Image",
"type": "n8n-nodes-base.readWriteFile",
"position": [
200,
-380
],
"parameters": {
"options": {},
"fileSelector": "={{ $json.ImgPath + '/**.***'}}"
},
"typeVersion": 1
},
{
"id": "ed72dc72-bfbc-4993-bd65-944c9f086fe9",
"name": "Hastag",
"type": "n8n-nodes-base.readWriteFile",
"position": [
220,
40
],
"parameters": {
"options": {
"fileExtension": ".txt",
"dataPropertyName": "hashtag"
},
"fileSelector": "={{ $json.ImgPath +'/Caption/hashtag.txt' }}"
},
"typeVersion": 1
},
{
"id": "f76bf628-d924-4155-89cf-4cfa9c91159e",
"name": "Move image to Posted date folder",
"type": "n8n-nodes-base.executeCommand",
"position": [
1380,
-360
],
"parameters": {
"command": "=powershell -Command \"$d=Get-Date -Format 'yyyyMMdd'; $p='{{ $('ImgPath').item.json.ImgPath+'/' }}' + $d; New-Item -ItemType Directory -Path $p -Force; Move-Item -Path '{{ $('ImgPath').item.json.ImgPath + '/' + $('Merge1').item.json.fileName }}' -Destination $p\"\n"
},
"typeVersion": 1
},
{
"id": "c5193895-9d89-4c28-9635-a505de559e4d",
"name": "Description1",
"type": "n8n-nodes-base.readWriteFile",
"position": [
220,
-160
],
"parameters": {
"options": {
"fileExtension": ".txt",
"dataPropertyName": "description"
},
"fileSelector": "={{ $json.ImgPath + '/Caption/description.txt' }}"
},
"typeVersion": 1
},
{
"id": "9e796c5b-5e83-4dc0-8cfc-e4682fcc2c1a",
"name": "Extract from File",
"type": "n8n-nodes-base.extractFromFile",
"position": [
420,
-160
],
"parameters": {
"options": {},
"operation": "text",
"destinationKey": "description_random",
"binaryPropertyName": "description"
},
"typeVersion": 1
},
{
"id": "b827ecc0-955c-4757-b5a7-ac794169724a",
"name": "Code",
"type": "n8n-nodes-base.code",
"position": [
580,
-160
],
"parameters": {
"jsCode": "const lines = $input.first().json.description_random.split(/\\r?\\n/).filter(Boolean);\n\nconst random = lines[Math.floor(Math.random() * lines.length)];\nreturn [{ json: { description: random } }];"
},
"typeVersion": 2
},
{
"id": "15757ed4-bc84-4a62-ac2c-1b09587f14f6",
"name": "Merge",
"type": "n8n-nodes-base.merge",
"position": [
740,
20
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3.1
},
{
"id": "0a5fecce-b975-46a1-8631-2009cc2ab145",
"name": "Extract from File1",
"type": "n8n-nodes-base.extractFromFile",
"position": [
420,
40
],
"parameters": {
"options": {},
"operation": "text",
"destinationKey": "hashtag_random",
"binaryPropertyName": "hashtag"
},
"typeVersion": 1
},
{
"id": "d5f86f4f-7d21-4539-a9df-ed9f4fb16ebd",
"name": "Merge1",
"type": "n8n-nodes-base.merge",
"position": [
920,
-360
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3.1
},
{
"id": "adceb034-ed53-42bb-b107-768692e7da42",
"name": "Facebook Graph API - Photo",
"type": "n8n-nodes-base.facebookGraphApi",
"position": [
1060,
-360
],
"parameters": {
"edge": "photos",
"node": "me",
"options": {
"queryParameters": {
"parameter": [
{
"name": "message",
"value": "={{ $json.description + \"\\n\\n\" + $json.hashtag_random }}"
},
{
"name": "published",
"value": "true"
}
]
}
},
"sendBinaryData": true,
"graphApiVersion": "v22.0",
"httpRequestMethod": "POST",
"binaryPropertyName": "data"
},
"credentials": {
"facebookGraphApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "ed8d5c71-d74f-43fb-afb9-8ec1d01d220d",
"name": "ImgPath",
"type": "n8n-nodes-base.set",
"position": [
-100,
-160
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "8110d0be-82b5-4637-bb67-229481c91723",
"name": "ImgPath",
"type": "string",
"value": "E:/Autopost-media/PageFB/202506-Images"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "f73ebe72-e6b2-4d4e-9d91-d68743fa8be9",
"name": "Wait1",
"type": "n8n-nodes-base.wait",
"position": [
1220,
-360
],
"parameters": {
"amount": 10
},
"typeVersion": 1.1
},
{
"id": "57e4ee5f-d13c-4ff4-8344-8c1a07eb647f",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-380,
560
],
"parameters": {
"rule": {
"interval": [
{
"field": "hours",
"hoursInterval": 2,
"triggerAtMinute": 10
}
]
}
},
"typeVersion": 1.2
},
{
"id": "c6a49ce4-bdec-4470-9180-675b7f8b7d72",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-140,
-540
],
"parameters": {
"width": 1760,
"height": 820,
"content": "# A Image Facebook post"
},
"typeVersion": 1
},
{
"id": "f4e996ac-04fc-443c-a646-b54a58600b01",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
600,
2740
],
"parameters": {
"width": 2080,
"height": 1320,
"content": "# Multi-Photo FB Post\n- Cloudunary\n- Limit 3 Images/post"
},
"typeVersion": 1
},
{
"id": "add4e120-f093-414e-b7fe-b20f4d4ddeb9",
"name": "If",
"type": "n8n-nodes-base.if",
"position": [
1040,
1120
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "208ef60a-4235-4615-aa4d-ae83905df4d5",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.id }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "890895a5-8c0d-4adc-bc54-53fd7338afaa",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
1500,
1300
],
"parameters": {
"options": {
"reset": false
}
},
"typeVersion": 3
},
{
"id": "666ec878-cde2-4a5c-b2bc-7c5daa7644d7",
"name": "GET",
"type": "n8n-nodes-base.facebookGraphApi",
"position": [
1800,
900
],
"parameters": {
"edge": "=feed",
"node": "={{ $('ImgPath2').item.json.PageFBFB }}",
"options": {},
"graphApiVersion": "v22.0"
},
"credentials": {
"facebookGraphApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "61e8be98-f9c2-4c2a-870b-49142ed05430",
"name": "Limit1",
"type": "n8n-nodes-base.limit",
"position": [
400,
780
],
"parameters": {
"maxItems": 3
},
"typeVersion": 1
},
{
"id": "e6cf8b49-bffb-454f-9d19-29047d76e536",
"name": "Aggregate1",
"type": "n8n-nodes-base.aggregate",
"position": [
1000,
780
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "id"
}
]
}
},
"typeVersion": 1
},
{
"id": "22ebf0c7-9e5e-46c5-960c-c7908253112d",
"name": "upload to file server1",
"type": "n8n-nodes-base.httpRequest",
"position": [
640,
780
],
"parameters": {
"url": "https://api.cloudinary.com/v1_1/dxepor8fh/image/upload",
"method": "POST",
"options": {
"redirect": {
"redirect": {}
}
},
"sendBody": true,
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{
"name": "upload_preset",
"value": "srk_uploads"
},
{
"name": "file",
"parameterType": "formBinaryData",
"inputDataFieldName": "data"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "a57785d3-790e-4b4b-898a-e2b3c0247fef",
"name": "HTTP Request",
"type": "n8n-nodes-base.httpRequest",
"position": [
820,
780
],
"parameters": {
"url": "https://graph.facebook.com/v23.0/me/photos",
"method": "POST",
"options": {},
"sendBody": true,
"contentType": "multipart-form-data",
"authentication": "predefinedCredentialType",
"bodyParameters": {
"parameters": [
{
"name": "url",
"value": "={{ $json.url }}"
},
{
"name": "published",
"value": "false"
}
]
},
"nodeCredentialType": "facebookGraphApi"
},
"credentials": {
"facebookGraphApi": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "5d872967-7dfa-4313-9807-38b6999b3d6b",
"name": "Multi-Photo1",
"type": "n8n-nodes-base.facebookGraphApi",
"position": [
1440,
900
],
"parameters": {
"edge": "feed",
"node": "={{ $('ImgPath2').item.json.PageFBFB }}",
"options": {
"queryParameters": {
"parameter": [
{
"name": "message",
"value": "={{ $json.description + \"\\n\\n\" + $json.hashtag_random }}"
},
{
"name": "attached_media",
"value": "={{ JSON.stringify($json.id.map(media_id => ({ media_fbid: media_id }))) }}"
}
]
}
},
"graphApiVersion": "v22.0",
"httpRequestMethod": "POST"
},
"credentials": {
"facebookGraphApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "df0a3b80-a464-4471-a343-9ffd0273e5ca",
"name": "Image3",
"type": "n8n-nodes-base.readWriteFile",
"position": [
220,
780
],
"parameters": {
"options": {},
"fileSelector": "={{ $json.ImgPath + '**.***'}}"
},
"typeVersion": 1
},
{
"id": "cb2e5bca-3ca8-40a2-ad4a-5971c66ac625",
"name": "Hastag2",
"type": "n8n-nodes-base.readWriteFile",
"position": [
200,
580
],
"parameters": {
"options": {
"fileExtension": ".txt",
"dataPropertyName": "hashtag"
},
"fileSelector": "={{ $json.ImgPath +'Caption\\\\\\\\hashtag.txt' }}"
},
"typeVersion": 1
},
{
"id": "d0566983-4ba0-49ff-ae24-86bfad645a28",
"name": "Description2",
"type": "n8n-nodes-base.readWriteFile",
"position": [
200,
380
],
"parameters": {
"options": {
"fileExtension": ".txt",
"dataPropertyName": "description"
},
"fileSelector": "={{ $json.ImgPath + 'Caption/description.txt' }}"
},
"typeVersion": 1
},
{
"id": "3a59aa9d-8402-453f-bd48-26f1da438cdd",
"name": "Extract from File4",
"type": "n8n-nodes-base.extractFromFile",
"position": [
380,
380
],
"parameters": {
"options": {},
"operation": "text",
"destinationKey": "description_random",
"binaryPropertyName": "description"
},
"typeVersion": 1
},
{
"id": "fefa57a6-02cc-4671-a949-20b59d28f1f5",
"name": "Code2",
"type": "n8n-nodes-base.code",
"position": [
560,
380
],
"parameters": {
"jsCode": "const lines = $input.first().json.description_random.split(/\\r?\\n/).filter(Boolean);\n\nconst random = lines[Math.floor(Math.random() * lines.length)];\nreturn [{ json: { description: random } }];"
},
"typeVersion": 2
},
{
"id": "c9043785-d899-4244-9cee-a3a8961d0251",
"name": "Extract from File5",
"type": "n8n-nodes-base.extractFromFile",
"position": [
380,
580
],
"parameters": {
"options": {},
"operation": "text",
"destinationKey": "hashtag_random",
"binaryPropertyName": "hashtag"
},
"typeVersion": 1
},
{
"id": "6d46541e-0582-4030-9895-0d62b89c6039",
"name": "ImgPath2",
"type": "n8n-nodes-base.set",
"position": [
-40,
560
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "8110d0be-82b5-4637-bb67-229481c91723",
"name": "ImgPath",
"type": "string",
"value": "E:\\\\Autopost-media\\\\PageFB\\\\202506-Images\\\\"
},
{
"id": "1f40e74e-0baf-4905-88d4-296e34fab8b9",
"name": "PageFBFB",
"type": "string",
"value": "694076880451435"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "6c51d87e-6bda-4320-b0b8-81a522681cd0",
"name": "Move image to Posted date folder2",
"type": "n8n-nodes-base.executeCommand",
"position": [
1680,
1380
],
"parameters": {
"command": "=powershell -Command \"$d = Get-Date -Format 'yyyyMMdd'; $p = '{{ $('ImgPath2').item.json.ImgPath }}' + $d; New-Item -ItemType Directory -Path $p -Force; $files = @('{{ $json.mediafile }}'); foreach ($file in $files) { if (Test-Path $file) { Move-Item -Path $file -Destination $p -Force; Write-Host \\\"Moved: $file\\\" } else { Write-Host \\\"File not found: $file\\\" } }\""
},
"typeVersion": 1
},
{
"id": "1441ba89-00ba-4886-8232-a05ba330bd1a",
"name": "Wait2",
"type": "n8n-nodes-base.wait",
"position": [
1600,
900
],
"parameters": {
"amount": 10
},
"typeVersion": 1.1
},
{
"id": "1f1bb923-1098-460d-9744-9edcdd7016b1",
"name": "Caption",
"type": "n8n-nodes-base.merge",
"position": [
700,
560
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3.1
},
{
"id": "931c035c-2397-4419-ab43-1decc8a743d2",
"name": "PreparePost",
"type": "n8n-nodes-base.merge",
"position": [
1200,
900
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3.1
},
{
"id": "9618f9ae-447c-425d-922f-11d4c5cf1848",
"name": "MoveFile",
"type": "n8n-nodes-base.merge",
"position": [
1140,
1300
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "1e356986-65cb-4845-816d-f7aafe2513ed",
"name": "ImagePath",
"type": "n8n-nodes-base.set",
"position": [
1300,
1300
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "16b57477-fa2b-49b3-b987-69b3f7c0b028",
"name": "mediafile",
"type": "string",
"value": "={{ $('ImgPath2').item.json.ImgPath + $json.fileName}}"
}
]
}
},
"typeVersion": 3.4
}
],
"active": true,
"settings": {
"timezone": "Asia/Bangkok",
"callerPolicy": "workflowsFromSameOwner",
"executionOrder": "v1"
},
"versionId": "5b853a0e-5de3-4727-b591-be7d0be7309a",
"connections": {
"If": {
"main": [
[
{
"node": "MoveFile",
"type": "main",
"index": 0
}
]
]
},
"Code": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Code2": {
"main": [
[
{
"node": "Caption",
"type": "main",
"index": 0
}
]
]
},
"Image": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 1
}
]
]
},
"Wait1": {
"main": [
[
{
"node": "Move image to Posted date folder",
"type": "main",
"index": 0
}
]
]
},
"Wait2": {
"main": [
[
{
"node": "GET",
"type": "main",
"index": 0
},
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"Hastag": {
"main": [
[
{
"node": "Extract from File1",
"type": "main",
"index": 0
}
]
]
},
"Image3": {
"main": [
[
{
"node": "Limit1",
"type": "main",
"index": 0
}
]
]
},
"Limit1": {
"main": [
[
{
"node": "upload to file server1",
"type": "main",
"index": 0
},
{
"node": "MoveFile",
"type": "main",
"index": 1
}
]
]
},
"Merge1": {
"main": [
[
{
"node": "Facebook Graph API - Photo",
"type": "main",
"index": 0
}
]
]
},
"Caption": {
"main": [
[
{
"node": "PreparePost",
"type": "main",
"index": 1
}
]
]
},
"Hastag2": {
"main": [
[
{
"node": "Extract from File5",
"type": "main",
"index": 0
}
]
]
},
"ImgPath": {
"main": [
[
{
"node": "Image",
"type": "main",
"index": 0
},
{
"node": "Description1",
"type": "main",
"index": 0
},
{
"node": "Hastag",
"type": "main",
"index": 0
}
]
]
},
"ImgPath2": {
"main": [
[
{
"node": "Image3",
"type": "main",
"index": 0
},
{
"node": "Description2",
"type": "main",
"index": 0
},
{
"node": "Hastag2",
"type": "main",
"index": 0
}
]
]
},
"MoveFile": {
"main": [
[
{
"node": "ImagePath",
"type": "main",
"index": 0
}
]
]
},
"ImagePath": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Aggregate1": {
"main": [
[
{
"node": "PreparePost",
"type": "main",
"index": 0
}
]
]
},
"PreparePost": {
"main": [
[
{
"node": "Multi-Photo1",
"type": "main",
"index": 0
}
]
]
},
"Description1": {
"main": [
[
{
"node": "Extract from File",
"type": "main",
"index": 0
}
]
]
},
"Description2": {
"main": [
[
{
"node": "Extract from File4",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request": {
"main": [
[
{
"node": "Aggregate1",
"type": "main",
"index": 0
}
]
]
},
"Multi-Photo1": {
"main": [
[
{
"node": "Wait2",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Move image to Posted date folder2",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "ImgPath2",
"type": "main",
"index": 0
}
]
]
},
"Extract from File": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Extract from File1": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Extract from File4": {
"main": [
[
{
"node": "Code2",
"type": "main",
"index": 0
}
]
]
},
"Extract from File5": {
"main": [
[
{
"node": "Caption",
"type": "main",
"index": 1
}
]
]
},
"upload to file server1": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"Facebook Graph API - Photo": {
"main": [
[
{
"node": "Wait1",
"type": "main",
"index": 0
}
]
]
},
"Move image to Posted date folder2": {
"main": [
[
{
"node": "Loop Over Items",
"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.
facebookGraphApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
π Multi-Photo Facebook Post (Windows Directory) β How to Use β Requirements To run this automation, make sure you have the following:
Source: https://n8n.io/workflows/4929/ β original creator credit. Request a take-down β
More Social Media workflows β Β· Browse all categories β
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow automatically mirrors your YouTube to TikTok and Instagram, so you donβt have to manually download and re-upload your content across platforms.
This n8n workflow template automates the entire process of publishing Instagram Reels from content stored in Google Sheets and Google Drive. It's designed for content creators, social media managers,
β’ Downloads videos/music from YouTube using yt-dlp β’ Merges assets with dynamic text overlays β’ Automatically uploads to YouTube as Shorts (9:16 format) β’ Tracks everything in Google Sheets Install yt
How it works
This workflow is perfect for digital content creators, marketers, and social media managers who regularly create engaging short-form videos featuring inspirational or motivational quotes. While the wo