{
  "docVersion": 1,
  "id": "template-video-streaming-pipeline",
  "name": "Video streaming pipeline",
  "purpose": "Masters fan out to parallel transcode filters, fan in at the packager (wait-for-all), and stream through two health-scored CDNs off one origin.",
  "nodes": {
    "creator": {
      "type": "user",
      "label": "Creator",
      "x": 20,
      "y": 240,
      "runtime": "uploads 4K master"
    },
    "upload": {
      "type": "gateway",
      "label": "Upload Service",
      "x": 280,
      "y": 240,
      "runtime": "resumable chunks",
      "patterns": [
        "stateless"
      ]
    },
    "raw": {
      "type": "storage",
      "label": "Masters Bucket",
      "x": 540,
      "y": 240,
      "runtime": "raw originals",
      "patterns": [
        "backup"
      ]
    },
    "orch": {
      "type": "orchestrator",
      "label": "Transcode Orchestrator",
      "x": 800,
      "y": 240,
      "runtime": "job graph per title",
      "color": "blue",
      "notes": "Fans one master out into independent rendition jobs and tracks completion — the fan-in condition lives here."
    },
    "transA": {
      "type": "gpu",
      "label": "1080p Encoder",
      "x": 1060,
      "y": 60,
      "runtime": "H.264/HEVC",
      "patterns": [
        "autoscale"
      ]
    },
    "transB": {
      "type": "gpu",
      "label": "720p / 480p Encoder",
      "x": 1060,
      "y": 240,
      "runtime": "ladder renditions",
      "patterns": [
        "autoscale"
      ]
    },
    "transC": {
      "type": "worker",
      "label": "Audio + Captions",
      "x": 1060,
      "y": 420,
      "runtime": "AAC · WebVTT"
    },
    "packager": {
      "type": "worker",
      "label": "Packager",
      "x": 1320,
      "y": 240,
      "runtime": "waits for ALL renditions",
      "color": "green",
      "notes": "HLS/DASH manifests are cut only when every rendition landed — a missing 720p means no manifest, not a broken one."
    },
    "origin": {
      "type": "storage",
      "label": "Origin",
      "x": 1580,
      "y": 240,
      "runtime": "segments + manifests"
    },
    "cdn1": {
      "type": "cdn",
      "label": "CDN — provider A",
      "x": 1840,
      "y": 110,
      "runtime": "primary · 92% hit"
    },
    "cdn2": {
      "type": "cdn",
      "label": "CDN — provider B",
      "x": 1840,
      "y": 380,
      "runtime": "failover · warm"
    },
    "viewer": {
      "type": "tv",
      "label": "Viewer",
      "x": 2100,
      "y": 240,
      "runtime": "adaptive bitrate player"
    }
  },
  "edges": {
    "e1": {
      "from": "creator",
      "to": "upload",
      "fromSide": "right",
      "toSide": "left",
      "label": "resumable upload",
      "animated": true
    },
    "e2": {
      "from": "upload",
      "to": "raw",
      "fromSide": "right",
      "toSide": "left",
      "animated": true
    },
    "e3": {
      "from": "raw",
      "to": "orch",
      "fromSide": "right",
      "toSide": "left",
      "label": "new master → jobs"
    },
    "e4": {
      "from": "orch",
      "to": "transA",
      "fromSide": "right",
      "toSide": "left",
      "style": "dashed",
      "patterns": [
        "batch"
      ]
    },
    "e5": {
      "from": "orch",
      "to": "transB",
      "fromSide": "right",
      "toSide": "left",
      "label": "fan-out renditions",
      "style": "dashed"
    },
    "e6": {
      "from": "orch",
      "to": "transC",
      "fromSide": "right",
      "toSide": "left",
      "style": "dashed"
    },
    "e7": {
      "from": "transA",
      "to": "packager",
      "fromSide": "right",
      "toSide": "left"
    },
    "e8": {
      "from": "transB",
      "to": "packager",
      "fromSide": "right",
      "toSide": "left",
      "label": "fan-in: wait-for-all"
    },
    "e9": {
      "from": "transC",
      "to": "packager",
      "fromSide": "right",
      "toSide": "left"
    },
    "e10": {
      "from": "packager",
      "to": "origin",
      "fromSide": "right",
      "toSide": "left",
      "label": "publish"
    },
    "e11": {
      "from": "origin",
      "to": "cdn1",
      "fromSide": "right",
      "toSide": "left",
      "label": "pull-through"
    },
    "e12": {
      "from": "origin",
      "to": "cdn2",
      "fromSide": "right",
      "toSide": "left",
      "style": "dashed"
    },
    "e13": {
      "from": "viewer",
      "to": "cdn1",
      "fromSide": "left",
      "toSide": "right",
      "label": "HLS segments",
      "animated": true
    },
    "e14": {
      "from": "viewer",
      "to": "cdn2",
      "fromSide": "left",
      "toSide": "right",
      "label": "failover on health score",
      "style": "dashed",
      "patterns": [
        "fallback"
      ]
    }
  },
  "boxes": {
    "b1": {
      "x": 1020,
      "y": -30,
      "w": 490,
      "h": 620,
      "label": "pipes & filters — every stage restartable",
      "color": "blue",
      "opacity": 0.04
    }
  },
  "texts": {
    "t1": {
      "x": 20,
      "y": 440,
      "text": "why fan-in waits for all:\na manifest referencing a missing rendition\nis a player error in the wild — ship the\ntitle late, never broken",
      "color": "blue",
      "size": 12
    }
  },
  "meta": {
    "createdAt": "2026-07-13T09:00:00.000Z",
    "modifiedAt": "2026-07-13T09:00:00.000Z"
  }
}