{
  "name": "FreeTTS news bulletin (text to speech)",
  "nodes": [
    {
      "parameters": {
        "content": "## FreeTTS news bulletin\nMakes an MP3 from a script twice a day with the free FreeTTS API.\n\n**1. Add your key**\nOpen **FreeTTS: make the audio**. Under Credential, create a new **Header Auth** credential:\nName `x-api-key`, Value: your key from freetts.org/text-to-speech-for-n8n#key\n\n**2. Write the script**\nChange the text in **Write the script**, or put an RSS, Google Sheets or AI node in front of it.\n\n**3. Send the MP3 somewhere**\nAfter **Download the MP3** the file is in the binary field `data`. Add Google Drive, Dropbox, FTP, Telegram (Send Audio) or Send Email.\n\nPress **Test workflow** to try it now.",
        "height": 520,
        "width": 420,
        "color": 4
      },
      "id": "0b9d1a32-6c55-4b55-9a31-7f0a4c2d1e01",
      "name": "Start here",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -520,
        -200
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 6,18 * * *"
            }
          ]
        }
      },
      "id": "5f1e2c3a-8d47-4a1b-b0e2-91c4d7a8e202",
      "name": "Run twice a day",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {},
      "id": "9a7c1e44-2b6d-4f3e-8c15-3d2e6f9b0303",
      "name": "Test it now",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        200
      ]
    },
    {
      "parameters": {
        "mode": "manual",
        "assignments": {
          "assignments": [
            {
              "id": "c1a4e7b2-0f3d-4c8a-9e61-5b7d2a9c0404",
              "name": "text",
              "value": "Good evening. This is the six o'clock bulletin. The city council has approved a new cycle lane along the river, with work starting in the spring. Now the weather: light rain this evening, clearing overnight, with a low of eight degrees.",
              "type": "string"
            },
            {
              "id": "d2b5f8c3-1a4e-4d9b-8f72-6c8e3b0d0505",
              "name": "voice",
              "value": "en-GB-SoniaNeural",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "e3c6a9d4-2b5f-4e0c-9a83-7d9f4c1e0606",
      "name": "Write the script",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        240,
        100
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://freetts.org/api/v1/tts",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"text\": {{ JSON.stringify($json.text) }},\n  \"voice\": \"{{ $json.voice }}\"\n}",
        "options": {}
      },
      "id": "f4d7b0e5-3c6a-4f1d-8b94-8e0a5d2f0707",
      "name": "FreeTTS: make the audio",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        480,
        100
      ]
    },
    {
      "parameters": {
        "url": "={{ $json.audio_url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "id": "a5e8c1f6-4d7b-4a2e-9ca5-9f1b6e3a0808",
      "name": "Download the MP3",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        720,
        100
      ]
    }
  ],
  "connections": {
    "Run twice a day": {
      "main": [
        [
          {
            "node": "Write the script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Test it now": {
      "main": [
        [
          {
            "node": "Write the script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write the script": {
      "main": [
        [
          {
            "node": "FreeTTS: make the audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FreeTTS: make the audio": {
      "main": [
        [
          {
            "node": "Download the MP3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  }
}
