AutomationFlowsAI & RAG › Postfacebook

Postfacebook

PostFacebook. Uses googleSheets, lmChatOpenAi, outputParserStructured, googleDrive. Scheduled trigger; 28 nodes.

Cron / scheduled trigger★★★★☆ complexityAI-powered28 nodesGoogle SheetsOpenAI ChatOutput Parser StructuredGoogle DriveFacebook Graph ApiN8N Nodes PlacidChain LlmAgent
AI & RAG Trigger: Cron / scheduled Nodes: 28 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Agent → Chainllm 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 →

Download .json
{
  "createdAt": "2025-10-05T07:11:55.402Z",
  "updatedAt": "2025-10-07T03:07:37.000Z",
  "id": "ZOoqmJUlJW8VgAeM",
  "name": "PostFacebook",
  "active": true,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 8
            },
            {
              "triggerAtHour": 20
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -384,
        -112
      ],
      "id": "c97fc88a-b2f7-4c27-b952-16d537c7cba9",
      "name": "FB news LC"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            },
            {
              "triggerAtHour": 21
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -384,
        80
      ],
      "id": "4ea505ba-4152-4a34-9684-dd2d69a11aeb",
      "name": "FB AI news LC"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 0 16 * * 2,6"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -384,
        464
      ],
      "id": "5d8db2d0-c748-4234-8c42-36659e2141bc",
      "name": "FB Analysis LC"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 0 16 * * 1,4"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -384,
        272
      ],
      "id": "5acd89b1-2f92-48a7-b630-cf8b7178b38d",
      "name": "FB Analysis AI LC"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1fTKz8sabXOio65TmoqctZUDCtVR8hj8_zEXsJ_o_zVA",
          "mode": "list",
          "cachedResultName": "Multimedia Content",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fTKz8sabXOio65TmoqctZUDCtVR8hj8_zEXsJ_o_zVA/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fTKz8sabXOio65TmoqctZUDCtVR8hj8_zEXsJ_o_zVA/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "FB status",
              "lookupValue": "pending"
            },
            {
              "lookupColumn": "B\u00e0i vi\u1ebft t\u1eeb k\u00eanh",
              "lookupValue": "News"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -160,
        -112
      ],
      "id": "884e41fe-8cdd-4ec8-9432-047ccbea1dd0",
      "name": "Get row(s) in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1fTKz8sabXOio65TmoqctZUDCtVR8hj8_zEXsJ_o_zVA",
          "mode": "list",
          "cachedResultName": "Multimedia Content",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fTKz8sabXOio65TmoqctZUDCtVR8hj8_zEXsJ_o_zVA/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fTKz8sabXOio65TmoqctZUDCtVR8hj8_zEXsJ_o_zVA/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "B\u00e0i vi\u1ebft t\u1eeb k\u00eanh",
              "lookupValue": "AI news"
            },
            {
              "lookupColumn": "FB status",
              "lookupValue": "pending"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -160,
        176
      ],
      "id": "f7b260ae-1699-4e80-9532-61e17943ccac",
      "name": "Get row(s) in sheet1",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1fTKz8sabXOio65TmoqctZUDCtVR8hj8_zEXsJ_o_zVA",
          "mode": "list",
          "cachedResultName": "Multimedia Content",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fTKz8sabXOio65TmoqctZUDCtVR8hj8_zEXsJ_o_zVA/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fTKz8sabXOio65TmoqctZUDCtVR8hj8_zEXsJ_o_zVA/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "B\u00e0i vi\u1ebft t\u1eeb k\u00eanh",
              "lookupValue": "Analysis"
            },
            {
              "lookupColumn": "FB status",
              "lookupValue": "pending"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -160,
        464
      ],
      "id": "95a84986-97eb-476a-af1d-d8659126689e",
      "name": "Get row(s) in sheet3",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "1e149af3-39b4-4caf-800e-f1ad70612925",
              "leftValue": "={{ $json.category }}",
              "rightValue": "news",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        288,
        -32
      ],
      "id": "1af14c57-78c2-49d8-9bfb-ceb1620a3f92",
      "name": "If"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "d28cf415-91e3-46c1-ae03-ddeb15a28160",
              "name": "prompt",
              "value": "=B\u1ea1n l\u00e0 **Content Writer Gen Z c\u1ee7a Learning Chain**, c\u00f3 nhi\u1ec7m v\u1ee5 cung c\u1ea5p tin t\u1ee9c nhanh, l\u00f4i cu\u1ed1n, nh\u01b0ng v\u1eabn c\u00f3 g\u00f3c nh\u00ecn th\u1eb3ng th\u1eafn, **th\u00e2n m\u1eadt** v\u1edbi ng\u01b0\u1eddi \u0111\u1ecdc. *   **Phong c\u00e1ch:** Th\u00e2n thi\u1ec7n, g\u1ea7n g\u0169i (nh\u01b0 n\u00f3i chuy\u1ec7n v\u1edbi \"anh em\"), s\u1eed d\u1ee5ng icon h\u1ee3p l\u00fd, t\u1ed1c \u0111\u1ed9 nhanh. Ng\u00f4n ng\u1eef **ho\u00e0n to\u00e0n t\u1ef1 nhi\u00ean**, kh\u00f4ng d\u00f9ng bi\u1ec7t ng\u1eef AI/GPT, \u0111\u1ea3m b\u1ea3o ch\u1ea5t l\u01b0\u1ee3ng Human-like. *   **M\u1ee5c ti\u00eau:** Cung c\u1ea5p th\u00f4ng tin k\u1ecbp th\u1eddi v\u00e0 duy tr\u00ec s\u1ef1 t\u01b0\u01a1ng t\u00e1c cao.  ## 2. \u0110\u1eb7c t\u1ea3 C\u1ea5u tr\u00fac Output (Caption & Title for Thumbnail) Output ph\u1ea3i tu\u00e2n th\u1ee7 nghi\u00eam ng\u1eb7t c\u1ea5u tr\u00fac sau. TUY\u1ec6T \u0110\u1ed0I KH\u00d4NG S\u1eec D\u1ee4NG HTML.  ### A. Title (D\u00e0nh cho Thumbnail Image - G\u1eaeN L\u00caN \u1ea2NH) *   **\u0110\u1ecbnh d\u1ea1ng:** **2 d\u00f2ng ri\u00eang bi\u1ec7t.**     *   **D\u00f2ng 1 (T\u00f3m t\u1eaft):** C\u00e2u t\u00f3m t\u1eaft/Gi\u1eadt t\u00edt ng\u1eafn g\u1ecdn (T\u1ed1i \u0111a 7 t\u1eeb). PH\u1ea2I H\u1ea4P D\u1eaaN.     *   **D\u00f2ng 2 (C\u00e2u h\u1ecfi):** C\u00e2u h\u1ecfi m\u1edf, g\u1ee3i m\u1edf t\u01b0 duy ho\u1eb7c g\u00f3c nh\u00ecn (Kh\u00f4ng qu\u00e1 12 t\u1eeb).  ### B. Facebook Caption (Tin T\u1ee9c Nhanh) *   **C\u1ea5u tr\u00fac:** Ph\u1ea3i c\u00f3 3-4 \u0111o\u1ea1n r\u00f5 r\u00e0ng (Ph\u00e2n t\u00e1ch b\u1eb1ng 2 k\u00fd t\u1ef1 xu\u1ed1ng d\u00f2ng `\\n\\n`).     1.  **Ti\u00eau \u0111\u1ec1 H\u1ea5p d\u1eabn (1 d\u00f2ng):** S\u1eed d\u1ee5ng Icon (v\u00ed d\u1ee5: \ud83d\udd25, \ud83d\udca1).     2.  **T\u00f3m t\u1eaft Tin t\u1ee9c Nhanh:** Ch\u1eaft l\u1ecdc nhanh c\u00e1c \u0111i\u1ec3m ch\u00ednh t\u1eeb RAW_CONTENT (s\u1eed d\u1ee5ng ng\u00f4n ng\u1eef th\u00e2n m\u1eadt \"anh em\").     3.  **G\u00f3c nh\u00ecn Learning Chain:** \u0110\u01b0a ra 1-2 c\u00e2u nh\u1eadn x\u00e9t/g\u00f3c nh\u00ecn ng\u1eafn **mang t\u00ednh ch\u1ea5t c\u00e1 nh\u00e2n** (v\u00ed d\u1ee5: \"\u0110i\u1ec1u n\u00e0y cho th\u1ea5y...\", \"Theo m\u00ecnh th\u00ec...\").     4.  **CTA & Hashtag:** C\u00e2u h\u1ecfi th\u00e2n thi\u1ec7n, khuy\u1ebfn kh\u00edch th\u1ea3o lu\u1eadn **(DUY NH\u1ea4T 1 c\u00e2u h\u1ecfi)**. S\u1eed d\u1ee5ng **T\u1ed0I \u0110A 5 Hashtag** (bao g\u1ed3m #learningchain v\u00e0 ph\u1ea3i \u1edf 1 d\u00f2ng ri\u00eang bi\u1ec7t cu\u1ed1i c\u00f9ng). *   **\u0110\u1ed9 d\u00e0i:** T\u1ed5ng b\u00e0i vi\u1ebft ** NG\u1eaeN**, kh\u00f4ng qu\u00e1 500 t\u1eeb.  ## 3. D\u1eef li\u1ec7u \u0110\u1ea7u v\u00e0o (Input Variables)  ### RAW_CONTENT {{ $json['n\u1ed9i dung raw '] }}\n\noutput tu\u00e2n theo json:\n\n{\n  \"content\": \"n\u1ed9i dung b\u00e0i \u0111\u0103ng\",\n  \"top\": \"title top\",\n  \"bottom\": \"tittle bottom\"\n}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        512,
        -128
      ],
      "id": "7494f51e-550e-47a5-af89-22aedbe92891",
      "name": "prompt_news"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "5f28bfa3-0c0e-4a9b-b5ce-5e5eb5e92631",
              "name": "prompt",
              "value": "=B\u1ea1n l\u00e0 **Chuy\u00ean gia Ph\u00e2n t\u00edch C\u1ea5p cao c\u1ee7a Learning Chain** (C\u00f4ng ty truy\u1ec1n th\u00f4ng & gi\u00e1o d\u1ee5c v\u1ec1 AI/Crypto). Nhi\u1ec7m v\u1ee5 c\u1ee7a b\u1ea1n l\u00e0 bi\u1ebfn n\u1ed9i dung th\u00f4 (RAW_CONTENT) th\u00e0nh m\u1ed9t b\u00e0i ph\u00e2n t\u00edch chuy\u00ean s\u00e2u, c\u00f3 g\u00f3c nh\u00ecn, nh\u1eadn \u0111\u1ecbnh ri\u00eang, mang t\u00ednh gi\u00e1o d\u1ee5c v\u00e0 t\u01b0 duy. *   **Phong c\u00e1ch:** Chuy\u00ean nghi\u1ec7p, s\u1eafc s\u1ea3o, c\u00f3 t\u00ednh thuy\u1ebft ph\u1ee5c cao. Ng\u00f4n ng\u1eef **ho\u00e0n to\u00e0n t\u1ef1 nhi\u00ean**, kh\u00f4ng d\u00f9ng bi\u1ec7\nt ng\u1eef AI/GPT, \u0111\u1ea3m b\u1ea3o ng\u01b0\u1eddi \u0111\u1ecdc kh\u00f4ng th\u1ec3 ph\u00e2n bi\u1ec7t \u0111\u01b0\u1ee3c AI hay ng\u01b0\u1eddi vi\u1ebft (Human-like Quality). *   **M\u1ee5c ti\u00eau:** \u0110\u1ecbnh v\u1ecb Learning Chain l\u00e0 ngu\u1ed3n ki\u1ebfn th\u1ee9c \u0111\u00e1ng tin c\u1eady.  ## 2. \u0110\u1eb7c t\u1ea3 C\u1ea5u tr\u00fac Output (Caption & Title for Thumbnail) Output ph\u1ea3i tu\u00e2n th\u1ee7 nghi\u00eam ng\u1eb7t c\u1ea5u tr\u00fac sau. TUY\u1ec6T \u0110\u1ed0I KH\u00d4NG S\u1eec D\u1ee4NG HTML.  ### A. Title (D\u00e0nh cho Thumbnail Image - G\u1eaeN L\u00caN \u1ea2NH) *   **\u0110\u1ecbnh d\u1ea1ng:** **2 d\u00f2ng ri\u00eang bi\u1ec7t.**     *   **D\u00f2ng 1 (T\u00f3m t\u1eaft):** C\u00e2u t\u00f3m t\u1eaft/Gi\u1eadt t\u00edt ng\u1eafn g\u1ecdn (T\u1ed1i \u0111a 7 t\u1eeb). PH\u1ea2I H\u1ea4P D\u1eaaN.     *   **D\u00f2ng 2 (C\u00e2u h\u1ecfi):** C\u00e2u h\u1ecfi m\u1edf, g\u1ee3i m\u1edf t\u01b0 duy ho\u1eb7c g\u00f3c nh\u00ecn (Kh\u00f4ng qu\u00e1 15 t\u1eeb).  ### B. Facebook Caption (Ph\u00e2n t\u00edch Chuy\u00ean s\u00e2u) *   **C\u1ea5u tr\u00fac:** Ph\u1ea3i c\u00f3 4 ph\u1ea7n r\u00f5 r\u00e0ng (Ph\u00e2n t\u00e1ch b\u1eb1ng 2 k\u00fd t\u1ef1 xu\u1ed1ng d\u00f2ng `\\n\\n`).     1.  **M\u1edf b\u00e0i:** \u0110\u1eb7t v\u1ea5n \u0111\u1ec1, gi\u1edbi thi\u1ec7u ch\u1ee7 \u0111\u1ec1 m\u1ed9t c\u00e1ch thu h\u00fat.     2.  **Ph\u00e2n t\u00edch/Nh\u1eadn \u0111\u1ecbnh S\u00e2u:** Tr\u00ecnh b\u00e0y c\u00e1c \u00fd ch\u00ednh t\u1eeb RAW_CONTENT v\u00e0 **l\u1ed3ng gh\u00e9p nh\u1eadn \u0111\u1ecbnh/b\u00e0i h\u1ecdc t\u01b0 duy** c\u1ee7a Learning Chain.     3.  **H\u00e0nh \u0111\u1ed9ng/B\u00e0i h\u1ecdc:** K\u1ebft lu\u1eadn v\u1ec1 \u00fd ngh\u0129a, b\u00e0i h\u1ecdc r\u00fat ra, ho\u1eb7c d\u1ef1 b\u00e1o d\u00e0i h\u1ea1n.     4.  **CTA & Hashtag:** C\u00e2u h\u1ecfi th\u00e2n thi\u1ec7n, khuy\u1ebfn kh\u00edch th\u1ea3o lu\u1eadn **(DUY NH\u1ea4T 1 c\u00e2u h\u1ecfi)**. S\u1eed d\u1ee5ng **T\u1ed0I \u0110A 5 Hashtag** (bao g\u1ed3m #learningchain v\u00e0 ph\u1ea3i \u1edf 1 d\u00f2ng ri\u00eang bi\u1ec7t cu\u1ed1i c\u00f9ng). *   **\u0110\u1ed9 d\u00e0i:** T\u1ed5ng b\u00e0i vi\u1ebft kh\u00f4ng qu\u00e1 800 t\u1eeb (\u01afu ti\u00ean 400-600 t\u1eeb).  ## 3. D\u1eef li\u1ec7u \u0110\u1ea7u v\u00e0o (Input Variables)  ### RAW_CONTENT### RAW_CONTENT {{ $json['n\u1ed9i dung raw '] }} \n\noutput tu\u00e2n theo json:  \n{   \n\"content\": \"n\u1ed9i dung b\u00e0i \u0111\u0103ng l\u01b0u \u00fd 1 b\u00e0i \u0111\u0103ng ho\u00e0n ch\u1ec9nh, s\u1eb5n s\u00e0ng \u0111\u0103ng l\u1eadp t\u1ee9c, tr\u00e1nh c\u00e1c nh\u00e3n n\u1ed9i b\u1ed9 nh\u01b0 CTA & Hashtag, m\u1edf b\u00e0i, th\u00e2n b\u00e0i , v.v\",   \n\"top\": \"title top\",   \n\"bottom\": \"tittle bottom\" \n}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        512,
        112
      ],
      "id": "0450a77b-5097-4814-aa59-e93cf64611f3",
      "name": "prompt_analysis"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-5-mini",
          "mode": "list",
          "cachedResultName": "gpt-5-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        800,
        96
      ],
      "id": "034a0526-c767-40ce-b48f-f579ae42912a",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "\n{\n  \"content\": \"n\u1ed9i dung b\u00e0i \u0111\u0103ng\",\n  \"top\": \"title top\",\n  \"bottom\": \"tittle bottom\"\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        928,
        96
      ],
      "id": "256f3b70-d83f-4938-8b97-ef76fc500708",
      "name": "Structured Output Parser"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "529663a1-a98c-43fa-a4b5-853539162c8c",
              "leftValue": "={{ $('l\u1ecdc d\u1eef li\u1ec7u').item.json.field }}",
              "rightValue": "crypto",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1424,
        176
      ],
      "id": "ef5a16f9-35eb-423f-abfa-beda4340ab47",
      "name": "If1"
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "value": "1AQ6ldv0L74He_7S7uvHmzbD0LSsN9y9b",
          "mode": "list",
          "cachedResultName": "fb.jpg",
          "cachedResultUrl": "https://drive.google.com/file/d/1AQ6ldv0L74He_7S7uvHmzbD0LSsN9y9b/view?usp=drivesdk"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        1648,
        80
      ],
      "id": "dc0ff672-75b3-4dc8-85cb-b29b1d8e9a50",
      "name": "Download file",
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "mode": "combine",
        "combineBy": "combineByPosition",
        "options": {}
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        1200,
        176
      ],
      "id": "fadc03c4-5efb-4174-aecf-2aee8af9d794",
      "name": "Merge"
    },
    {
      "parameters": {
        "language": "python",
        "pythonCode": "\nimport os\nimport sys\nimport json\nimport re\nfrom datetime import datetime\ntry:\n    from zoneinfo import ZoneInfo\n    tz = ZoneInfo(\"Asia/Ho_Chi_Minh\")\nexcept Exception:\n    try:\n        import pytz\n        tz = pytz.timezone(\"Asia/Ho_Chi_Minh\")\n    except Exception:\n        tz = None  # will use system localtime\n\ninput = _input.all()[-1]\n\ndef vn_weekday_name(dt):\n    wd = dt.weekday() \n    mapping = {\n        0: \"Th\u1ee9 2\",\n        1: \"Th\u1ee9 3\",\n        2: \"Th\u1ee9 4\",\n        3: \"Th\u1ee9 5\",\n        4: \"Th\u1ee9 6\",\n        5: \"Th\u1ee9 7\",\n        6: \"Ch\u1ee7 nh\u1eadt\"\n    }\n    return mapping.get(wd, \"\")\n\ndef format_vn_datetime(dt):\n\n    day_name = vn_weekday_name(dt)\n    d = dt.day\n    m = dt.month\n    y = dt.year\n    date_str = f\"{d}/{m}/{y}\"\n    return f\"{day_name}, {date_str}\"\n\ndef detect_topic_pair(title):\n    \"\"\"\n    Tr\u1ea3 v\u1ec1 dict: {\"category\": ..., \"topic\": ...}\n    - category: \"news\" | \"analysis\" | \"other\"   (\u01b0u ti\u00ean)\n    - topic: \"ai\" | \"crypto\"\n    \"\"\"\n    if not title:\n        return {\"category\": \"other\", \"topic\": \"crypto\"}\n\n    txt = title.lower()\n\n    # Word-boundary checks (primary)\n    has_news = bool(re.search(r'(?<!\\w)news(?!\\w)', txt, flags=re.IGNORECASE))\n    has_analysis = bool(re.search(r'(?<!\\w)analysis(?!\\w)', txt, flags=re.IGNORECASE))\n    has_ai = bool(re.search(r'(?<!\\w)ai(?!\\w)', txt, flags=re.IGNORECASE))\n\n    # Fallback substring checks (looser) if word-boundary didn't match\n    if not has_news and \"news\" in txt:\n        has_news = True\n    if not has_analysis and \"analysis\" in txt:\n        has_analysis = True\n    if not has_ai and \"ai\" in txt:\n        has_ai = True\n\n    # category priority: news -> analysis -> other\n    if has_news:\n        category = \"news\"\n    elif has_analysis:\n        category = \"analysis\"\n    else:\n        category = \"other\"\n\n    # topic: ai if ai present, else crypto\n    topic = \"ai\" if has_ai else \"crypto\"\n\n    return category, topic\n\ndef now_with_tz():\n    if tz:\n        try:\n            return datetime.now(tz)\n        except Exception:\n            return datetime.now()\n    else:\n        return datetime.now()\n\ntitle = input.json[\"B\u00e0i vi\u1ebft t\u1eeb k\u00eanh\"]\ndt = now_with_tz()\ndate_display = format_vn_datetime(dt)\ncategory, topic = detect_topic_pair(title)\n\ninput.json.datetime_vn = date_display\ninput.json.field = topic\ninput.json.category = category\nreturn input"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        64,
        176
      ],
      "id": "f3de9c0d-0faf-406e-bbd3-399333f529d1",
      "name": "l\u1ecdc d\u1eef li\u1ec7u"
    },
    {
      "parameters": {
        "httpRequestMethod": "POST",
        "graphApiVersion": "v23.0",
        "node": "me",
        "edge": "photos",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "message",
                "value": "={{ $('t\u1ea1o content cu\u1ed1i c\u00f9ng').item.json.output.content }}"
              },
              {
                "name": "url",
                "value": "={{ $json.image_url }}"
              }
            ]
          }
        }
      },
      "type": "n8n-nodes-base.facebookGraphApi",
      "typeVersion": 1,
      "position": [
        2096,
        176
      ],
      "id": "9070a66d-e960-4d89-86d1-50669dc6d919",
      "name": "Learning chain vietnam",
      "credentials": {
        "facebookGraphApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "template_id": {
          "__rl": true,
          "value": "nkjllkaujfdbw",
          "mode": "list",
          "cachedResultName": "FB AI"
        },
        "layers": {
          "layerItems": [
            {
              "layerId": "main_image|picture",
              "property": "image",
              "imageValue": "={{ $json.data.task_result.images[0].url }}"
            },
            {
              "layerId": "time|text",
              "property": "text",
              "textValue": "={{ $('l\u1ecdc d\u1eef li\u1ec7u').item.json.datetime_vn }}"
            },
            {
              "layerId": "thumbnail_top|text",
              "valueValue": "={{ $('t\u1ea1o content cu\u1ed1i c\u00f9ng').item.json.output.top }}"
            },
            {
              "layerId": "thumbnail_bottom|text",
              "valueValue": "={{ $('t\u1ea1o content cu\u1ed1i c\u00f9ng').item.json.output.bottom }}"
            }
          ]
        },
        "additionalFields": {}
      },
      "type": "n8n-nodes-placid.placid",
      "typeVersion": 1,
      "position": [
        1872,
        368
      ],
      "id": "e5faa08e-ab19-470f-9a80-0caa0ad69c3f",
      "name": "AI",
      "credentials": {
        "placidApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "template_id": {
          "__rl": true,
          "value": "nkjllkaujfdbw",
          "mode": "list",
          "cachedResultName": "FB AI"
        },
        "layers": {
          "layerItems": [
            {
              "layerId": "New picture layer|picture",
              "property": "imageBinary",
              "imageBinaryValue": "data"
            },
            {
              "layerId": "main_image|picture",
              "property": "image",
              "imageValue": "={{ $json.data.task_result.images[0].url }}"
            },
            {
              "layerId": "time|text",
              "property": "text",
              "textValue": "={{ $('l\u1ecdc d\u1eef li\u1ec7u').item.json.datetime_vn }}"
            },
            {
              "layerId": "thumbnail_bottom|text",
              "property": "text",
              "textValue": "={{ $('t\u1ea1o content cu\u1ed1i c\u00f9ng').item.json.output.bottom }}"
            },
            {
              "layerId": "thumbnail_top|text",
              "property": "text",
              "textValue": "={{ $('t\u1ea1o content cu\u1ed1i c\u00f9ng').item.json.output.top }}"
            }
          ]
        },
        "additionalFields": {}
      },
      "type": "n8n-nodes-placid.placid",
      "typeVersion": 1,
      "position": [
        1872,
        80
      ],
      "id": "347b6123-d5a6-4fc4-bcd5-6a5d637eeac3",
      "name": "Crypto",
      "credentials": {
        "placidApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "httpRequestMethod": "POST",
        "graphApiVersion": "v23.0",
        "node": "me",
        "edge": "photos",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "message",
                "value": "={{ $('t\u1ea1o content cu\u1ed1i c\u00f9ng').item.json.output.content }}"
              },
              {
                "name": "url",
                "value": "={{ $json.image_url }}"
              }
            ]
          }
        }
      },
      "type": "n8n-nodes-base.facebookGraphApi",
      "typeVersion": 1,
      "position": [
        2096,
        -16
      ],
      "id": "1c65c9fb-cefc-4477-8f84-47e6bc805a52",
      "name": "Learning chain academy",
      "credentials": {
        "facebookGraphApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "httpRequestMethod": "POST",
        "graphApiVersion": "v23.0",
        "node": "me",
        "edge": "photos",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "message",
                "value": "={{ $('t\u1ea1o content cu\u1ed1i c\u00f9ng').item.json.output.content }}"
              },
              {
                "name": "url",
                "value": "={{ $json.image_url }}"
              }
            ]
          }
        }
      },
      "type": "n8n-nodes-base.facebookGraphApi",
      "typeVersion": 1,
      "position": [
        2096,
        368
      ],
      "id": "a3dfbb7f-c72f-4cb0-bb11-9ce8fdd8edf7",
      "name": "H\u1ecdc vi\u1ec7n LC",
      "credentials": {
        "facebookGraphApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1fTKz8sabXOio65TmoqctZUDCtVR8hj8_zEXsJ_o_zVA",
          "mode": "list",
          "cachedResultName": "Multimedia Content",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fTKz8sabXOio65TmoqctZUDCtVR8hj8_zEXsJ_o_zVA/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fTKz8sabXOio65TmoqctZUDCtVR8hj8_zEXsJ_o_zVA/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": "={{ $('l\u1ecdc d\u1eef li\u1ec7u').item.json.row_number }}",
            "FB status": "done"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "B\u00e0i vi\u1ebft t\u1eeb k\u00eanh",
              "displayName": "B\u00e0i vi\u1ebft t\u1eeb k\u00eanh",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Tittle b\u00e0i vi\u1ebft g\u1ed1c",
              "displayName": "Tittle b\u00e0i vi\u1ebft g\u1ed1c",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Link b\u00e0i vi\u1ebft g\u1ed1c",
              "displayName": "Link b\u00e0i vi\u1ebft g\u1ed1c",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Tittle b\u00e0i vi\u1ebft m\u1edbi",
              "displayName": "Tittle b\u00e0i vi\u1ebft m\u1edbi",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "n\u1ed9i dung raw ",
              "displayName": "n\u1ed9i dung raw ",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "meta_description",
              "displayName": "meta_description",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "suggest tags",
              "displayName": "suggest tags",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "key_word",
              "displayName": "key_word",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "slug",
              "displayName": "slug",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "thumbnail_url",
              "displayName": "thumbnail_url",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "N\u1ed9i dung b\u00e0i vi\u1ebft m\u1edbi (HTML)",
              "displayName": "N\u1ed9i dung b\u00e0i vi\u1ebft m\u1edbi (HTML)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "tele status",
              "displayName": "tele status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "FB status",
              "displayName": "FB status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Web status",
              "displayName": "Web status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Web link",
              "displayName": "Web link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        2320,
        272
      ],
      "id": "85e1a18b-0ae9-4ac4-bf15-439124c16a91",
      "name": "Update row in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.prompt }}",
        "hasOutputParser": true,
        "batching": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.7,
      "position": [
        800,
        -128
      ],
      "id": "ba24883f-08b2-4dcc-8b44-a86d613d3dba",
      "name": "t\u1ea1o content cu\u1ed1i c\u00f9ng"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=# Prompt T\u1ed1i \u01afu cho AI Agent: Quy\u1ebft \u0110\u1ecbnh Tool & Tr\u1ea3 v\u1ec1 URL \u1ea2nh Cu\u1ed1i C\u00f9ng (Simplified)\n\n## 1. Vai Tr\u00f2 v\u00e0 M\u1ee5c ti\u00eau (Role & Persona)\nB\u1ea1n l\u00e0 **Tr\u01b0\u1edfng nh\u00f3m Content Strategist Agent** c\u1ee7a Learning Chain. Nhi\u1ec7m v\u1ee5 duy nh\u1ea5t v\u00e0 cu\u1ed1i c\u00f9ng c\u1ee7a b\u1ea1n l\u00e0 cung c\u1ea5p **DUY NH\u1ea4T 1 URL** c\u1ee7a h\u00ecnh \u1ea3nh t\u1ed1i \u01b0u nh\u1ea5t \u0111\u1ec3 minh h\u1ecda cho RAW_CONTENT. B\u1ea1n ph\u1ea3i quy\u1ebft \u0111\u1ecbnh s\u1eed d\u1ee5ng 1 trong 2 c\u00f4ng c\u1ee5 c\u00f3 s\u1eb5n:\n1.  **'Run an Actor and get dataset in Apify' (Apify Crawl):** \u0110\u1ec3 t\u00ecm ki\u1ebfm (Crawl) h\u00ecnh \u1ea3nh th\u1ef1c t\u1ebf, li\u00ean quan \u0111\u1ebfn ng\u01b0\u1eddi, t\u1ed5 ch\u1ee9c, ho\u1eb7c s\u1ef1 ki\u1ec7n c\u00f3 th\u1eadt.\n2.  **'Call 't\u1ea1o \u1ea3nh'' Tool (Generate):** \u0110\u1ec3 t\u1ea1o h\u00ecnh \u1ea3nh m\u1edbi, ph\u00f9 h\u1ee3p v\u1edbi c\u00e1c kh\u00e1i ni\u1ec7m tr\u1eebu t\u01b0\u1ee3ng, ph\u00e2n t\u00edch th\u1ecb tr\u01b0\u1eddng, v.v.\n\n## 2. Quy T\u1eafc Quy\u1ebft \u0110\u1ecbnh C\u00f4ng C\u1ee5 (Conditional Tool Use - Simplified)\n1.  **S\u1eed d\u1ee5ng Apify Crawl:** N\u1ebfu RAW_CONTENT \u0111\u1ec1 c\u1eadp \u0111\u1ebfn **t\u00ean ng\u01b0\u1eddi c\u1ee5 th\u1ec3, t\u1ed5 ch\u1ee9c, ho\u1eb7c tin t\u1ee9c/s\u1ef1 ki\u1ec7n th\u1ef1c t\u1ebf** c\u1ea7n h\u00ecnh \u1ea3nh minh h\u1ecda ch\u00e2n th\u1ef1c.\n    *   **Tool Input:** B\u1ea1n ph\u1ea3i t\u1ea1o m\u1ed9t **Input JSON** (chu\u1ea9n cho Apify Actor Google Images Scraper) ch\u1ee9a **5 Query t\u00ecm ki\u1ebfm h\u00ecnh \u1ea3nh t\u1ed1t nh\u1ea5t** (Ti\u1ebfng Anh, ch\u00ednh x\u00e1c, kh\u00f4ng tr\u00f9ng l\u1eb7p) \u0111\u1ec3 t\u1ed1i \u0111a h\u00f3a \u0111\u1ed9 li\u00ean quan.\n2.  **S\u1eed d\u1ee5ng 'Call 't\u1ea1o \u1ea3nh'' (Generate):** N\u1ebfu RAW_CONTENT \u0111\u1ec1 c\u1eadp \u0111\u1ebfn **kh\u00e1i ni\u1ec7m tr\u1eebu t\u01b0\u1ee3ng, d\u1ef1 b\u00e1o th\u1ecb tr\u01b0\u1eddng, chi\u1ebfn l\u01b0\u1ee3c, ho\u1eb7c ph\u00e2n t\u00edch v\u0129 m\u00f4** kh\u00f4ng d\u1ec5 t\u00ecm th\u1ea5y h\u00ecnh \u1ea3nh minh h\u1ecda th\u1ef1c t\u1ebf.\n    *   **Tool Input:** B\u1ea1n ch\u1ec9 c\u1ea7n truy\u1ec1n tr\u1ef1c ti\u1ebfp `RAW_CONTENT` v\u00e0o Tool. (Tool t\u1ef1 x\u1eed l\u00fd Prompt Sinh \u1ea2nh).\n\n## 3. Quy Tr\u00ecnh v\u00e0 R\u00e0ng Bu\u1ed9c \u0110\u1ea7u ra (Final Output Constraint)\n1.  **Th\u1ef1c thi:** B\u1ea1n **ph\u1ea3i ch\u1ecdn v\u00e0 s\u1eed d\u1ee5ng DUY NH\u1ea4T 1 trong 2 Tool** \u0111\u1ec3 ho\u00e0n th\u00e0nh nhi\u1ec7m v\u1ee5.\n2.  **\u0110\u1ea7u ra cu\u1ed1i c\u00f9ng:** B\u1eaeT BU\u1ed8C ph\u1ea3i l\u00e0 **DUY NH\u1ea4T m\u1ed9t URL \u1ea3nh h\u1ee3p l\u1ec7** \u0111\u01b0\u1ee3c tr\u1ea3 v\u1ec1 t\u1eeb Tool b\u1ea1n ch\u1ecdn.\n3.  **Lo\u1ea1i tr\u1eeb:** Tuy\u1ec7t \u0111\u1ed1i **kh\u00f4ng gi\u1ea3i th\u00edch, kh\u00f4ng v\u0103n b\u1ea3n b\u1ed5 sung, kh\u00f4ng JSON/HTML**. Ch\u1ec9 tr\u1ea3 v\u1ec1 URL.\n\n## 4. D\u1eef li\u1ec7u \u0110\u1ea7u v\u00e0o (Input Variables)\n\n### RAW_CONTENT\n\n{{ $json['n\u1ed9i dung raw '] }}\n\n## 5. L\u1ec7nh Th\u1ef1c thi\nPh\u00e2n t\u00edch RAW_CONTENT. Quy\u1ebft \u0111\u1ecbnh s\u1eed d\u1ee5ng **Chu\u1ed7i Apify** hay **'Call 't\u1ea1o \u1ea3nh'** Tool, th\u1ef1c thi Tool \u0111\u00f3, v\u00e0 **tr\u1ea3 v\u1ec1 URL \u1ea3nh cu\u1ed1i c\u00f9ng**.",
        "hasOutputParser": true,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        1312,
        -544
      ],
      "id": "65d8e37c-6022-4fc0-a058-1ba6711c307a",
      "name": "ph\u00e2n t\u00edch chi\u1ebfn l\u01b0\u1ee3c t\u1ea1o \u1ea3nh"
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"url\": \"url \u1ea3nh h\u1ee3p l\u00ed nh\u1ea5t\"\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        1584,
        -288
      ],
      "id": "86e1571c-f9a0-45b8-9e0c-5a85928ea124",
      "name": "Structured Output Parser1"
    },
    {
      "parameters": {
        "description": "Call this tool when you want to create image, input is raw_content",
        "workflowId": {
          "__rl": true,
          "value": "EPr0W7oxcZgcbD4v",
          "mode": "list",
          "cachedResultUrl": "/workflow/EPr0W7oxcZgcbD4v",
          "cachedResultName": "t\u1ea1o \u1ea3nh"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {
            "raw_content": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('raw_content', ``, 'string') }}",
            "model_name": "kling-v2"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "raw_content",
              "displayName": "raw_content",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "canBeUsedToMatch": true,
              "type": "string",
              "removed": false
            },
            {
              "id": "model_name",
              "displayName": "model_name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "canBeUsedToMatch": true,
              "type": "string",
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "typeVersion": 2.2,
      "position": [
        1408,
        -288
      ],
      "id": "67d9fe03-2aa5-4c47-8ecc-8d05cc9cf798",
      "name": "Call 't\u1ea1o \u1ea3nh'"
    },
    {
      "parameters": {
        "query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Query', ``, 'string') }}",
        "options": {}
      },
      "type": "@tavily/n8n-nodes-tavily.tavilyTool",
      "typeVersion": 1,
      "position": [
        1280,
        -288
      ],
      "id": "c789bbee-5c1b-4473-9122-e338ab8a7ddd",
      "name": "Search in Tavily",
      "credentials": {
        "tavilyApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "EPr0W7oxcZgcbD4v",
          "mode": "list",
          "cachedResultUrl": "/workflow/EPr0W7oxcZgcbD4v",
          "cachedResultName": "t\u1ea1o \u1ea3nh"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {
            "raw_content": "={{ $json['n\u1ed9i dung raw '] }}",
            "model_name": "kling-v2"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "raw_content",
              "displayName": "raw_content",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "canBeUsedToMatch": true,
              "type": "string",
              "removed": false
            },
            {
              "id": "model_name",
              "displayName": "model_name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "canBeUsedToMatch": true,
              "type": "string",
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        },
        "options": {}
      },
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1.3,
      "position": [
        576,
        352
      ],
      "id": "ea74adf0-055b-47e0-9701-9fd714f9dc95",
      "name": "Call 't\u1ea1o \u1ea3nh'1"
    }
  ],
  "connections": {
    "FB news LC": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FB AI news LC": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FB Analysis AI LC": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FB Analysis LC": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "l\u1ecdc d\u1eef li\u1ec7u",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet1": {
      "main": [
        [
          {
            "node": "l\u1ecdc d\u1eef li\u1ec7u",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet3": {
      "main": [
        [
          {
            "node": "l\u1ecdc d\u1eef li\u1ec7u",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "prompt_news",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "prompt_analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "prompt_news": {
      "main": [
        [
          {
            "node": "t\u1ea1o content cu\u1ed1i c\u00f9ng",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "t\u1ea1o content cu\u1ed1i c\u00f9ng",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "prompt_analysis": {
      "main": [
        [
          {
            "node": "t\u1ea1o content cu\u1ed1i c\u00f9ng",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "t\u1ea1o content cu\u1ed1i c\u00f9ng",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "Crypto",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "l\u1ecdc d\u1eef li\u1ec7u": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          },
          {
            "node": "Call 't\u1ea1o \u1ea3nh'1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Crypto": {
      "main": [
        [
          {
            "node": "Learning chain academy",
            "type": "main",
            "index": 0
          },
          {
            "node": "Learning chain vietnam",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI": {
      "main": [
        [
          {
            "node": "H\u1ecdc vi\u1ec7n LC",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Learning chain vietnam": {
      "main": [
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "H\u1ecdc vi\u1ec7n LC": {
      "main": [
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "t\u1ea1o content cu\u1ed1i c\u00f9ng": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "ph\u00e2n t\u00edch chi\u1ebfn l\u01b0\u1ee3c t\u1ea1o \u1ea3nh",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Call 't\u1ea1o \u1ea3nh'": {
      "ai_tool": [
        [
          {
            "node": "ph\u00e2n t\u00edch chi\u1ebfn l\u01b0\u1ee3c t\u1ea1o \u1ea3nh",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Search in Tavily": {
      "ai_tool": [
        [
          {
            "node": "ph\u00e2n t\u00edch chi\u1ebfn l\u01b0\u1ee3c t\u1ea1o \u1ea3nh",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Call 't\u1ea1o \u1ea3nh'1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": {
    "node:FB news LC": {
      "recurrenceRules": []
    },
    "node:FB AI news LC": {
      "recurrenceRules": []
    },
    "node:FB Analysis LC": {
      "recurrenceRules": []
    },
    "node:FB Analysis AI LC": {
      "recurrenceRules": []
    }
  },
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "versionId": "73055cc8-c0f1-4697-a494-a8ae48462576",
  "triggerCount": 4,
  "shared": [
    {
      "createdAt": "2025-10-05T07:11:55.404Z",
      "updatedAt": "2025-10-05T07:11:55.404Z",
      "role": "workflow:owner",
      "workflowId": "ZOoqmJUlJW8VgAeM",
      "projectId": "9HJZe2ZyF9KLloKH"
    }
  ],
  "tags": []
}

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

PostFacebook. Uses googleSheets, lmChatOpenAi, outputParserStructured, googleDrive. Scheduled trigger; 28 nodes.

Source: https://github.com/vtnguyen04/NguyenBlog/blob/c08ecbfc58731cb6c73562e45ef950f9abdc9178/workflows/PostFacebook.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

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

AI & RAG

This workflow automates the creation, rendering, approval, and posting of TikTok-style POV (Point of View) videos to Instagram, with cross-posting to Facebook and YouTube. It eliminates manual video p

OpenAI Chat, Output Parser Item List, HTTP Request +10
AI & RAG

This n8n workflow is designed for content creators, digital marketers, and social media managers who want to automate their entire content creation and publishing process across multiple platforms. It

Google Sheets, WordPress, Edit Image +13
AI & RAG

[](https://youtu.be/sKJAypXDTLA)

Chain Llm, Agent, Execute Workflow Trigger +6
AI & RAG

⚠️ DISCLAIMER: This workflow uses the AnySite LinkedIn community node, which is only available on self-hosted n8n instances. It will not work on n8n.cloud.

OpenAI Chat, Output Parser Structured, Google Sheets +6
AI & RAG

This n8n automation workflow automates the creation, scripting, production, and posting of YouTube videos. It leverages AI (OpenAI), image generation (PIAPI), video rendering (Shotstack), and platform

Agent, OpenAI Chat, Airtable Tool +7