PostTTS cho n8n
Tự động hoá việc tạo âm thanh trong mọi workflow. Kết nối PostTTS với hơn 400 ứng dụng bằng node HTTP Request có sẵn của n8n — không cần code.
Tự động hoá không cần code · Chạy với n8n Cloud hoặc self-host · Hơn 400 connector
Bắt đầu nhanh
Lấy API key của bạn
Tạo tài khoản miễn phí và tạo API key trên trang Tích hợp. Sao chép key ptts_ — key chỉ hiển thị một lần.
Thêm node HTTP Request
Trong workflow n8n, thêm một node HTTP Request và trỏ tới POST /api/v1/posts/convert với key trong Bearer header.
Nối với ứng dụng bất kỳ
Nối output với bất kỳ node nào trong hơn 400 node của n8n — RSS, Gmail, Slack, Webhook, Google Sheets, Airtable, S3, Discord và nhiều hơn nữa.
Vì sao chọn n8n?
Một lớp HTTP mỏng mở khoá mọi connector của n8n cho PostTTS.
Self-host hoặc Cloud
Mã nguồn mở, miễn phí tự host, hoặc dùng n8n Cloud nếu muốn bản có quản lý sẵn.
Không cần node tuỳ chỉnh
Dùng node HTTP Request có sẵn của n8n. Không phải cài gì, không phải bảo trì gì.
Hơn 400 connector
Kết nối PostTTS với Slack, Gmail, Google Sheets, Airtable, S3, Discord và nhiều hơn nữa.
Các mẫu workflow phổ biến
Sao chép JSON của mẫu và dán lên canvas n8n — không cần cài đặt thủ công.
RSS → PostTTS → Podcast hosting
Mỗi mục RSS mới tự động trở thành tập podcast.
{
"nodes": [
{
"parameters": {
"url": "https://example.com/feed.xml",
"options": {}
},
"id": "rss-trigger",
"name": "RSS Feed Read",
"type": "n8n-nodes-base.rssFeedRead",
"typeVersion": 1,
"position": [240, 300]
},
{
"parameters": {
"method": "POST",
"url": "https://posttts.com/api/v1/posts/convert",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"site_id\": \"site_01HX...\",\n \"url\": \"{{ $json.link }}\",\n \"voice\": \"woman\"\n}",
"options": {}
},
"id": "posttts-convert",
"name": "PostTTS Convert",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [460, 300]
}
],
"connections": {
"RSS Feed Read": {
"main": [[{ "node": "PostTTS Convert", "type": "main", "index": 0 }]]
}
}
} Webhook → PostTTS → Email
Thông báo người đăng ký ngay khi âm thanh sẵn sàng.
{
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "posttts-convert",
"options": {}
},
"id": "webhook-trigger",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [240, 300]
},
{
"parameters": {
"method": "POST",
"url": "https://posttts.com/api/v1/posts/convert",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"site_id\": \"site_01HX...\",\n \"url\": \"{{ $json.body.url }}\",\n \"voice\": \"woman\"\n}",
"options": {}
},
"id": "posttts-convert",
"name": "PostTTS Convert",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [460, 300]
},
{
"parameters": {
"sendTo": "subscriber@example.com",
"subject": "Your audio is ready",
"message": "=Listen here: {{ $json.audio_url }}",
"options": {}
},
"id": "gmail-send",
"name": "Send Gmail",
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.1,
"position": [680, 300]
}
],
"connections": {
"Webhook": {
"main": [[{ "node": "PostTTS Convert", "type": "main", "index": 0 }]]
},
"PostTTS Convert": {
"main": [[{ "node": "Send Gmail", "type": "main", "index": 0 }]]
}
}
} Google Sheets → PostTTS → Storage
Chuyển đổi hàng loạt danh sách URL theo yêu cầu.
{
"nodes": [
{
"parameters": {
"documentId": "YOUR_GOOGLE_SHEET_ID",
"sheetName": "Sheet1",
"options": {}
},
"id": "sheets-read",
"name": "Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.2,
"position": [240, 300]
},
{
"parameters": {
"method": "POST",
"url": "https://posttts.com/api/v1/posts/convert",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"site_id\": \"site_01HX...\",\n \"url\": \"{{ $json.url }}\",\n \"voice\": \"woman\"\n}",
"options": {}
},
"id": "posttts-convert",
"name": "PostTTS Convert",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [460, 300]
}
],
"connections": {
"Google Sheets": {
"main": [[{ "node": "PostTTS Convert", "type": "main", "index": 0 }]]
}
}
} Schedule → PostTTS → Slack
Đăng bản tóm tắt âm thanh hàng ngày lên kênh nhóm.
{
"nodes": [
{
"parameters": {
"rule": {
"interval": [{ "field": "days", "daysInterval": 1, "triggerAtHour": 9 }]
}
},
"id": "schedule-trigger",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [240, 300]
},
{
"parameters": {
"method": "POST",
"url": "https://posttts.com/api/v1/posts/convert",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"site_id\": \"site_01HX...\",\n \"url\": \"https://yourblog.com/daily-digest\",\n \"voice\": \"woman\"\n}",
"options": {}
},
"id": "posttts-convert",
"name": "PostTTS Convert",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [460, 300]
},
{
"parameters": {
"channel": "#general",
"text": "=Today's audio: {{ $json.audio_url }}",
"otherOptions": {}
},
"id": "slack-send",
"name": "Send Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.2,
"position": [680, 300]
}
],
"connections": {
"Schedule Trigger": {
"main": [[{ "node": "PostTTS Convert", "type": "main", "index": 0 }]]
},
"PostTTS Convert": {
"main": [[{ "node": "Send Slack", "type": "main", "index": 0 }]]
}
}
} Cách import
Trong n8n: sao chép JSON ở trên, mở một workflow mới hoặc có sẵn, rồi dán (Cmd/Ctrl + V) trực tiếp lên canvas. Các node và kết nối sẽ xuất hiện ngay. Cấu hình credential Header Auth (Name: Authorization, Value: Bearer ptts_...) trên node PostTTS Convert và thay site_id của bạn vào.
Cấu hình node HTTP Request
Điền các trường này trong node HTTP Request của n8n để gọi PostTTS.
| Trường | Giá trị |
|---|---|
| Method | POST |
| URL | https://posttts.com/api/v1/posts/convert |
| Authentication | Generic Credential Type → Header Auth |
| Header Name | Authorization |
| Header Value | Bearer ptts_xxxxxxxxxxxxxxxxxxxxxxxx |
| Body Content Type | JSON |
| Specify Body | Using JSON (see example below) |
Ví dụ request body
Dán nội dung này vào trường JSON của node HTTP Request.
{
"site_id": "site_01HX...",
"url": "{{ $json.url }}",
"voice": "woman"
} Dùng biểu thức n8n như {{ $json.url }} để ánh xạ dữ liệu từ node phía trước vào request.
Polling cho chuyển đổi bất đồng bộ
Với bài dài, POST ban đầu trả về 202 Accepted. Dựng một vòng lặp poll nhỏ trong n8n.
- 1Lưu
idtừ phản hồi POST vào một node Set. - 2Thêm node Wait (5 giây là khởi đầu hợp lý).
- 3Thêm node HTTP Request: GET
/api/v1/posts/{id}/audio. - 4Thêm node IF kiểm tra
status === "ready". Nếu đúng, tiếp tục; nếu sai, quay lại node Wait.
Cấu trúc phản hồi poll
{
"id": "post_01HX...",
"status": "ready",
"audio_url": "https://cdn.posttts.com/audio/post_01HX.m4a",
"voice": "woman",
"duration_seconds": 184
} Workflow bất đồng bộ và webhook
Với bài dài, POST ban đầu trả về 202 Accepted. Hai workflow sau xử lý việc chờ hoàn tất — qua webhook callback hoặc vòng lặp poll.
Bài dài: chuyển đổi + thông báo webhook
Gửi bài dài, rồi nhận webhook article.processing.completed khi âm thanh sẵn sàng. Payload webhook chứa audio_url đã ký trong data.object.audio_url. Đăng ký URL webhook của n8n trong bảng điều khiển PostTTS.
{
"nodes": [
{
"parameters": {
"method": "POST",
"url": "https://posttts.com/api/v1/posts/convert",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"site_id\": \"site_01HX...\",\n \"url\": \"{{ $json.url }}\",\n \"text\": \"{{ $json.text }}\",\n \"voice\": \"woman\"\n}",
"options": {}
},
"id": "posttts-convert",
"name": "PostTTS Convert",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [240, 300]
},
{
"parameters": {
"httpMethod": "POST",
"path": "posttts-ready",
"options": {}
},
"id": "webhook-wait",
"name": "Wait for Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [460, 300]
},
{
"parameters": {
"channel": "#content",
"text": "=Audio ready for {{ $json.body.data.object.title }}: {{ $json.body.data.object.audio_url }}",
"otherOptions": {}
},
"id": "slack-notify",
"name": "Slack Notify",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.2,
"position": [680, 300]
}
],
"connections": {
"PostTTS Convert": {
"main": [[{ "node": "Wait for Webhook", "type": "main", "index": 0 }]]
},
"Wait for Webhook": {
"main": [[{ "node": "Slack Notify", "type": "main", "index": 0 }]]
}
}
} Bất đồng bộ qua poll
Gửi bài dài, chờ 5 giây, rồi poll GET /api/v1/posts/:id/audio cho đến khi status === "ready". Node IF quay lại Wait nếu chưa sẵn sàng, thoát khi đã xong.
{
"nodes": [
{
"parameters": {
"method": "POST",
"url": "https://posttts.com/api/v1/posts/convert",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"site_id\": \"site_01HX...\",\n \"url\": \"{{ $json.url }}\",\n \"text\": \"{{ $json.text }}\",\n \"voice\": \"woman\"\n}",
"options": {}
},
"id": "posttts-convert",
"name": "PostTTS Convert",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [240, 300]
},
{
"parameters": { "unit": "seconds", "value": 5 },
"id": "wait-node",
"name": "Wait",
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [460, 300]
},
{
"parameters": {
"method": "GET",
"url": "=https://posttts.com/api/v1/posts/{{ $('PostTTS Convert').item.json.id }}/audio",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"options": {}
},
"id": "poll-status",
"name": "Check Status",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [680, 300]
},
{
"parameters": {
"conditions": {
"options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict" },
"conditions": [{ "id": "ready-check", "leftValue": "={{ $json.status }}", "rightValue": "ready", "operator": { "type": "string", "operation": "equals" } }],
"combinator": "and"
}
},
"id": "if-ready",
"name": "Is Ready?",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [900, 300]
}
],
"connections": {
"PostTTS Convert": {
"main": [[{ "node": "Wait", "type": "main", "index": 0 }]]
},
"Wait": {
"main": [[{ "node": "Check Status", "type": "main", "index": 0 }]]
},
"Check Status": {
"main": [[{ "node": "Is Ready?", "type": "main", "index": 0 }]]
},
"Is Ready?": {
"main": [
[],
[{ "node": "Wait", "type": "main", "index": 0 }]
]
}
}
} Mẹo bảo mật
Lưu key ptts_ trong panel Credentials của n8n (loại Header Auth) — đừng dán trực tiếp vào tham số node, vì nó sẽ lộ khi export workflow.
Dùng biến môi trường của n8n (hoặc node Set ở đầu workflow) cho site_id. Như vậy, chuyển đổi giữa workflow dev và prod chỉ cần đổi một dòng.
Câu hỏi thường gặp
Không. Node HTTP Request có sẵn lo mọi thứ — POST để chuyển đổi, GET để poll, DELETE để dọn dẹp. Bạn không phải cài gì thêm và không có package nào phải cập nhật.
Có, giống hệt nhau. Các node HTTP Request, Credentials, Wait, IF và Set đều nằm trong core của n8n. Dù bạn chạy n8n theo cách nào, workflow vẫn như nhau.
Tạo một Credential mới loại "Header Auth" trong n8n: Name = Authorization, Value = Bearer ptts_... Rồi tham chiếu credential đó trong node HTTP Request. Key được mã hoá khi lưu và không xuất hiện trong JSON workflow khi export.
Thêm node RSS Feed Trigger ở đầu workflow, nối với node HTTP Request trỏ đến /api/v1/posts/convert, và ánh xạ $json.link (URL của mục RSS) vào trường "url" trong request body. Mỗi mục mới sẽ kích hoạt một lần chuyển đổi.
Tách thành hai workflow. Workflow A: POST chuyển đổi và lưu id trả về vào database hoặc queue. Workflow B: chạy theo Schedule, poll GET /api/v1/posts/:id/audio cho các id đang chờ và thực hiện bước thông báo khi status chuyển sang "ready".
Trong cài đặt node HTTP Request, bật "Continue On Fail" và thêm một node IF phía sau kiểm tra $json.error hoặc mã HTTP. Với lỗi 429 (rate limit), rẽ vào node Wait (5–30s) trước khi thử lại. n8n cũng hỗ trợ "Retry On Fail" ở cấp node.
Khám phá các tính năng liên quan
Tìm hiểu thêm những cách PostTTS giúp bạn thu hút khán giả
Xây dựng với API
REST API đầy đủ cho tích hợp tuỳ chỉnh.
Tìm hiểu thêmHiểu rõ người nghe
Hiểu cách khán giả tương tác với nội dung âm thanh.
Tìm hiểu thêmBiến âm thanh thành doanh thu
Tạo doanh thu từ nội dung âm thanh với hỗ trợ quảng cáo pre-roll và mid-roll.
Tìm hiểu thêmBắt đầu tự động hoá với PostTTS
Tạo tài khoản miễn phí, lấy API key và nối workflow n8n đầu tiên chỉ trong vài phút.
Tạo tài khoản miễn phíGói miễn phí gồm 10 bài viết/tháng · Không cần thẻ tín dụng