{
  "name": "Blog post to sketch video (LLMSketch)",
  "nodes": [
    {
      "parameters": {"rule": {"interval": [{"field": "days", "triggerAtHour": 9}]}},
      "id": "schedule-1",
      "name": "Daily 9am",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [0, 0]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.programmaticsketch.dev/v1/render",
        "sendHeaders": true,
        "headerParameters": {"parameters": [
          {"name": "X-API-Key", "value": "={{ $env.LLMSKETCH_API_KEY }}"},
          {"name": "Content-Type", "value": "application/json"}
        ]},
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"prompt\": \"{{ $json.blog_summary }}\", \"format\": \"mp4\"}"
      },
      "id": "render-1",
      "name": "Submit sketch render",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [220, 0]
    },
    {
      "parameters": {"amount": 45, "unit": "seconds"},
      "id": "wait-1",
      "name": "Wait 45s",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [440, 0]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "=https://api.programmaticsketch.dev/v1/jobs/{{ $json.job_id }}"
      },
      "id": "poll-1",
      "name": "Poll job",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [660, 0]
    },
    {
      "parameters": {
        "conditions": {"string": [{"value1": "={{ $json.status }}", "value2": "done"}]}
      },
      "id": "if-done",
      "name": "Done?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [880, 0]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "={{ $json.url }}",
        "options": {"response": {"response": {"responseFormat": "file"}}}
      },
      "id": "download-1",
      "name": "Download MP4",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [1100, -100]
    }
  ],
  "connections": {
    "Daily 9am": {"main": [[{"node": "Submit sketch render", "type": "main", "index": 0}]]},
    "Submit sketch render": {"main": [[{"node": "Wait 45s", "type": "main", "index": 0}]]},
    "Wait 45s": {"main": [[{"node": "Poll job", "type": "main", "index": 0}]]},
    "Poll job": {"main": [[{"node": "Done?", "type": "main", "index": 0}]]},
    "Done?": {"main": [[{"node": "Download MP4", "type": "main", "index": 0}], [{"node": "Wait 45s", "type": "main", "index": 0}]]}
  },
  "settings": {"executionOrder": "v1"},
  "meta": {"notes": "Set LLMSKETCH_API_KEY env var. Feed blog_summary from your CMS/RSS node before 'Submit sketch render'. If not done, loops back to wait."}
}