{
  "id": "hbkFf6ejMdbXXP5Y",
  "name": "4. Generate High-Quality Audio with Voxtral Small 24B 2507",
  "tags": [],
  "nodes": [
    {
      "id": "2a642053-9e2a-4470-802c-e0e659161b5b",
      "name": "On clicking 'execute'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        176,
        -640
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "165e01ed-cb50-4bbd-b23b-9b2e748540f6",
      "name": "Set API Key",
      "type": "n8n-nodes-base.set",
      "position": [
        400,
        -640
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "64cd57c7-2224-48a6-88df-c37b310f8eb3",
              "name": "replicate_api_key",
              "type": "string",
              "value": "YOUR_REPLICATE_API_KEY"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "ba28ca28-3400-40aa-a45f-307dcb1e290f",
      "name": "Create Prediction",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        672,
        -640
      ],
      "parameters": {
        "url": "https://api.replicate.com/v1/predictions",
        "method": "POST",
        "options": {
          "timeout": 60000
        },
        "jsonBody": "{\n  \"version\": \"31b40d9229c3df8c13863fcdd8cc95e6c1c6eb2b6c653936934234eadcc23d41\",\n  \"input\": {\n    \"audio\": \"https://example.com/input.audio\",\n    \"max_new_tokens\": 1024\n  }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{ 'Bearer ' + $('Set API Key').item.json.replicate_api_key }}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6608458d-91a3-49f8-81d9-f35469106db1",
      "name": "Extract Prediction ID",
      "type": "n8n-nodes-base.code",
      "position": [
        928,
        -640
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "// Extract prediction ID and initial status\\nconst prediction = $input.item.json;\\nconst predictionId = prediction.id;\\nconst initialStatus = prediction.status;\\n\\n// Store the prediction ID for polling\\nreturn {\\n  predictionId: predictionId,\\n  status: initialStatus,\\n  predictionUrl: `https://api.replicate.com/v1/predictions/${predictionId}`\\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "e2177196-1246-4051-9e61-783e21bc6197",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1152,
        -640
      ],
      "parameters": {
        "unit": "seconds",
        "amount": 2
      },
      "typeVersion": 1
    },
    {
      "id": "4adcc795-860d-4fd4-ab09-b57966ae765f",
      "name": "Check Prediction Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1376,
        -640
      ],
      "parameters": {
        "url": "={{ $json.predictionUrl }}",
        "options": {},
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{ 'Bearer ' + $('Set API Key').item.json.replicate_api_key }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1721a07e-3db6-44c3-b5ae-acdd781d5367",
      "name": "Check If Complete",
      "type": "n8n-nodes-base.if",
      "position": [
        1600,
        -640
      ],
      "parameters": {
        "conditions": {
          "boolean": [
            {
              "value1": "={{ $json.status }}",
              "value2": "succeeded"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3de7fe83-762e-4d28-8e92-aee96e19d0f2",
      "name": "Process Result",
      "type": "n8n-nodes-base.code",
      "position": [
        1872,
        -752
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "// Process the completed prediction\\nconst result = $input.item.json;\\n\\nreturn {\\n  status: result.status,\\n  output: result.output,\\n  metrics: result.metrics,\\n  created_at: result.created_at,\\n  completed_at: result.completed_at,\\n  model: 'notdaniel/voxtral-small-24b-2507',\\n  audio_url: result.output\\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "cde9ca87-7473-4c18-96db-fb907b6b9213",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        -1008
      ],
      "parameters": {
        "color": 7,
        "width": 406,
        "height": 543,
        "content": "## \u26a1 Section 1: Trigger & Authentication\n\n* **\ud83d\udd18 On clicking 'execute'** \u2192 Manually starts the workflow.\n* **\ud83d\udd11 Set API Key** \u2192 Stores your Replicate API key to authenticate requests.\n\n**Benefit:** Securely connects your workflow to Replicate\u2019s API and ensures only authorized requests are made.\n\n---\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "89b11241-3f2d-4458-8562-ea5bde49d8ac",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        -1104
      ],
      "parameters": {
        "color": 6,
        "width": 326,
        "height": 639,
        "content": "## \ud83c\udf9b\ufe0f Section 2: Create Prediction\n\n* **\ud83c\udf10 Create Prediction** \u2192 Sends a request to Replicate\u2019s API with parameters like:\n\n  * **audio**: Input audio file (e.g., a reference sample).\n  * **max\\_new\\_tokens**: Maximum number of tokens to generate (controls audio length/complexity).\n\n**Benefit:** Starts the audio generation process with configurable input and settings.\n\n---"
      },
      "typeVersion": 1
    },
    {
      "id": "b953d5d4-99b1-42d7-98ea-b71ca330510c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        -1056
      ],
      "parameters": {
        "color": 3,
        "width": 822,
        "height": 591,
        "content": "## \u23f3 Section 3: Polling & Status Tracking\n\n* **\ud83c\udd94 Extract Prediction ID** \u2192 Captures the unique prediction ID and endpoint for polling.\n* **\u23f1\ufe0f Wait** \u2192 Pauses for 2 seconds before re-checking.\n* **\ud83d\udce1 Check Prediction Status** \u2192 Polls Replicate\u2019s API to see if the audio generation is done.\n* **\u2705 Check If Complete** \u2192\n\n  * If finished: moves forward to process results.\n  * If not: loops back to wait and check again.\n\n**Benefit:** Efficiently manages asynchronous audio generation, ensuring the workflow only proceeds when results are ready.\n\n---\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "334b4b5c-eb1e-4685-8a0d-e907442cc11d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1760,
        -1184
      ],
      "parameters": {
        "color": 5,
        "width": 326,
        "height": 719,
        "content": "## \ud83c\udfa7 Section 4: Process Result\n\n* **\ud83d\udcdd Process Result** \u2192 Extracts and structures final output data:\n\n  * **status** (success or failure)\n  * **output** (raw response)\n  * **metrics** (generation statistics)\n  * **timestamps** (created and completed times)\n  * **audio\\_url** (final generated audio link)\n\n**Benefit:** Provides a clean, structured output that can be used in follow-up automations (e.g., sending audio to users, storing in a database, or sharing via email).\n\n---\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "0a692527-c66c-4cb3-8a5c-97b589cc536b",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1712,
        -1120
      ],
      "parameters": {
        "color": 4,
        "width": 1300,
        "height": 320,
        "content": "=======================================\n            WORKFLOW ASSISTANCE\n=======================================\nFor any questions or support, please contact:\n    Yaron@nofluff.online\n\nExplore more tips and tutorials here:\n   - YouTube: https://www.youtube.com/@YaronBeen/videos\n   - LinkedIn: https://www.linkedin.com/in/yaronbeen/\n=======================================\n"
      },
      "typeVersion": 1
    },
    {
      "id": "578ed070-c0ee-4df5-a4e9-124f7609d7c1",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1712,
        -784
      ],
      "parameters": {
        "color": 4,
        "width": 1289,
        "height": 1758,
        "content": "# Generate High-Quality Audio with Voxtral Small 24B 2507\n\nThis workflow integrates the **notdaniel/voxtral-small-24b-2507** model from Replicate to generate audio content from provided inputs. It handles API authentication, creates predictions, polls until completion, and outputs the final generated audio file.\n\n---\n\n## \u26a1 Section 1: Trigger & Authentication\n\n* **\ud83d\udd18 On clicking 'execute'** \u2192 Manually starts the workflow.\n* **\ud83d\udd11 Set API Key** \u2192 Stores your Replicate API key to authenticate requests.\n\n**Benefit:** Securely connects your workflow to Replicate\u2019s API and ensures only authorized requests are made.\n\n---\n\n## \ud83c\udf9b\ufe0f Section 2: Create Prediction\n\n* **\ud83c\udf10 Create Prediction** \u2192 Sends a request to Replicate\u2019s API with parameters like:\n\n  * **audio**: Input audio file (e.g., a reference sample).\n  * **max\\_new\\_tokens**: Maximum number of tokens to generate (controls audio length/complexity).\n\n**Benefit:** Starts the audio generation process with configurable input and settings.\n\n---\n\n## \u23f3 Section 3: Polling & Status Tracking\n\n* **\ud83c\udd94 Extract Prediction ID** \u2192 Captures the unique prediction ID and endpoint for polling.\n* **\u23f1\ufe0f Wait** \u2192 Pauses for 2 seconds before re-checking.\n* **\ud83d\udce1 Check Prediction Status** \u2192 Polls Replicate\u2019s API to see if the audio generation is done.\n* **\u2705 Check If Complete** \u2192\n\n  * If finished: moves forward to process results.\n  * If not: loops back to wait and check again.\n\n**Benefit:** Efficiently manages asynchronous audio generation, ensuring the workflow only proceeds when results are ready.\n\n---\n\n## \ud83c\udfa7 Section 4: Process Result\n\n* **\ud83d\udcdd Process Result** \u2192 Extracts and structures final output data:\n\n  * **status** (success or failure)\n  * **output** (raw response)\n  * **metrics** (generation statistics)\n  * **timestamps** (created and completed times)\n  * **audio\\_url** (final generated audio link)\n\n**Benefit:** Provides a clean, structured output that can be used in follow-up automations (e.g., sending audio to users, storing in a database, or sharing via email).\n\n---\n\n## \ud83d\udcca Workflow Overview\n\n| Section                     | Purpose                         | Key Nodes                                                               | Benefit                          |\n| --------------------------- | ------------------------------- | ----------------------------------------------------------------------- | -------------------------------- |\n| \u26a1 Trigger & Authentication  | Start workflow & authenticate   | Manual Trigger, Set API Key                                             | Secure execution                 |\n| \ud83c\udf9b\ufe0f Create Prediction       | Submit audio generation request | Create Prediction                                                       | Start model processing           |\n| \u23f3 Polling & Status Tracking | Monitor prediction progress     | Extract Prediction ID, Wait, Check Prediction Status, Check If Complete | Ensures reliable completion      |\n| \ud83c\udfa7 Process Result           | Format and deliver output       | Process Result                                                          | Clean audio result ready for use |\n\n---\n\n## \u2705 Final Benefits\n\n* \ud83d\udd12 Secure authentication with Replicate\n* \ud83c\udf9b\ufe0f Flexible audio generation using **voxtral-small-24b-2507**\n* \u23f3 Reliable polling until results are ready\n* \ud83c\udfa7 Clean and structured audio output\n\n---\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "9fba5d71-252a-4d19-91f1-0ffbab4f47ab",
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Check Prediction Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set API Key": {
      "main": [
        [
          {
            "node": "Create Prediction",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Complete": {
      "main": [
        [
          {
            "node": "Process Result",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Prediction": {
      "main": [
        [
          {
            "node": "Extract Prediction ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Prediction ID": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On clicking 'execute'": {
      "main": [
        [
          {
            "node": "Set API Key",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Prediction Status": {
      "main": [
        [
          {
            "node": "Check If Complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}