{
  "id": "6Yzmlp5xF6oHo1VW",
  "meta": {
    "instanceId": "workflow-718b2746",
    "versionId": "1.0.0",
    "createdAt": "2025-09-29T07:07:49.682683",
    "updatedAt": "2025-09-29T07:07:49.682730",
    "owner": "n8n-user",
    "license": "MIT",
    "category": "automation",
    "status": "active",
    "priority": "high",
    "environment": "production"
  },
  "name": "Text to Speech (OpenAI)",
  "tags": [
    "automation",
    "n8n",
    "production-ready",
    "excellent",
    "optimized"
  ],
  "nodes": [
    {
      "id": "938fedbd-e34c-40af-af2f-b9c669e1a6e9",
      "name": "When clicking \"Test workflow\"",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        380,
        380
      ],
      "parameters": {},
      "typeVersion": 1,
      "notes": "This manualTrigger node performs automated tasks as part of the workflow."
    },
    {
      "id": "1d59db5d-8fe6-4292-a221-a0d0194c6e0c",
      "name": "Set input text and TTS voice",
      "type": "n8n-nodes-base.set",
      "position": [
        760,
        380
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "{\n  \"input_text\": \"The quick brown fox jumped over the lazy dog.\",\n  \"voice\": \"alloy\"\n}\n"
      },
      "typeVersion": 3.2,
      "notes": "This set node performs automated tasks as part of the workflow."
    },
    {
      "id": "9d54de1d-59b7-4c1f-9e88-13572da5292c",
      "name": "Send HTTP Request to OpenAI's TTS Endpoint",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1120,
        380
      ],
      "parameters": {
        "url": "{{ $env.API_BASE_URL }}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "authentication": "{{ $credentials.predefinedCredentialType }}",
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "tts-1"
            },
            {
              "name": "input",
              "value": "={{ $json.input_text }}"
            },
            {
              "name": "voice",
              "value": "={{ $json.voice }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer $OPENAI_API_KEY"
            }
          ]
        },
        "nodeCredentialType": "YOUR_CREDENTIAL_HERE"
      },
      "credentials": {
        "openAiApi": {
          "id": "VokTSv2Eg5m5aDg7",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 4.1,
      "notes": "This httpRequest node performs automated tasks as part of the workflow."
    },
    {
      "id": "1ce72c9c-aa6f-4a18-9d5a-3971686a51ec",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        280,
        256
      ],
      "parameters": {
        "width": 273,
        "height": 339,
        "content": "## Workflow Trigger\nYou can replace this manual trigger with another trigger type as required by your use case."
      },
      "typeVersion": 1,
      "notes": "This stickyNote node performs automated tasks as part of the workflow."
    },
    {
      "id": "eb487535-5f36-465e-aeee-e9ff62373e53",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        660,
        257
      ],
      "parameters": {
        "width": 273,
        "height": 335,
        "content": "## Manually Set OpenAI TTS Configuration\n"
      },
      "typeVersion": 1,
      "notes": "This stickyNote node performs automated tasks as part of the workflow."
    },
    {
      "id": "36b380bd-0703-4b60-83cb-c4ad9265864d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1020,
        260
      ],
      "parameters": {
        "width": 302,
        "height": 335,
        "content": "## Send Request to OpenAI TTS API\n"
      },
      "typeVersion": 1,
      "notes": "This stickyNote node performs automated tasks as part of the workflow."
    },
    {
      "id": "ff35ff28-62b5-49c8-a657-795aa916b524",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        660,
        620
      ],
      "parameters": {
        "color": 4,
        "width": 273,
        "height": 278,
        "content": "### Configuration Options\n- \"input_text\" is the text you would like to be turned into speech, and can be replaced with a programmatic value for your use case. Bear in mind that the maximum number of tokens per API call is 4,000.\n\n- \"voice\" is the voice used by the TTS model. The default is alloy, other options can be found here: [OpenAI TTS Docs]({{ $env.WEBHOOK_URL }}"
      },
      "typeVersion": 1,
      "notes": "This stickyNote node performs automated tasks as part of the workflow."
    },
    {
      "id": "5f7ef80e-b5c8-41df-9411-525fafc2d910",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1020,
        620
      ],
      "parameters": {
        "color": 4,
        "width": 299,
        "height": 278,
        "content": "### Output\nThe output returned by OpenAI's TTS endpoint is a .mp3 audio file (binary).\n\n\n### Credentials\nTo use this workflow, you'll have to configure and provide a valid OpenAI credential.\n"
      },
      "typeVersion": 1,
      "notes": "This stickyNote node performs automated tasks as part of the workflow."
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": null,
    "timezone": "UTC",
    "executionTimeout": 3600,
    "maxExecutions": 1000,
    "retryOnFail": true,
    "retryCount": 3,
    "retryDelay": 1000
  },
  "versionId": "19d67805-e208-4f0e-af44-c304e66e8ce8",
  "connections": {
    "9d54de1d-59b7-4c1f-9e88-13572da5292c": {
      "main": [
        [
          {
            "node": "error-handler-9d54de1d-59b7-4c1f-9e88-13572da5292c",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-9d54de1d-59b7-4c1f-9e88-13572da5292c-d9688572",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-9d54de1d-59b7-4c1f-9e88-13572da5292c-3631fe5c",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-9d54de1d-59b7-4c1f-9e88-13572da5292c-90333760",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-9d54de1d-59b7-4c1f-9e88-13572da5292c-abab1f3d",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-9d54de1d-59b7-4c1f-9e88-13572da5292c-9442691f",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-9d54de1d-59b7-4c1f-9e88-13572da5292c-aaa46070",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-9d54de1d-59b7-4c1f-9e88-13572da5292c-bace023e",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error-handler-9d54de1d-59b7-4c1f-9e88-13572da5292c-4efb8450",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "description": "Automated workflow: Text to Speech (OpenAI). This workflow integrates 5 different services: stickyNote, httpRequest, set, stopAndError, manualTrigger. It contains 10 nodes and follows best practices for error handling and security.",
  "notes": "Excellent quality workflow: Text to Speech (OpenAI). This workflow has been optimized for production use with comprehensive error handling, security, and documentation."
}