{
  "id": "DvNxxSPDqkbCusUb",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Automatically Repurpose Viral Content",
  "tags": [],
  "nodes": [
    {
      "id": "e9838941-9a06-4464-9c4d-6de639cd8b9f",
      "name": "Create visual",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "position": [
        -544,
        224
      ],
      "parameters": {
        "prompt": "=Vi\u1ebft ti\u1ebfng vi\u1ec7t:  {{ $json.content }}",
        "resource": "video",
        "templateId": {
          "__rl": true,
          "mode": "list",
          "value": "/base/v2/tweet-card/ba413be6-a840-4e60-8fd6-0066d3b427df/v1",
          "cachedResultName": "Twitter/X style quote cards with minimal style"
        },
        "templateInputs": {
          "value": {
            "theme": "dark",
            "handle": "giangxAI.aff",
            "verified": false,
            "authorName": "GiangxAI",
            "aspectRatio": "1:1",
            "profileImage": "https://i.ibb.co/kgXBZ8YJ/98ec9d84960922577b18.jpg"
          },
          "schema": [
            {
              "id": "profileImage",
              "type": "string",
              "display": true,
              "required": true,
              "displayName": "Profile Photo URL * (publicly accessible URL)",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "quotes",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Quotes (e.g. [\"item 1\", \"item 2\"])",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "authorName",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "handle",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Social Media Handle",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "verified",
              "type": "boolean",
              "display": true,
              "required": false,
              "displayName": "Show Verified Badge",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "theme",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Dark",
                  "value": "dark"
                },
                {
                  "name": "Light",
                  "value": "light"
                }
              ],
              "required": false,
              "displayName": "Theme",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "aspectRatio",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "4:5",
                  "value": "4:5"
                },
                {
                  "name": "1:1",
                  "value": "1:1"
                },
                {
                  "name": "9:16",
                  "value": "9:16"
                }
              ],
              "required": false,
              "displayName": "Aspect Ratio",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "credentials": {
        "blotatoApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "f4e4f186-bed8-49af-990f-9154960291d3",
      "name": "Get visual",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "position": [
        -128,
        224
      ],
      "parameters": {
        "videoId": "={{ $('Create visual').item.json.item.id }}",
        "resource": "video",
        "operation": "get"
      },
      "credentials": {
        "blotatoApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "efb9fc09-17ed-4b97-9eb4-e3fcf74828ba",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -896,
        -176
      ],
      "parameters": {
        "color": 6,
        "width": 304,
        "height": 304,
        "content": "## URL Input\nSubmit the content source link (Blog, YouTube, TikTok, etc.)"
      },
      "typeVersion": 1
    },
    {
      "id": "f180b05d-2041-4e4a-913e-b1bc236c9ffd",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -592,
        -176
      ],
      "parameters": {
        "color": 7,
        "width": 992,
        "height": 304,
        "content": "## Source Processing\nCreate and retrieve structured content from the provided URL."
      },
      "typeVersion": 1
    },
    {
      "id": "89e06047-57b2-4221-88bf-e21bd831537a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -592,
        128
      ],
      "parameters": {
        "color": 6,
        "width": 992,
        "height": 304,
        "content": "## Visual Generation\nGenerate and retrieve AI visual/video based on processed content."
      },
      "typeVersion": 1
    },
    {
      "id": "46b62eb9-4ca7-4a28-b954-f15326337ebb",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -592,
        432
      ],
      "parameters": {
        "color": 7,
        "width": 992,
        "height": 304,
        "content": "## Social Media Distribution\nAutomatically publish generated content to social platforms"
      },
      "typeVersion": 1
    },
    {
      "id": "04bedcfa-2de6-4bdf-acd5-aeb0b4757e48",
      "name": "Get source",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "position": [
        -64,
        -80
      ],
      "parameters": {
        "resource": "source",
        "sourceId": "={{ $json.id }}",
        "operation": "get"
      },
      "credentials": {
        "blotatoApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "e58d7cb1-369c-40fe-8ce0-36b3534e1d3f",
      "name": "Submit Content URL",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -832,
        -64
      ],
      "parameters": {
        "options": {},
        "formTitle": "URL Input",
        "formFields": {
          "values": [
            {
              "fieldLabel": "URL (Blog, Youtube, tiktok)",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Submit the content source link (Blog, YouTube, TikTok, etc.)"
      },
      "typeVersion": 2.3
    },
    {
      "id": "77b06d5b-5d31-4a8f-a32c-144dacfc61c2",
      "name": "Create Source",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "position": [
        -512,
        -80
      ],
      "parameters": {
        "resource": "source",
        "sourceUrl": "={{ $json['URL (Blog, Youtube, tiktok)'] }}",
        "customInstructions": "Ph\u00e2n t\u00edch v\u00e0 t\u1ed5ng h\u1ee3p th\u00f4ng tin ch\u00ednh th\u00e0nh content ng\u1eafn. (TI\u1ec1u \u0111\u1ec1 v\u00e0 content b\u1eb1ng ti\u1ebfng vi\u1ec7t)"
      },
      "credentials": {
        "blotatoApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "84d16aca-de08-4142-957f-cc59955e10df",
      "name": "Wait for Source Processing",
      "type": "n8n-nodes-base.wait",
      "position": [
        -304,
        -80
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "78dad121-48e6-4fd1-8969-e14756ee4129",
      "name": "Source Status Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        176,
        -112
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "failed",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "b8789cde-9605-4716-a5ff-834066f3f4ee",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "failed"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "completed",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "cfbcf0a0-e003-4b7a-9959-7da7a199a2f9",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "completed"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "processing",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "a03a1738-4951-4caa-ad5c-45fcafc9f74d",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "processing"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.4
    },
    {
      "id": "208fb674-cbc6-46e8-ae24-b021993f4ec1",
      "name": "Wait for Visual Rendering",
      "type": "n8n-nodes-base.wait",
      "position": [
        -320,
        224
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "3bcceaab-9d19-4011-b6c4-16c6d8246c07",
      "name": "Visual Status Check",
      "type": "n8n-nodes-base.if",
      "position": [
        80,
        224
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "2fde2a44-d4b8-4380-b4e4-93af93a9f808",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $input.all().length === 1 ? $json.item.status === 'done' : $input.all().every(item => item.json.item.status === 'done') }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "3f32e971-6b92-4c60-8300-8f0a0bd50bcb",
      "name": "Publish to Instagram",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "position": [
        -544,
        576
      ],
      "parameters": {
        "options": {},
        "accountId": {
          "__rl": true,
          "mode": "list",
          "value": "25299",
          "cachedResultUrl": "https://backend.blotato.com/v2/accounts/25299",
          "cachedResultName": "giangxai.aff"
        },
        "postContentText": "={{ $('Get source').item.json.title }}",
        "postContentMediaUrls": "={{ $('Get visual').item.json.item?.mediaUrl || $('Get visual').item.json.item?.imageUrls || '' }}"
      },
      "credentials": {
        "blotatoApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "d13f41d7-b515-4c5e-b2dc-9981f529bc58",
      "name": "Publish to Facebook",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "position": [
        -224,
        576
      ],
      "parameters": {
        "options": {},
        "platform": "facebook",
        "accountId": {
          "__rl": true,
          "mode": "list",
          "value": "16978",
          "cachedResultUrl": "https://backend.blotato.com/v2/accounts/16978",
          "cachedResultName": "Giang VT"
        },
        "facebookPageId": {
          "__rl": true,
          "mode": "list",
          "value": "688227101036478",
          "cachedResultUrl": "https://backend.blotato.com/v2/accounts/16978/subaccounts/688227101036478",
          "cachedResultName": "Giang VT"
        },
        "postContentText": "={{ $('Get source').item.json.title }}",
        "postContentMediaUrls": "={{ $('Get visual').item.json.item.imageUrls[0] }}"
      },
      "credentials": {
        "blotatoApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "8b69c878-001c-401f-8169-4c0619aaf767",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1408,
        -176
      ],
      "parameters": {
        "width": 512,
        "height": 1040,
        "content": "# \ud83d\udee0\ufe0f Workflow Setup Guide  \n\nAuthor: [GiangxAI](https://www.youtube.com/@giangxai.official)\n\n## How it works\n\n- A public content URL (Blog, YouTube, TikTok, etc.) is submitted to trigger the workflow  \n- A Source job is created to extract and structure the content  \n- The workflow waits for AI processing and checks extraction status  \n- Structured content is sent to Blotato to create a visual/video  \n- The workflow waits for AI rendering to complete  \n- The generated visual asset is retrieved and validated  \n- The final content is automatically published to:\n  - Instagram  \n  - Facebook  \n\nThe entire pipeline runs using an async pattern:\n\nCreate \u2192 Wait \u2192 Get \u2192 Check \u2192 Publish  \n\nOnce configured, the system repurposes viral content into multi-platform posts automatically \u2014 no manual editing or uploading required.\n\n---\n\n## Setup guide [n8n](https://n8n.partnerlinks.io/giangxai)\n\n- Configure the **Submit Content URL** node to accept public content links  \n- Connect your **Source extraction API credentials**  \n- Add **  [Blotato](https://blotato.com/?ref=giang9s) API credentials** for AI visual generation  \n- Configure Instagram and Facebook credentials for auto publishing  \n- Review status routing logic (failed / completed / processing)  \n- Adjust wait timing based on API processing speed  \n\nSetup is straightforward and requires no manual design, video editing, or platform switching once live."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "1d54e68b-d225-4077-aa55-26f82eb5fa95",
  "connections": {
    "Get source": {
      "main": [
        [
          {
            "node": "Source Status Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get visual": {
      "main": [
        [
          {
            "node": "Visual Status Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Source": {
      "main": [
        [
          {
            "node": "Wait for Source Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create visual": {
      "main": [
        [
          {
            "node": "Wait for Visual Rendering",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Submit Content URL": {
      "main": [
        [
          {
            "node": "Create Source",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Visual Status Check": {
      "main": [
        [
          {
            "node": "Publish to Instagram",
            "type": "main",
            "index": 0
          },
          {
            "node": "Publish to Facebook",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait for Visual Rendering",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Source Status Switch": {
      "main": [
        [],
        [
          {
            "node": "Create visual",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait for Source Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Visual Rendering": {
      "main": [
        [
          {
            "node": "Get visual",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Source Processing": {
      "main": [
        [
          {
            "node": "Get source",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}