{
  "name": "Facebook Post Image",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 17,
              "triggerAtMinute": 45
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        -1216,
        480
      ],
      "id": "f91bb1d8-abf6-4756-8bc1-201fe6280443",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "jsCode": "const staticData = $getWorkflowStaticData('global');\nconst topics = staticData.topics || [];\nconst index = staticData.topicIndex || 0;\n\nif (!topics.length || index >= topics.length) {\n  return [{ json: { needNewTopics: true } }];\n}\n\nreturn [{ json: { needNewTopics: false } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -992,
        480
      ],
      "id": "9787239c-51af-4241-b29c-5bf4fe8137fe",
      "name": "Kiểm Tra Lộ Trình"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 1
          },
          "conditions": [
            {
              "id": "cond-1",
              "leftValue": "={{ $json.needNewTopics }}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        -848,
        192
      ],
      "id": "62e37d24-e683-4e67-ba3c-3486e539a2c7",
      "name": "Cần Lộ Trình Mới?"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "models/gemini-2.5-flash",
          "mode": "list",
          "cachedResultName": "models/gemini-2.5-flash"
        },
        "messages": {
          "values": [
            {
              "content": "Nghiên cứu các trend mới nhất hiện tại về AI (công cụ AI, mô hình AI, ứng dụng AI trong công việc/kinh doanh, tin tức AI nổi bật). Dựa vào đó, đề xuất 7 CHỦ ĐỀ bài viết SEO tiếng Việt khác nhau, đa dạng góc nhìn, không trùng lặp ý tưởng, không trùng chủ đề với nhau.\n\nMỗi chủ đề chỉ cần là 1 câu ngắn gọn mô tả góc viết (không cần viết bài đầy đủ).\n\nQUAN TRỌNG: Tuyệt đối KHÔNG dùng dấu ngoặc kép (\") bên trong các chủ đề.\n\nHãy trả lời CHÍNH XÁC theo format JSON array sau, không thêm text giải thích, không thêm markdown code block:\n[\"chủ đề 1\", \"chủ đề 2\", \"chủ đề 3\", \"chủ đề 4\", \"chủ đề 5\", \"chủ đề 6\", \"chủ đề 7\"]"
            }
          ]
        },
        "simplify": false,
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "typeVersion": 1.2,
      "position": [
        -688,
        80
      ],
      "id": "0ea5dbe3-e54b-442d-a3e7-f7b88374a03b",
      "name": "Tạo Lộ Trình 7 Chủ Đề"
    },
    {
      "parameters": {
        "jsCode": "const raw = $('Tạo Lộ Trình 7 Chủ Đề').item.json.candidates[0].content.parts[0].text;\n\nlet text = raw.replace(/```json/g, '').replace(/```/g, '').trim();\n\nlet topics;\ntry {\n  topics = JSON.parse(text);\n} catch (e) {\n  throw new Error('Khong parse duoc danh sach chu de tra ve: ' + text.substring(0, 300));\n}\n\nif (!Array.isArray(topics) || topics.length === 0) {\n  throw new Error('Danh sach chu de khong hop le: ' + text.substring(0, 300));\n}\n\nconst staticData = $getWorkflowStaticData('global');\nstaticData.topics = topics;\nstaticData.topicIndex = 1; // da dung topic[0], lan sau dung index 1\nstaticData.pendingTopic = topics[0];\n\nreturn [{ json: { topic: topics[0] } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -368,
        48
      ],
      "id": "d0561625-aca2-4f6f-b252-d9671a53869f",
      "name": "Lưu Lộ Trình & Lấy Chủ Đề #1"
    },
    {
      "parameters": {
        "jsCode": "const staticData = $getWorkflowStaticData('global');\nconst topics = staticData.topics || [];\nconst index = staticData.topicIndex || 0;\n\nconst topic = topics[index];\nstaticData.topicIndex = index + 1;\nstaticData.pendingTopic = topic;\n\nreturn [{ json: { topic } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -640,
        240
      ],
      "id": "81949c38-6b16-4b78-8dc9-6ca542541315",
      "name": "Lấy Chủ Đề Tiếp Theo"
    },
    {
      "parameters": {
        "operation": "sendAndWait",
        "chatId": "DAN_TELEGRAM_CHAT_ID",
        "message": "=📋 Chủ đề tiếp theo:\n\n{{ $json.topic }}\n\nTrả lời:\n- OK / Đồng ý → tiến hành viết bài với chủ đề này\n- Không / đổi chủ đề khác → bỏ qua, lấy chủ đề kế tiếp\n- Hoặc gửi luôn ý tưởng/chủ đề bạn muốn → dùng chủ đề đó",
        "responseType": "freeText",
        "options": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -160,
        64
      ],
      "id": "6e43a889-cc2b-4b97-b58e-ec4e7b40fe54",
      "name": "Duyệt Chủ Đề",
      "webhookId": "duyet-chu-de-webhook"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "models/gemini-2.5-flash",
          "mode": "list",
          "cachedResultName": "models/gemini-2.5-flash"
        },
        "messages": {
          "values": [
            {
              "content": "=Người dùng được hỏi duyệt chủ đề bài viết sau:\nChủ đề: {{ $getWorkflowStaticData('global').pendingTopic }}\n\nNgười dùng trả lời: {{ $json.data.text }}\n\nHãy phân loại ý định của người dùng vào 1 trong 4 loại:\n- approve: đồng ý, ok, được, tiến hành với chủ đề này\n- reject: không đồng ý, muốn đổi chủ đề khác, bỏ qua chủ đề này\n- custom: người dùng cung cấp 1 chủ đề/ý tưởng cụ thể khác để dùng thay thế\n- unclear: câu trả lời không rõ ràng, không khớp với 3 loại trên, không đoán bừa\n\nNếu là custom, trích xuất chủ đề mới từ câu trả lời của người dùng vào field customTopic. Nếu không phải custom thì customTopic để rỗng.\n\nTrả lời CHÍNH XÁC theo format JSON sau, không thêm text giải thích, không thêm markdown code block:\n{\"intent\": \"approve\", \"customTopic\": \"\"}"
            }
          ]
        },
        "simplify": false,
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ],
      "id": "abafaf93-0a01-41f4-8683-4775eb90ab9c",
      "name": "Phân Loại Ý Định"
    },
    {
      "parameters": {
        "jsCode": "const raw = $('Phân Loại Ý Định').item.json.candidates[0].content.parts[0].text;\nlet text = raw.replace(/```json/g, '').replace(/```/g, '').trim();\n\nlet parsed;\ntry {\n  parsed = JSON.parse(text);\n  if (!parsed.intent) parsed.intent = 'unclear';\n} catch (e) {\n  parsed = { intent: 'unclear', customTopic: '' };\n}\n\nconst staticData = $getWorkflowStaticData('global');\nconst originalTopic = staticData.pendingTopic;\nlet intent = parsed.intent;\nlet finalTopic = originalTopic;\n\nif (intent === 'custom' && parsed.customTopic) {\n  finalTopic = parsed.customTopic;\n}\n\n// Da lay xong topic, xoa pendingTopic de tranh lan sau doc nham\nif (intent === 'approve' || intent === 'custom') {\n  delete staticData.pendingTopic;\n}\n\nreturn [{ json: { topic: finalTopic, intent } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        176,
        224
      ],
      "id": "bfab9b1d-fe9d-4590-85a3-18580722d89e",
      "name": "Parse Phân Loại"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 1
                },
                "conditions": [
                  {
                    "id": "cond-reject",
                    "leftValue": "={{ $json.intent }}",
                    "rightValue": "reject",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 1
                },
                "conditions": [
                  {
                    "id": "cond-unclear",
                    "leftValue": "={{ $json.intent }}",
                    "rightValue": "unclear",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra",
          "renameFallbackOutput": "approve_or_custom"
        }
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        400,
        224
      ],
      "id": "e6eb4b4a-6171-465b-8531-d4d7192ca258",
      "name": "Phân Loại Kết Quả"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "models/gemini-2.5-flash",
          "mode": "list",
          "cachedResultName": "models/gemini-2.5-flash"
        },
        "messages": {
          "values": [
            {
              "content": "=Viết bài đúng chuẩn SEO bằng tiếng Việt về chủ đề sau: {{ $json.topic }}\n\nYêu cầu:\n- dài 1000 - 2000 từ\n- Có các tiêu đề đặt trong thẻ html H2, H3\n- ĐÚng chuẩn SEO\n- có mở bài, thân bài, kết luận\n\nQUAN TRỌNG: Tuyệt đối KHÔNG dùng dấu ngoặc kép (\") bên trong tiêu đề hoặc nội dung bài viết. Nếu cần nhấn mạnh một từ/cụm từ, hãy dùng dấu nháy đơn (') hoặc viết hoa thay thế, không dùng dấu ngoặc kép.\n\nHãy trả lời CHÍNH XÁC theo format JSON sau, không thêm text giải thích, không thêm markdown code block:\n{\"title\": \"tiêu đề bài viết\", \"content\": \"nội dung bài viết đầy đủ\"}"
            }
          ]
        },
        "simplify": false,
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "typeVersion": 1.2,
      "position": [
        400,
        592
      ],
      "id": "9bee5a3d-2181-4fae-9c36-97d0de4cbde2",
      "name": "Message a model"
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const raw = $('Message a model').item.json.candidates[0].content.parts[0].text;\n\nfunction unescape(s) {\n  return s\n    .replace(/\\\\n/g, '\\n')\n    .replace(/\\\\r/g, '\\r')\n    .replace(/\\\\t/g, '\\t')\n    .replace(/\\\\\"/g, '\"')\n    .replace(/\\\\\\\\/g, '\\\\');\n}\n\nfunction extractAndFix(text) {\n  text = text.replace(/```json/g, '').replace(/```/g, '').trim();\n\n  try {\n    const parsed = JSON.parse(text);\n    if (parsed && typeof parsed.title === 'string' && typeof parsed.content === 'string') {\n      return parsed;\n    }\n  } catch (e) {\n    // fallback xuong duoi\n  }\n\n  const titleKeyIdx = text.indexOf('\"title\"');\n  const contentKeyIdx = text.indexOf('\"content\"');\n  if (titleKeyIdx === -1 || contentKeyIdx === -1) {\n    throw new Error('Khong tim thay field title/content trong text tra ve: ' + text.substring(0, 300));\n  }\n\n  let titleValStart = text.indexOf(':', titleKeyIdx) + 1;\n  while (text[titleValStart] === ' ') titleValStart++;\n  titleValStart++;\n\n  const titleValEnd = text.lastIndexOf('\"', contentKeyIdx);\n  const titleRaw = text.substring(titleValStart, titleValEnd);\n\n  let contentValStart = text.indexOf(':', contentKeyIdx) + 1;\n  while (text[contentValStart] === ' ') contentValStart++;\n  contentValStart++;\n\n  const contentValEnd = text.lastIndexOf('\"');\n  const contentRaw = text.substring(contentValStart, contentValEnd);\n\n  return {\n    title: unescape(titleRaw),\n    content: unescape(contentRaw)\n  };\n}\n\nconst data = extractAndFix(raw);\n\nreturn {\n  title: data.title,\n  content: data.content\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        736,
        544
      ],
      "id": "98c90320-1899-4eb9-92cc-6781944ab989",
      "name": "Parse Gemini Output"
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const genImageItem = $input.item;\n\nreturn {\n  json: {\n    title: $('Parse Gemini Output').item.json.title,\n    content: $('Parse Gemini Output').item.json.content\n  },\n  binary: genImageItem.binary\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -592,
        736
      ],
      "id": "25708fb9-36ce-4d5a-8cab-2b10a5a04dea",
      "name": "Prepare Image Binary"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://YOUR_DOMAIN.com/wp-json/wp/v2/media",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBasicAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Disposition",
              "value": "attachment; filename=\"illustration.png\""
            }
          ]
        },
        "sendBody": true,
        "contentType": "binaryData",
        "inputDataFieldName": "data",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        -384,
        752
      ],
      "id": "a49048d5-d482-4e3d-9eea-b8d42341478b",
      "name": "Upload Image to WordPress"
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const title = $('Parse Gemini Output').item.json.title;\nconst content = $('Parse Gemini Output').item.json.content;\nconst mediaId = $json.id;\nconst imageUrl = $json.source_url;\n\nconst contentWithImage = `<img src=\"${imageUrl}\" alt=\"${title}\" style=\"max-width:100%;\" /><br/><br/>` + content;\n\nreturn {\n  jsonBody: JSON.stringify({\n    title: title,\n    content: contentWithImage,\n    status: \"publish\",\n    featured_media: mediaId,\n    categories: [192]\n  })\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -160,
        752
      ],
      "id": "5f427f74-0c93-4545-8a91-ead492c4facc",
      "name": "Build Post Body"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://YOUR_DOMAIN.com/wp-json/wp/v2/posts",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBasicAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ $json.jsonBody }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        128,
        752
      ],
      "id": "c595d46a-90b7-43cc-9b4a-f1ce5a1ffcac",
      "name": "Create Post"
    },
    {
      "parameters": {
        "resource": "image",
        "modelId": {
          "__rl": true,
          "value": "models/gemini-3.1-flash-image",
          "mode": "list",
          "cachedResultName": "models/gemini-3.1-flash-image (Nano Banana 2)"
        },
        "prompt": "=Create a premium marketing poster (landscape ratio 1.78:1) for an AI education brand.\n\nTopic:\n{{ $json.title }}\n\nArt Direction:\n- Designed by a senior graphic designer, not AI-generated\n- Premium commercial advertising quality\n- Strong visual hierarchy and professional typography\n- Swiss Design / Modern Editorial Design style\n- Clean grid system, balanced composition\n- Realistic branding standards used by leading tech companies\n- Large negative space\n- Consistent spacing and alignment\n- Sophisticated color palette (2-3 colors only)\n- High-end educational technology brand aesthetic\n\nTypography:\n- Bold headline with clear hierarchy\n- Professional sans-serif typography\n- Excellent readability\n- Modern tech-learning feel\n\nVisual:\n- Avoid generic AI robots, glowing brains, floating holograms, neon circuits, stock illustrations\n- Avoid clipart, cartoon elements, and overused AI imagery\n- Use abstract geometric shapes and modern visual metaphors\n\nBranding:\n- Small subtle \"Sự AI\" logo in one corner\n- Maintain premium corporate identity\n\nOutput:\n- Looks like it was designed by an award-winning designer for a real technology education company\n- Behance quality\n- Dribbble featured quality\n- Adobe Creative Cloud promotional poster quality\n- Print-ready composition\n\nNegative prompt:\nAI-generated look, amateur design, template design, Canva template, stock poster, cluttered layout, robotic illustration, excessive effects, low-quality typography, poor spacing, generic AI art, fake 3D renders, text-heavy composition.",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "typeVersion": 1.2,
      "position": [
        -800,
        736
      ],
      "id": "decc04d5-ff7b-443e-bf4f-11d891666607",
      "name": "Generate an image"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 1,
              "triggerAtMinute": 43
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        -1216,
        656
      ],
      "id": "414bcc2e-5879-4a9b-aa7a-9db2000bac63",
      "name": "Schedule Trigger1"
    },
    {
      "parameters": {
        "httpRequestMethod": "POST",
        "graphApiVersion": "v25.0",
        "node": "me",
        "edge": "photos",
        "sendBinaryData": true,
        "binaryPropertyName": "data",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "message",
                "value": "={{ $json.fbCaption }}"
              }
            ]
          }
        }
      },
      "type": "n8n-nodes-base.facebookGraphApi",
      "typeVersion": 1,
      "position": [
        -288,
        928
      ],
      "id": "82f29adf-b6e2-4fd1-8d72-93e5013579fe",
      "name": "Facebook Graph API1",
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "httpRequestMethod": "POST",
        "graphApiVersion": "v25.0",
        "node": "={{ $json.postid }}",
        "edge": "comments",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "message",
                "value": "={{$json.message}}"
              }
            ]
          }
        }
      },
      "type": "n8n-nodes-base.facebookGraphApi",
      "typeVersion": 1,
      "position": [
        -864,
        992
      ],
      "id": "db23ef6f-8198-4431-ae4d-acecc2929562",
      "name": "Facebook Graph API"
    },
    {
      "parameters": {
        "chatId": "DAN_TELEGRAM_CHAT_ID",
        "text": "=✅ Đã đăng bài thành công!\n\n📝 Tiêu đề: {{ $('Parse Gemini Output').item.json.title }}\n\n🌐 Link Web: {{ $('prepare_content').item.json.websiteLink }}\n🔗 Link Facebook: https://www.facebook.com/{{ $('Facebook Graph API1').item.json.id }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -1120,
        1008
      ],
      "id": "532eca8f-2cfa-4300-b995-a98ca28ccee4",
      "name": "Báo Telegram",
      "webhookId": "PLACEHOLDER_WEBHOOK_ID"
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const title = $('Parse Gemini Output').item.json.title;\nconst content = $('Parse Gemini Output').item.json.content;\nconst websiteLink = $json.link; // link bai viet, lay tu response cua node Create Post (WordPress)\n\n// Xoa the HTML neu co, lay doan dau lam caption\nconst plainText = content.replace(/<[^>]*>/g, '');\nconst shortContent = plainText.substring(0, 400).trim();\n\nconst caption = `${title}\\n\\n${shortContent}...\\n\\nXem đầy đủ tại link ở phần comment`;\n\nreturn {\n  json: {\n    title,\n    fbCaption: caption,\n    websiteLink\n  },\n  binary: $('Prepare Image Binary').item.binary\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        48,
        1008
      ],
      "id": "e1e87c1c-84ce-4e95-b8e5-abc811bcb67e",
      "name": "prepare_content"
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const postid = $json.post_id;\nconst websiteLink = $('prepare_content').item.json.websiteLink\nconst message = `Xem đầy đủ tại\\n\\n${websiteLink}`;\nreturn {\n  json: {\n    postid,\n    message\n  },\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -560,
        960
      ],
      "id": "ad338ad3-f6d4-45a6-bd7a-441a16d7b198",
      "name": "prepare_data_comment"
    }
  ],
  "pinData": {},
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Kiểm Tra Lộ Trình",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Kiểm Tra Lộ Trình": {
      "main": [
        [
          {
            "node": "Cần Lộ Trình Mới?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cần Lộ Trình Mới?": {
      "main": [
        [
          {
            "node": "Tạo Lộ Trình 7 Chủ Đề",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Lấy Chủ Đề Tiếp Theo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tạo Lộ Trình 7 Chủ Đề": {
      "main": [
        [
          {
            "node": "Lưu Lộ Trình & Lấy Chủ Đề #1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lưu Lộ Trình & Lấy Chủ Đề #1": {
      "main": [
        [
          {
            "node": "Duyệt Chủ Đề",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lấy Chủ Đề Tiếp Theo": {
      "main": [
        [
          {
            "node": "Duyệt Chủ Đề",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Duyệt Chủ Đề": {
      "main": [
        [
          {
            "node": "Phân Loại Ý Định",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Phân Loại Ý Định": {
      "main": [
        [
          {
            "node": "Parse Phân Loại",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Phân Loại": {
      "main": [
        [
          {
            "node": "Phân Loại Kết Quả",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Phân Loại Kết Quả": {
      "main": [
        [
          {
            "node": "Kiểm Tra Lộ Trình",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Duyệt Chủ Đề",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message a model": {
      "main": [
        [
          {
            "node": "Parse Gemini Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Gemini Output": {
      "main": [
        [
          {
            "node": "Generate an image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Image Binary": {
      "main": [
        [
          {
            "node": "Upload Image to WordPress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Image to WordPress": {
      "main": [
        [
          {
            "node": "Build Post Body",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Post Body": {
      "main": [
        [
          {
            "node": "Create Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Post": {
      "main": [
        [
          {
            "node": "prepare_content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate an image": {
      "main": [
        [
          {
            "node": "Prepare Image Binary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "Kiểm Tra Lộ Trình",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Facebook Graph API1": {
      "main": [
        [
          {
            "node": "prepare_data_comment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "prepare_content": {
      "main": [
        [
          {
            "node": "Facebook Graph API1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "prepare_data_comment": {
      "main": [
        [
          {
            "node": "Facebook Graph API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Facebook Graph API": {
      "main": [
        [
          {
            "node": "Báo Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "versionId": "1d95dfa2-f921-4f82-a2d3-c27b9a58b05f",
  "meta": {},
  "nodeGroups": [],
  "tags": []
}