{ "name": "My workflow 2", "nodes": [ { "parameters": { "method": "POST", "url": "https://demon8n.w2.myzozo.net/api/v1/news/add", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "api_token", "value": "ed88091ebe045493c8ea4ca7b98ebcf79ec6748e21f53cd43589bc91f0b9322c" } ] }, "sendBody": true, "specifyBody": "json", "jsonBody": "={\n \"name\": {{ JSON.stringify($json.name ?? \"\") }},\n \"description\": {{ JSON.stringify($json.description ?? \"\") }},\n \"image\": {{ JSON.stringify($json.image ?? \"\") }},\n \"categories\": {{ JSON.stringify(Array.isArray($json.categories) ? $json.categories : (() => { try { return JSON.parse($json.categoriesString ?? \"[]\") } catch { return [] } })()) }},\n \"status\": {{ Number($json.status ?? 1) }},\n \"author\": {{ JSON.stringify($json.author ?? \"\") }}\n}\n", "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 672, 864 ], "id": "5b612a0f-3482-4a63-8927-e60b0d113987", "name": "HTTP Request" }, { "parameters": { "rule": { "interval": [ { "field": "minutes", "minutesInterval": 1 } ] } }, "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [ -2208, 880 ], "id": "d239a739-b28e-4be7-9566-a4c7b0177040", "name": "Schedule Trigger" }, { "parameters": { "documentId": { "__rl": true, "value": "1N6xzcXgNg4flPx05Ob9BuiBQ5FvWEjLfI7F2BTxIdwc", "mode": "list", "cachedResultName": "postnewn8n", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N6xzcXgNg4flPx05Ob9BuiBQ5FvWEjLfI7F2BTxIdwc/edit?usp=drivesdk" }, "sheetName": { "__rl": true, "value": 450585716, "mode": "list", "cachedResultName": "Trang tính", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N6xzcXgNg4flPx05Ob9BuiBQ5FvWEjLfI7F2BTxIdwc/edit#gid=450585716" }, "filtersUI": { "values": [ { "lookupColumn": "posted" } ] }, "options": {} }, "type": "n8n-nodes-base.googleSheets", "typeVersion": 4.6, "position": [ -2016, 880 ], "id": "fd99b674-d987-4552-bd76-ec92e3205968", "name": "Get row(s) in sheet", "credentials": { "googleSheetsOAuth2Api": { "id": "CDlBCDiWpIJ0K9je", "name": "Google Sheets account 2" } } }, { "parameters": { "operation": "update", "documentId": { "__rl": true, "value": "1N6xzcXgNg4flPx05Ob9BuiBQ5FvWEjLfI7F2BTxIdwc", "mode": "list", "cachedResultName": "postnewn8n", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N6xzcXgNg4flPx05Ob9BuiBQ5FvWEjLfI7F2BTxIdwc/edit?usp=drivesdk" }, "sheetName": { "__rl": true, "value": 450585716, "mode": "list", "cachedResultName": "Trang tính", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N6xzcXgNg4flPx05Ob9BuiBQ5FvWEjLfI7F2BTxIdwc/edit#gid=450585716" }, "columns": { "mappingMode": "defineBelow", "value": { "posted": "true", "row_number": "={{ $('Get row(s) in sheet').all()[ Number($json.articleIndex) || 0 ].json.row_number }}\n" }, "matchingColumns": [ "row_number" ], "schema": [ { "id": "name", "displayName": "name", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": true }, { "id": "description", "displayName": "description", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": true }, { "id": "Trợ lý viết bài", "displayName": "Trợ lý viết bài", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": true }, { "id": "image", "displayName": "image", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": true }, { "id": "categories", "displayName": "categories", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": true }, { "id": "status", "displayName": "status", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": true }, { "id": "author", "displayName": "author", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": true }, { "id": "posted", "displayName": "posted", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "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.6, "position": [ 864, 864 ], "id": "11058640-211f-48f9-a4aa-87ee71389529", "name": "Update row in sheet", "credentials": { "googleSheetsOAuth2Api": { "id": "CDlBCDiWpIJ0K9je", "name": "Google Sheets account 2" } } }, { "parameters": { "assignments": { "assignments": [ { "id": "d4351bd0-935b-4205-b6ce-b9947c28ccf2", "name": "name", "value": "={{ $json.name }}", "type": "string" }, { "id": "64665f24-ee49-4d2e-aae2-f744653618ec", "name": "", "value": "={{ $json.description }}", "type": "string" } ] }, "options": {} }, "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ -1824, 880 ], "id": "0ab8f95f-6dd5-4545-a63f-90bca88ff551", "name": "Edit Fields" }, { "parameters": { "promptType": "define", "text": "=Bạn là một chuyên gia SEO và copywriter chuyên nghiệp. Nhiệm vụ của bạn là VIẾT MỘT BÀI VIẾT HOÀN CHỈNH, CHUẨN SEO dựa trên đầu vào:\n\n- Tiêu đề (bắt buộc): \"{{ $json.name }}\"\n- Ghi chú/Yêu cầu bổ sung (có thể trống): \"{{ $json.description }}\"\n\nNGUYÊN TẮC ÁP DỤNG\n- Nếu \"Ghi chú/Yêu cầu bổ sung\" có nội dung, phải TUÂN THỦ những ràng buộc/ý muốn/giọng điệu nêu trong đó (ưu tiên cao).\n- Tuyệt đối KHÔNG đổi chủ đề so với Tiêu đề. Nếu có mâu thuẫn, giữ đúng chủ đề của Tiêu đề và chỉ thực hiện phần yêu cầu phù hợp.\n- Không chép nguyên văn phần mô tả bổ sung vào bài; hãy triển khai nội dung theo tinh thần và yêu cầu của mô tả.\n\n1) NGÔN NGỮ & PHONG CÁCH\n- Viết bằng tiếng Việt tự nhiên, mạch lạc, hấp dẫn, không dùng từ ngữ máy móc.\n- Giọng văn truyền cảm hứng, chuyên nghiệp, phù hợp với người đọc tại Việt Nam.\n- TUYỆT ĐỐI KHÔNG viết nội dung ngoài phạm vi tiêu đề.\n\n2) ĐỘ DÀI BÀI VIẾT\n- Tối thiểu 1.300 từ.\n- Tuyệt đối KHÔNG dưới 1.300 từ.\n\n3) TỪ KHÓA SEO\n- Từ khóa chính: \"{{ $json.name }}\" — xuất hiện CHÍNH XÁC 6 lần, phân bổ tự nhiên, không nhồi nhét.\n- Bổ sung 3–5 từ khóa LSI liên quan (có thể ưu tiên từ khóa bắt nguồn từ \"Ghi chú/Yêu cầu bổ sung\" nếu phù hợp ngữ cảnh), xuất hiện hài hòa.\n\n4) CẤU TRÚC NỘI DUNG & FORMAT HTML\n- BẮT ĐẦU bằng thẻ
và KẾT THÚC bằng
.\n-

: Tiêu đề chính = \"{{ $json.name }}\".\n- Mở bài: 150–200 từ, chứa từ khóa chính (1 lần).\n- Nội dung chính:\n - Ít nhất 5–7 thẻ

.\n - Mỗi

có 2–3 thẻ

để bổ trợ ý.\n - Khi phù hợp, sử dụng danh sách