{
  "name": "Soke — Video Transcription (Async)",
  "nodes": [
    {
      "parameters": {},
      "id": "g1b2c3d4-0007-4000-8000-000000000001",
      "name": "When clicking 'Test workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [180, 300]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.usesoke.ai/api/v1/transcription",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "name": "url",
              "value": "={{ $json.videoUrl || 'https://youtube.com/watch?v=VIDEO_ID' }}"
            }
          ]
        },
        "options": {}
      },
      "id": "g1b2c3d4-0007-4000-8000-000000000002",
      "name": "Start Transcription",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [420, 300],
      "credentials": {
        "httpHeaderAuth": {
          "id": "CREDENTIAL_ID",
          "name": "Soke API"
        }
      }
    },
    {
      "parameters": {
        "amount": 10,
        "unit": "seconds"
      },
      "id": "g1b2c3d4-0007-4000-8000-000000000003",
      "name": "Wait 10s",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [660, 300],
      "webhookId": "soke-wait-txn"
    },
    {
      "parameters": {
        "method": "GET",
        "url": "=https://api.usesoke.ai/api/v1/transcription/{{ $('Start Transcription').item.json.data.id }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {}
      },
      "id": "g1b2c3d4-0007-4000-8000-000000000004",
      "name": "Poll Transcription Status",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [900, 300],
      "credentials": {
        "httpHeaderAuth": {
          "id": "CREDENTIAL_ID",
          "name": "Soke API"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "condition-1",
              "leftValue": "={{ $json.data.status }}",
              "rightValue": "completed",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "g1b2c3d4-0007-4000-8000-000000000005",
      "name": "Is Completed?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [1140, 300]
    },
    {
      "parameters": {
        "mode": "raw",
        "jsonOutput": "={\n  \"status\": \"completed\",\n  \"transcript\": \"{{ $json.data.transcript }}\",\n  \"durationSeconds\": {{ $json.data.durationSeconds || 0 }},\n  \"wordCount\": {{ $json.data.wordCount || 0 }},\n  \"language\": \"{{ $json.data.language }}\"\n}",
        "options": {}
      },
      "id": "g1b2c3d4-0007-4000-8000-000000000006",
      "name": "Transcription Ready",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [1380, 200]
    },
    {
      "parameters": {
        "amount": 10,
        "unit": "seconds"
      },
      "id": "g1b2c3d4-0007-4000-8000-000000000007",
      "name": "Wait & Retry",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [1380, 420],
      "webhookId": "soke-wait-txn-retry"
    }
  ],
  "connections": {
    "When clicking 'Test workflow'": {
      "main": [
        [{ "node": "Start Transcription", "type": "main", "index": 0 }]
      ]
    },
    "Start Transcription": {
      "main": [
        [{ "node": "Wait 10s", "type": "main", "index": 0 }]
      ]
    },
    "Wait 10s": {
      "main": [
        [{ "node": "Poll Transcription Status", "type": "main", "index": 0 }]
      ]
    },
    "Poll Transcription Status": {
      "main": [
        [{ "node": "Is Completed?", "type": "main", "index": 0 }]
      ]
    },
    "Is Completed?": {
      "main": [
        [{ "node": "Transcription Ready", "type": "main", "index": 0 }],
        [{ "node": "Wait & Retry", "type": "main", "index": 0 }]
      ]
    },
    "Wait & Retry": {
      "main": [
        [{ "node": "Poll Transcription Status", "type": "main", "index": 0 }]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false,
    "instanceId": "soke-template"
  },
  "tags": [
    { "name": "Soke", "id": "soke-tag-1" }
  ]
}
