This workflow follows the HTTP Request → Stopanderror recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "YouTube Audio Extractor - Complete Workflow",
"nodes": [
{
"parameters": {
"values": {
"string": [
{
"name": "youtube_url",
"value": "https://www.youtube.com/shorts/N8tJFeMXrr8"
},
{
"name": "api_base_url",
"value": "http://your-ec2-ip:8000"
}
]
},
"options": {}
},
"name": "Set YouTube URL",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
240,
300
]
},
{
"parameters": {
"httpVersion": "v2",
"method": "POST",
"url": "={{ $json.api_base_url }}/extract-audio-info",
"authentication": "none",
"requestFormat": "json",
"jsonParameters": true,
"parametersJson": {
"url": "={{ $json.youtube_url }}",
"format": "mp3",
"quality": "192"
},
"options": {
"timeout": 30000,
"redirect": {
"redirect": {
"followRedirects": true,
"maxRedirects": 5
}
}
}
},
"name": "Get Video Info",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
460,
300
]
},
{
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{ $json.success }}",
"value2": true
}
]
}
},
"name": "Check if Video Info Success",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
680,
300
]
},
{
"parameters": {
"httpVersion": "v2",
"method": "POST",
"url": "={{ $('Set YouTube URL').item.json.api_base_url }}/extract-audio",
"authentication": "none",
"requestFormat": "json",
"responseFormat": "file",
"jsonParameters": true,
"parametersJson": {
"url": "={{ $('Set YouTube URL').item.json.youtube_url }}",
"format": "mp3",
"quality": "192",
"return_url": false
},
"options": {
"timeout": 120000,
"redirect": {
"redirect": {
"followRedirects": true,
"maxRedirects": 5
}
}
}
},
"name": "Extract Audio (Binary)",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
900,
200
]
},
{
"parameters": {
"httpVersion": "v2",
"method": "POST",
"url": "={{ $('Set YouTube URL').item.json.api_base_url }}/extract-audio",
"authentication": "none",
"requestFormat": "json",
"jsonParameters": true,
"parametersJson": {
"url": "={{ $('Set YouTube URL').item.json.youtube_url }}",
"format": "mp3",
"quality": "192",
"return_url": true
},
"options": {
"timeout": 120000,
"redirect": {
"redirect": {
"followRedirects": true,
"maxRedirects": 5
}
}
}
},
"name": "Extract Audio (URL)",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
900,
400
]
},
{
"parameters": {
"errorMessage": "Failed to get video info. Error: {{ $json.detail || 'Unknown error' }}"
},
"name": "Stop on Error",
"type": "n8n-nodes-base.stopAndError",
"typeVersion": 1,
"position": [
680,
500
]
},
{
"parameters": {
"values": {
"string": [
{
"name": "video_title",
"value": "={{ $('Get Video Info').item.json.title }}"
},
{
"name": "video_duration",
"value": "={{ $('Get Video Info').item.json.duration }}"
},
{
"name": "video_uploader",
"value": "={{ $('Get Video Info').item.json.uploader }}"
},
{
"name": "extraction_method",
"value": "={{ $('Get Video Info').item.json.extraction_method || 'standard' }}"
}
]
},
"options": {}
},
"name": "Process Video Info",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
1120,
200
]
},
{
"parameters": {
"httpVersion": "v2",
"method": "GET",
"url": "={{ $('Set YouTube URL').item.json.api_base_url }}{{ $json.download_url }}",
"authentication": "none",
"responseFormat": "file",
"options": {
"timeout": 60000
}
},
"name": "Download Audio File",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
1120,
400
]
},
{
"parameters": {
"values": {
"string": [
{
"name": "final_status",
"value": "Audio extraction completed successfully"
},
{
"name": "video_title",
"value": "={{ $('Get Video Info').item.json.title }}"
},
{
"name": "file_size_binary",
"value": "={{ $('Extract Audio (Binary)').item.binary.data ? 'Binary data available' : 'No binary data' }}"
},
{
"name": "download_url",
"value": "={{ $('Extract Audio (URL)').item.json.download_url || 'No URL available' }}"
}
]
},
"options": {}
},
"name": "Final Results",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
1340,
300
]
}
],
"connections": {
"Set YouTube URL": {
"main": [
[
{
"node": "Get Video Info",
"type": "main",
"index": 0
}
]
]
},
"Get Video Info": {
"main": [
[
{
"node": "Check if Video Info Success",
"type": "main",
"index": 0
}
]
]
},
"Check if Video Info Success": {
"main": [
[
{
"node": "Extract Audio (Binary)",
"type": "main",
"index": 0
},
{
"node": "Extract Audio (URL)",
"type": "main",
"index": 0
}
],
[
{
"node": "Stop on Error",
"type": "main",
"index": 0
}
]
]
},
"Extract Audio (Binary)": {
"main": [
[
{
"node": "Process Video Info",
"type": "main",
"index": 0
}
]
]
},
"Extract Audio (URL)": {
"main": [
[
{
"node": "Download Audio File",
"type": "main",
"index": 0
}
]
]
},
"Process Video Info": {
"main": [
[
{
"node": "Final Results",
"type": "main",
"index": 0
}
]
]
},
"Download Audio File": {
"main": [
[
{
"node": "Final Results",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "1",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "youtube-audio-extractor",
"tags": []
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
YouTube Audio Extractor - Complete Workflow. Uses httpRequest, stopAndError. Manual trigger; 9 nodes.
Source: https://github.com/0xabstracted/socialmedia-audio-extractor/blob/main/docs/integration/templates/n8n_workflow_template.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Youtube:Channel:get getAll update:Playlist:create update getAll get delete:PlaylistItem:add getAll get delete:videoCategory:getAll:Video:rate get upload update delete. Uses start, youTube, httpRequest
This workflow receives a webhook request, uses AtlasCloud (GPT Image 2 and HappyHorse) to turn a profile image into a short vertical video, then publishes the reel to TikTok and Instagram via Blotato.
Extracts a clean transcript from a videoId using youtube-transcript.io. AI summaries, sentiment analysis, keyword extraction Internal indexing/SEO Content pipelines (blog/newsletter) Batch transcript
Imagine you want to automate a task where, based on a TikTok video link, you must retrieve the username of the creator of that video.
YouTube Caption Extractor (Your Channel Only) Extracts clean transcripts from YOUR CHANNEL YouTube video captions using YouTube Data API v3.