Facebook 页面发帖计划
高级
这是一个Design, AI, Marketing领域的自动化工作流,包含 36 个节点。主要使用 If, Set, Code, Wait, Limit 等节点,结合人工智能技术实现智能自动化。 定时多图 Facebook 发帖,从 Windows 目录使用 Cloudinary
前置要求
- •可能需要目标 API 的认证凭证
- •Facebook Graph API 凭证
使用的节点 (36)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "chcfJgqm2NoGDQCU",
"meta": {
"instanceId": "52186cf1b8efe42bc5d27bbce9c2dedc42f74757c6fd390a78301306ccc29052",
"templateCredsSetupCompleted": true
},
"name": "Facebook 页面发帖计划",
"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": "图像",
"type": "n8n-nodes-base.readWriteFile",
"position": [
200,
-380
],
"parameters": {
"options": {},
"fileSelector": "={{ $json.ImgPath + '/**.***'}}"
},
"typeVersion": 1
},
{
"id": "ed72dc72-bfbc-4993-bd65-944c9f086fe9",
"name": "话题标签",
"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": "将图像移动到已发布日期文件夹",
"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": "描述1",
"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": "从文件提取",
"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": "代码",
"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": "合并",
"type": "n8n-nodes-base.merge",
"position": [
740,
20
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3.1
},
{
"id": "0a5fecce-b975-46a1-8631-2009cc2ab145",
"name": "从文件提取1",
"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": "合并1",
"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 - 照片",
"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": {
"id": "lD5bQ4cH7qrQ2UQ3",
"name": "Facebook Graph - PageFB"
}
},
"typeVersion": 1
},
{
"id": "ed8d5c71-d74f-43fb-afb9-8ec1d01d220d",
"name": "图像路径",
"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": "等待1",
"type": "n8n-nodes-base.wait",
"position": [
1220,
-360
],
"webhookId": "8e506978-bb6d-4c9e-963c-b4fa4e02d78f",
"parameters": {
"amount": 10
},
"typeVersion": 1.1
},
{
"id": "57e4ee5f-d13c-4ff4-8344-8c1a07eb647f",
"name": "计划触发器",
"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": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-140,
-540
],
"parameters": {
"width": 1760,
"height": 820,
"content": "# 单图 Facebook 帖子"
},
"typeVersion": 1
},
{
"id": "f4e996ac-04fc-443c-a646-b54a58600b01",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
600,
2740
],
"parameters": {
"width": 2080,
"height": 1320,
"content": "# 多图 Facebook 帖子"
},
"typeVersion": 1
},
{
"id": "add4e120-f093-414e-b7fe-b20f4d4ddeb9",
"name": "条件判断",
"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": "遍历项目",
"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": {
"id": "lD5bQ4cH7qrQ2UQ3",
"name": "Facebook Graph - PageFB"
}
},
"typeVersion": 1
},
{
"id": "61e8be98-f9c2-4c2a-870b-49142ed05430",
"name": "限制1",
"type": "n8n-nodes-base.limit",
"position": [
400,
780
],
"parameters": {
"maxItems": 3
},
"typeVersion": 1
},
{
"id": "e6cf8b49-bffb-454f-9d19-29047d76e536",
"name": "聚合1",
"type": "n8n-nodes-base.aggregate",
"position": [
1000,
780
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "id"
}
]
}
},
"typeVersion": 1
},
{
"id": "22ebf0c7-9e5e-46c5-960c-c7908253112d",
"name": "上传到文件服务器1",
"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 请求",
"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": {
"id": "lD5bQ4cH7qrQ2UQ3",
"name": "Facebook Graph - PageFB"
}
},
"typeVersion": 4.2
},
{
"id": "5d872967-7dfa-4313-9807-38b6999b3d6b",
"name": "多图1",
"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": {
"id": "lD5bQ4cH7qrQ2UQ3",
"name": "Facebook Graph - PageFB"
}
},
"typeVersion": 1
},
{
"id": "df0a3b80-a464-4471-a343-9ffd0273e5ca",
"name": "图像3",
"type": "n8n-nodes-base.readWriteFile",
"position": [
220,
780
],
"parameters": {
"options": {},
"fileSelector": "={{ $json.ImgPath + '**.***'}}"
},
"typeVersion": 1
},
{
"id": "cb2e5bca-3ca8-40a2-ad4a-5971c66ac625",
"name": "话题标签2",
"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": "描述2",
"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": "从文件提取4",
"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": "代码2",
"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": "从文件提取5",
"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": "图像路径2",
"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": "将图像移动到已发布日期文件夹2",
"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": "等待2",
"type": "n8n-nodes-base.wait",
"position": [
1600,
900
],
"webhookId": "8e506978-bb6d-4c9e-963c-b4fa4e02d78f",
"parameters": {
"amount": 10
},
"typeVersion": 1.1
},
{
"id": "1f1bb923-1098-460d-9744-9edcdd7016b1",
"name": "标题",
"type": "n8n-nodes-base.merge",
"position": [
700,
560
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3.1
},
{
"id": "931c035c-2397-4419-ab43-1decc8a743d2",
"name": "准备帖子",
"type": "n8n-nodes-base.merge",
"position": [
1200,
900
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3.1
},
{
"id": "9618f9ae-447c-425d-922f-11d4c5cf1848",
"name": "移动文件",
"type": "n8n-nodes-base.merge",
"position": [
1140,
1300
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "1e356986-65cb-4845-816d-f7aafe2513ed",
"name": "图像路径",
"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,
"pinData": {},
"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
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 设计, 人工智能, 营销
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
使用AI、ElevenLabs和多平台发布创建和审批POV视频
使用AI、ElevenLabs和多平台发布创建和审批POV视频(TikTok/IG/YT)
If
Set
Code
+20
60 节点Immanuel
设计
(Duc)深度研究市场模板
集成PerplexityAI研究和OpenAI内容的多层级WordPress博客生成器
If
Set
Xml
+28
132 节点Daniel Ng
人工智能
WordPress博客自动化专业版(SEO主题)v2
WordPress自动博客专业版 - SEO主题内容自动化机器
If
Set
Xml
+21
63 节点Daniel Ng
人工智能
WordPress博客自动化专业版(深度研究)v1
WordPress自动博客专业版 - 含深度研究的内容自动化机器
If
Set
Xml
+24
77 节点Daniel Ng
人工智能
[模板] AI宠物店 v8
🐶 AI宠物店助手 - 集成GPT-4o、Google日历和WhatsApp/Instagram/Facebook
If
N8n
Set
+38
244 节点Amanda Benks
销售
使用GPT-4o、WordPress和LinkedIn发布自动化RSS内容到博客文章
使用GPT-4o、WordPress和LinkedIn发布自动化RSS内容到博客文章
If
Set
Code
+21
40 节点Immanuel
人工智能
工作流信息
难度等级
高级
节点数量36
分类3
节点类型15
作者
SalmonRK-AI
@salmonrk-aiWebsite : SalmonRK-AI.com Facebook : Creative AI by Salmon Romkwan AI & Automation for content creator Live In thailand, some where in the world
外部链接
在 n8n.io 查看 →
分享此工作流