{
  "id": "M3OVuJIWCW6EsxvK",
  "meta": {
    "builderVariant": "mcp",
    "aiBuilderAssisted": true
  },
  "name": "Generate AI videos from a photo and publish to TikTok, Instagram and Facebook",
  "tags": [],
  "nodes": [
    {
      "id": "535439eb-00b4-4b8d-98c6-af3a6467af8c",
      "name": "Receive prompt and image on Telegram",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        48,
        400
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "b9bb2b19-ea24-437b-b4e4-3e939ded6374",
      "name": "Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        320,
        400
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cfg-model",
              "name": "atlas_model",
              "type": "string",
              "value": "alibaba/wan-2.7/image-to-video"
            },
            {
              "id": "cfg-prompt",
              "name": "video_prompt",
              "type": "string",
              "value": "={{ $('Receive prompt and image on Telegram').item.json.message.caption }}"
            },
            {
              "id": "cfg-duration",
              "name": "video_duration",
              "type": "number",
              "value": 8
            },
            {
              "id": "cfg-resolution",
              "name": "video_resolution",
              "type": "string",
              "value": "720P"
            },
            {
              "id": "cfg-caption",
              "name": "social_caption",
              "type": "string",
              "value": "={{ $('Receive prompt and image on Telegram').item.json.message.caption }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "3b8c28a2-0a68-423b-8c20-688a3972a5a6",
      "name": "Get image file from Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        480,
        400
      ],
      "parameters": {
        "fileId": "={{ $('Receive prompt and image on Telegram').item.json.message.photo.last().file_id }}",
        "resource": "file",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "90ee87f4-e5bf-4c1b-9bf0-0acb440840d6",
      "name": "Upload image to AtlasCloud",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        720,
        400
      ],
      "parameters": {
        "url": "https://api.atlascloud.ai/api/v1/model/uploadMedia",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "d904c6cc-a6f6-4531-9132-2531849445c9",
      "name": "Generate video with WAN 2.7",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        864,
        400
      ],
      "parameters": {
        "url": "https://api.atlascloud.ai/api/v1/model/generateVideo",
        "method": "POST",
        "options": {},
        "jsonBody": "={ \"model\": \"{{ $('Configuration').item.json.atlas_model }}\", \"prompt\": {{ JSON.stringify($('Configuration').item.json.video_prompt) }}, \"image\": \"{{ $('Upload image to AtlasCloud').item.json.data.download_url }}\", \"duration\": {{ Math.min(Math.max($('Configuration').item.json.video_duration, 2), 15) }}, \"resolution\": \"{{ $('Configuration').item.json.video_resolution }}\" }",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "36ad761b-8f61-481a-ad53-c3e13c237ea2",
      "name": "Wait before checking status",
      "type": "n8n-nodes-base.wait",
      "position": [
        1056,
        400
      ],
      "parameters": {
        "amount": 15
      },
      "typeVersion": 1.1
    },
    {
      "id": "d92ebaac-cfbd-44f1-bc11-5c97956f6bed",
      "name": "Get generation status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1200,
        400
      ],
      "parameters": {
        "url": "=https://api.atlascloud.ai/api/v1/model/prediction/{{ $('Generate video with WAN 2.7').item.json.data.id }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "94ac8598-8e40-434d-9fb7-e0f712fab2c7",
      "name": "Is video ready?",
      "type": "n8n-nodes-base.if",
      "position": [
        1344,
        400
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "cond-completed",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.data.status }}",
              "rightValue": "completed"
            },
            {
              "id": "cond-succeeded",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.data.status }}",
              "rightValue": "succeeded"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "fd093596-0d5c-42ad-a0a0-6359e2c10e54",
      "name": "Prepare social post",
      "type": "n8n-nodes-base.set",
      "position": [
        1632,
        384
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ps-url",
              "name": "video_url",
              "type": "string",
              "value": "={{ $('Get generation status').item.json.data.outputs[0] }}"
            },
            {
              "id": "ps-caption",
              "name": "post_caption",
              "type": "string",
              "value": "={{ $('Configuration').item.json.social_caption }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "3bec87a1-c250-44f8-8ce3-f3d0d7f5caea",
      "name": "Publish to TikTok",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "onError": "continueRegularOutput",
      "position": [
        1808,
        272
      ],
      "parameters": {
        "options": {},
        "platform": "tiktok",
        "accountId": {
          "__rl": true,
          "mode": "list",
          "value": "30526",
          "cachedResultUrl": "https://backend.blotato.com/v2/accounts/30526",
          "cachedResultName": "eliteshicos"
        },
        "postContentText": "={{ $('Prepare social post').item.json.post_caption }}",
        "postContentMediaUrls": "={{ $('Prepare social post').item.json.video_url }}",
        "postCreateTiktokOptionIsAiGenerated": true
      },
      "credentials": {
        "blotatoApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "35ef535c-b7b5-47ff-b3e1-65f96448448c",
      "name": "Publish to Instagram",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "onError": "continueRegularOutput",
      "position": [
        1920,
        752
      ],
      "parameters": {
        "options": {},
        "accountId": {
          "__rl": true,
          "mode": "list",
          "value": "1687",
          "cachedResultUrl": "https://backend.blotato.com/v2/accounts/1687",
          "cachedResultName": "acces.a.vie"
        },
        "postContentText": "={{ $('Prepare social post').item.json.post_caption }}",
        "postContentMediaUrls": "={{ $('Prepare social post').item.json.video_url }}"
      },
      "credentials": {
        "blotatoApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "13bd1c40-daf4-4c9e-9334-21e2f58458ab",
      "name": "Publish to Facebook",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "onError": "continueRegularOutput",
      "position": [
        1952,
        384
      ],
      "parameters": {
        "options": {},
        "platform": "facebook",
        "accountId": {
          "__rl": true,
          "mode": "list",
          "value": "1759",
          "cachedResultUrl": "https://backend.blotato.com/v2/accounts/1759",
          "cachedResultName": "Firass Ben"
        },
        "facebookPageId": {
          "__rl": true,
          "mode": "list",
          "value": "101603614680195",
          "cachedResultUrl": "https://backend.blotato.com/v2/accounts/1759/subaccounts/101603614680195",
          "cachedResultName": "Dr. Firas"
        },
        "postContentText": "={{ $('Prepare social post').item.json.post_caption }}",
        "postContentMediaUrls": "={{ $('Prepare social post').item.json.video_url }}"
      },
      "credentials": {
        "blotatoApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "36ed95d5-8a48-4953-b824-ac71db7277c8",
      "name": "Send confirmation on Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1968,
        560
      ],
      "parameters": {
        "text": "=Your AI video is ready and is being published to TikTok, Instagram and Facebook.\n\n{{ $('Get generation status').item.json.data.outputs[0] }}",
        "chatId": "={{ $('Receive prompt and image on Telegram').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 1.2
    },
    {
      "id": "578772ce-36d7-4f3b-9599-b9c321ff3922",
      "name": "Sticky Note 52ab9df5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -576,
        96
      ],
      "parameters": {
        "color": 4,
        "width": 520,
        "height": 812,
        "content": "# Generate AI videos from a photo and publish to TikTok, Instagram and Facebook\n\n# \ud83d\udce5  [Open full documentation on Notion](https://automatisation.notion.site/Generate-AI-videos-from-a-photo-and-publish-to-TikTok-Instagram-and-Facebook-38c3d6550fd98187b948d5c3927d6376)\n\n## How it works\nSend a photo with a caption (your prompt) to your Telegram bot. The workflow uploads the image to [AtlasCloud](https://www.atlascloud.ai/?ref=8QKPJE), turns it into a short cinematic clip with the WAN 2.7 image-to-video model, waits for the render to finish, then publishes the final video to TikTok, Instagram and Facebook through [Blotato](https://blotato.com/?ref=firas).\n\n## Setup\n1. Select your Telegram bot credential on the trigger and the confirmation node.\n2. On both AtlasCloud HTTP nodes, select your \"AtlasCloud API\" header-auth credential (Authorization: Bearer your-key).\n3. On the three Blotato nodes, select your \"Blotato account\" credential and pick the target account for each platform.\n4. Adjust the \"Configuration\" node (duration, resolution, caption).\n\n## Requirements\n- n8n self-hosted, or n8n Cloud with Verified Community Nodes enabled (Blotato is a community node).\n- A Telegram bot token.\n- An [AtlasCloud](https://www.atlascloud.ai/?ref=8QKPJE) API key. WAN 2.7 costs about 0.10 USD per second of video.\n- A Blotato account connected to TikTok, Instagram and Facebook.\n\n## Customization\n- Change duration (2 to 15s, the WAN 2.7 limit), resolution (720P or 1080P) and the model in \"Configuration\".\n- Edit the social caption in \"Configuration\".\n- The video is AI generated, so it is flagged as AI content on TikTok. Keep a human review before publishing widely.\n\nNote: Blotato is a community node and does not render in catalogue previews. Attach a workflow screenshot when submitting."
      },
      "typeVersion": 1
    },
    {
      "id": "8a02a6b6-7350-4efe-94aa-750b821886cd",
      "name": "Sticky Note 5ceef493",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        96
      ],
      "parameters": {
        "color": 7,
        "width": 740,
        "height": 824,
        "content": "## 1. Receive the request on Telegram\nSend a photo plus a caption (the prompt) to your bot. The Configuration node centralizes every adjustable variable."
      },
      "typeVersion": 1
    },
    {
      "id": "a1cdd1db-6fe5-4147-85ad-f239bc81d3c8",
      "name": "Sticky Note a5198d86",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        96
      ],
      "parameters": {
        "color": 7,
        "width": 892,
        "height": 824,
        "content": "## 2. Generate the video with AtlasCloud WAN 2.7\nUpload the image, start WAN 2.7 image-to-video, then poll until the render is ready. Select your AtlasCloud API credential on both HTTP nodes."
      },
      "typeVersion": 1
    },
    {
      "id": "058525c5-7176-478b-87e9-9b518a6faabf",
      "name": "Sticky Note 6ced8f71",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1616,
        96
      ],
      "parameters": {
        "color": 7,
        "width": 520,
        "height": 820,
        "content": "## 3. Publish to social with Blotato\nPost the finished video to TikTok, Instagram and Facebook, then confirm on Telegram. Pick the account for each platform."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": true,
    "executionOrder": "v1"
  },
  "versionId": "49fa5a41-11eb-4f66-9c5e-a1e5e139e65f",
  "nodeGroups": [],
  "connections": {
    "Configuration": {
      "main": [
        [
          {
            "node": "Get image file from Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is video ready?": {
      "main": [
        [
          {
            "node": "Prepare social post",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait before checking status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare social post": {
      "main": [
        [
          {
            "node": "Publish to TikTok",
            "type": "main",
            "index": 0
          },
          {
            "node": "Publish to Instagram",
            "type": "main",
            "index": 0
          },
          {
            "node": "Publish to Facebook",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send confirmation on Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get generation status": {
      "main": [
        [
          {
            "node": "Is video ready?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload image to AtlasCloud": {
      "main": [
        [
          {
            "node": "Generate video with WAN 2.7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate video with WAN 2.7": {
      "main": [
        [
          {
            "node": "Wait before checking status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait before checking status": {
      "main": [
        [
          {
            "node": "Get generation status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get image file from Telegram": {
      "main": [
        [
          {
            "node": "Upload image to AtlasCloud",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive prompt and image on Telegram": {
      "main": [
        [
          {
            "node": "Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}