{
  "name": "Songs2VID — Audio → Render → YouTube (full)",
  "meta": {
    "templateCredsSetupCompleted": false,
    "instanceId": "songs2vid-docs-template-v2"
  },
  "nodes": [
    {
      "parameters": {},
      "id": "manual-trigger",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [0, 0]
    },
    {
      "parameters": {
        "path": "songs2vid-complete",
        "httpMethod": "POST",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "webhook-complete",
      "name": "Songs2VID Job Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [0, 360],
      "webhookId": "songs2vid-complete"
    },
    {
      "parameters": {
        "content": "## Inputs\nProvide binary fields on the Manual Trigger item (or replace with Drive/Dropbox download):\n- `cover` — JPEG/PNG cover art\n- `audio` — MP3/WAV/FLAC/…\n\nCredential: Header Auth → Name `Authorization`, Value `Bearer s2yt_live_…`",
        "height": 220,
        "width": 320
      },
      "id": "sticky-inputs",
      "name": "Setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-320, -40]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $env.SONGS2VID_BASE_URL || 'https://songs2vid.com' }}/api/v1/upload",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "parameterType": "formBinaryData",
              "name": "file",
              "inputDataFieldName": "cover"
            },
            {
              "name": "type",
              "value": "image"
            }
          ]
        },
        "options": {}
      },
      "id": "upload-cover",
      "name": "Upload Cover Image",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [280, 0],
      "credentials": {
        "httpHeaderAuth": {
          "id": "REPLACE_ME",
          "name": "Songs2VID API Key"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $env.SONGS2VID_BASE_URL || 'https://songs2vid.com' }}/api/v1/upload",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "parameterType": "formBinaryData",
              "name": "file",
              "inputDataFieldName": "audio"
            },
            {
              "name": "type",
              "value": "audio"
            }
          ]
        },
        "options": {}
      },
      "id": "upload-audio",
      "name": "Upload Audio",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [520, 0],
      "credentials": {
        "httpHeaderAuth": {
          "id": "REPLACE_ME",
          "name": "Songs2VID API Key"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $env.SONGS2VID_BASE_URL || 'https://songs2vid.com' }}/api/v1/render",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"imagePath\": \"{{ $('Upload Cover Image').item.json.path }}\",\n  \"webhookUrl\": \"{{ $('Songs2VID Job Webhook').params?.webhookUrl || $env.SONGS2VID_WEBHOOK_URL || '' }}\",\n  \"items\": [{\n    \"audioPath\": \"{{ $('Upload Audio').item.json.path }}\",\n    \"audioFilename\": \"{{ $('Upload Audio').item.json.filename }}\",\n    \"metadata\": {\n      \"title\": \"{{ $('Upload Audio').item.json.audioTags?.title || $('Upload Audio').item.json.filename }}\",\n      \"songTitle\": \"{{ $('Upload Audio').item.json.audioTags?.title || '' }}\",\n      \"artist\": \"{{ $('Upload Audio').item.json.audioTags?.artist || '' }}\",\n      \"description\": \"Uploaded via n8n + Songs2VID\",\n      \"tags\": \"music,songs2vid\",\n      \"privacy\": \"UNLISTED\",\n      \"categoryId\": \"10\",\n      \"resolution\": \"1920x1080\",\n      \"notifySubscribers\": false,\n      \"madeForKids\": false,\n      \"embeddable\": true,\n      \"creativeCommons\": false,\n      \"includeWatermark\": false\n    }\n  }]\n}",
        "options": {}
      },
      "id": "create-render",
      "name": "Create Render",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [760, 0],
      "credentials": {
        "httpHeaderAuth": {
          "id": "REPLACE_ME",
          "name": "Songs2VID API Key"
        }
      }
    },
    {
      "parameters": {
        "method": "GET",
        "url": "={{ $env.SONGS2VID_BASE_URL || 'https://songs2vid.com' }}{{ $json.statusUrl }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {}
      },
      "id": "poll-status",
      "name": "Get Render Status (optional poll)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [1000, 0],
      "credentials": {
        "httpHeaderAuth": {
          "id": "REPLACE_ME",
          "name": "Songs2VID API Key"
        }
      },
      "disabled": true
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "job-done",
              "leftValue": "={{ $json.body?.event || $json.event }}",
              "rightValue": "job.completed",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            },
            {
              "id": "item-done",
              "leftValue": "={{ $json.body?.event || $json.event }}",
              "rightValue": "job.item.completed",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "or"
        },
        "options": {}
      },
      "id": "if-completed",
      "name": "Render Completed?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [280, 360]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "job-fail",
              "leftValue": "={{ $json.body?.event || $json.event }}",
              "rightValue": "job.failed",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            },
            {
              "id": "item-fail",
              "leftValue": "={{ $json.body?.event || $json.event }}",
              "rightValue": "job.item.failed",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "or"
        },
        "options": {}
      },
      "id": "if-failed",
      "name": "Render Failed?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [280, 560]
    },
    {
      "parameters": {
        "content": "## YouTube live\nVideo ID: `{{ $json.body?.youtubeVideoId || $json.youtubeVideoId }}`\n\nOpen: https://youtu.be/{{ $json.body?.youtubeVideoId || $json.youtubeVideoId }}\n\nJob: `{{ $json.body?.jobId || $json.jobId }}`",
        "height": 200,
        "width": 360
      },
      "id": "sticky-success",
      "name": "Success",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [560, 320]
    },
    {
      "parameters": {
        "content": "## Failed\nError: `{{ $json.body?.error || $json.error }}`\n\nPoll: `GET {{ $env.SONGS2VID_BASE_URL || 'https://songs2vid.com' }}/api/v1/jobs/{{ $json.body?.jobId || $json.jobId }}`",
        "height": 200,
        "width": 360
      },
      "id": "sticky-fail",
      "name": "Failure",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [560, 520]
    }
  ],
  "connections": {
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Upload Cover Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Cover Image": {
      "main": [
        [
          {
            "node": "Upload Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Audio": {
      "main": [
        [
          {
            "node": "Create Render",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Render": {
      "main": [
        [
          {
            "node": "Get Render Status (optional poll)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Songs2VID Job Webhook": {
      "main": [
        [
          {
            "node": "Render Completed?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Render Completed?": {
      "main": [
        [
          {
            "node": "Success",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Render Failed?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Render Failed?": {
      "main": [
        [
          {
            "node": "Failure",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [
    { "name": "songs2vid" },
    { "name": "n8n" },
    { "name": "youtube" }
  ],
  "triggerCount": 0,
  "updatedAt": "2026-08-08T00:00:00.000Z",
  "versionId": "2"
}
