{
  "name": "Generate news digest videos from WordPress to YouTube with Shotstack",
  "nodes": [
    {
      "id": "763d99c6-fc00-47a5-b41b-13c8737a1c27",
      "name": "Get articles from today",
      "type": "n8n-nodes-base.wordpress",
      "position": [
        -144,
        272
      ]
    },
    {
      "id": "6a7b2c35-cba6-4c78-a785-b3ab1b262228",
      "name": "Check if have enough articles",
      "type": "n8n-nodes-base.if",
      "position": [
        80,
        272
      ]
    },
    {
      "id": "c1b5d525-4b4c-4902-b42b-2f0d5d39356f",
      "name": "Prepare json for Shotstack",
      "type": "n8n-nodes-base.code",
      "position": [
        2448,
        272
      ]
    },
    {
      "id": "5afec0e2-6ecf-47a9-8928-95cf8233f678",
      "name": "Shotstack - Submit Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2688,
        272
      ]
    },
    {
      "id": "8de82052-a42a-40cd-a380-a8a1ab048942",
      "name": "Wait - Shotstack Works",
      "type": "n8n-nodes-base.wait",
      "position": [
        2944,
        272
      ]
    },
    {
      "id": "026cf632-4104-4739-bcc2-15a7c40ef19a",
      "name": "Assign Default Image",
      "type": "n8n-nodes-base.set",
      "position": [
        1664,
        256
      ]
    },
    {
      "id": "d79f3f3f-2512-423e-9d46-0adfa33f8534",
      "name": "Check for missing images",
      "type": "n8n-nodes-base.if",
      "position": [
        1040,
        272
      ]
    },
    {
      "id": "94bf161d-ed31-4a9d-812c-a091a2c4aaf8",
      "name": "Get Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1200,
        448
      ]
    },
    {
      "id": "9610b385-87a9-4038-97b9-8745a4e2a710",
      "name": "Trice once a day - evenings",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -704,
        272
      ]
    },
    {
      "id": "f12d5ebf-2fb7-4591-90ab-fbc48836a6c8",
      "name": "Check if have videos",
      "type": "n8n-nodes-base.code",
      "position": [
        304,
        272
      ]
    },
    {
      "id": "41165d06-b6be-44ca-ac3c-66619fb71051",
      "name": "Clean data and assign fields",
      "type": "n8n-nodes-base.set",
      "position": [
        528,
        272
      ]
    },
    {
      "id": "d22ac7bd-9548-435a-a3f1-ec1a99222f64",
      "name": "Assign image URL",
      "type": "n8n-nodes-base.set",
      "position": [
        1376,
        448
      ]
    },
    {
      "id": "cb144c04-ec1f-4eb4-be31-56221bef9f5a",
      "name": "Merge image url with article details",
      "type": "n8n-nodes-base.merge",
      "position": [
        1664,
        432
      ]
    },
    {
      "id": "27d232c4-8288-4b5b-a2d6-7913ea9556b5",
      "name": "Merge all articles",
      "type": "n8n-nodes-base.merge",
      "position": [
        1936,
        272
      ]
    },
    {
      "id": "3c18b2d3-f039-4950-bda7-a13972830559",
      "name": "Check Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3184,
        272
      ]
    },
    {
      "id": "88eb937e-e90b-4a5b-ad67-435dd9a0a3cd",
      "name": "If video is ready",
      "type": "n8n-nodes-base.if",
      "position": [
        3408,
        272
      ]
    },
    {
      "id": "591fff7d-9bd4-4b17-b9e6-f0e02a51d96b",
      "name": "Upload video to youtube as",
      "type": "n8n-nodes-base.youTube",
      "position": [
        4144,
        256
      ]
    },
    {
      "id": "65f96e80-adeb-4fe9-a097-98f5b7a0e049",
      "name": "Config Variables",
      "type": "n8n-nodes-base.set",
      "position": [
        -368,
        272
      ]
    },
    {
      "id": "55ded48f-6ce4-4032-8c0b-d994f8e7f4ba",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1408,
        64
      ],
      "parameters": {
        "width": 560,
        "height": 400,
        "content": "## How it works\nThe workflow runs every evening. It scans all news articles published that day on your website, detects any embedded videos, and selects the featured image, or a default one if none is"
      }
    },
    {
      "id": "2fc57e7f-85c1-42de-b6a6-84d9b087dcda",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        208
      ],
      "parameters": {
        "width": 1136,
        "height": 256,
        "content": ""
      }
    },
    {
      "id": "40a34193-cd41-4a09-bd60-05e680fa69bb",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        64
      ],
      "parameters": {
        "width": 1136,
        "height": 128,
        "content": "## Configure workflow & retrieve articles\n\nThis section sets the default variables, fetches all articles published today, and checks whether any video is present."
      }
    },
    {
      "id": "59b81c8d-325c-44dc-b11c-3e208b66c681",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        208
      ],
      "parameters": {
        "width": 1152,
        "height": 416,
        "content": ""
      }
    },
    {
      "id": "8989983f-b8e1-4a97-bed9-316762224bf3",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        64
      ],
      "parameters": {
        "width": 1152,
        "height": 128,
        "content": "## Get background image URL\n\nThis section retrieves the image URL from WordPress, or assigns the default image if none is available."
      }
    },
    {
      "id": "4f3f4209-49b3-408f-8f06-978c2856f122",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2416,
        208
      ],
      "parameters": {
        "width": 1392,
        "height": 304,
        "content": ""
      }
    },
    {
      "id": "1cf6a3ca-4291-4eca-b551-73979a56e758",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2416,
        64
      ],
      "parameters": {
        "width": 1392,
        "height": 128,
        "content": "## Generate video\n\nThis section prepares the JSON payload for Shotstack based on their API, submits the rendering request, and checks every 30 seconds until the video is ready, then retrieves the down"
      }
    },
    {
      "id": "032d0e66-6671-4669-897c-d37d881d8f1e",
      "name": "Download video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3664,
        256
      ]
    },
    {
      "id": "b0d0347a-518a-4138-9d08-d641255d39c5",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4032,
        208
      ],
      "parameters": {
        "width": 336,
        "height": 304,
        "content": ""
      }
    },
    {
      "id": "8a001666-d848-4839-b865-4205ef88e8c1",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4032,
        64
      ],
      "parameters": {
        "width": 336,
        "height": 128,
        "content": "## Submits Short\n\nThis node uploads the generated Short to YouTube."
      }
    }
  ],
  "connections": {
    "Get Image": {
      "main": [
        [
          {
            "node": "Assign image URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Status": {
      "main": [
        [
          {
            "node": "If video is ready",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download video": {
      "main": [
        [
          {
            "node": "Upload video to youtube as",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Assign image URL": {
      "main": [
        [
          {
            "node": "Merge image url with article details",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Config Variables": {
      "main": [
        [
          {
            "node": "Get articles from today",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If video is ready": {
      "main": [
        [
          {
            "node": "Download video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait - Shotstack Works",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge all articles": {
      "main": [
        [
          {
            "node": "Prepare json for Shotstack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Assign Default Image": {
      "main": [
        [
          {
            "node": "Merge all articles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if have videos": {
      "main": [
        [
          {
            "node": "Clean data and assign fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait - Shotstack Works": {
      "main": [
        [
          {
            "node": "Check Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get articles from today": {
      "main": [
        [
          {
            "node": "Check if have enough articles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for missing images": {
      "main": [
        [
          {
            "node": "Assign Default Image",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Image",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge image url with article details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare json for Shotstack": {
      "main": [
        [
          {
            "node": "Shotstack - Submit Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Shotstack - Submit Request": {
      "main": [
        [
          {
            "node": "Wait - Shotstack Works",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload video to youtube as": {
      "main": [
        []
      ]
    },
    "Trice once a day - evenings": {
      "main": [
        [
          {
            "node": "Config Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean data and assign fields": {
      "main": [
        [
          {
            "node": "Check for missing images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if have enough articles": {
      "main": [
        [
          {
            "node": "Check if have videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge image url with article details": {
      "main": [
        [
          {
            "node": "Merge all articles",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}