MusicLounge1 / n8n_workflow_example.json
Productive Pod
c1.
a24acdc
Raw History Blame Contribute Delete
5.95 kB
{
"name": "Hindi Karaoke Generator Workflow",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "karaoke-webhook",
"responseMode": "responseNode",
"options": {}
},
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
250,
300
]
},
{
"parameters": {
"url": "https://your-space.hf.space/generate",
"authentication": "none",
"requestMethod": "POST",
"jsonParameters": true,
"bodyParametersJson": "={\n \"audio_url\": \"{{ $json.body.audio_url }}\",\n \"start_time\": \"{{ $json.body.start_time || '00:00:00' }}\",\n \"duration\": {{ $json.body.duration || 30 }},\n \"font_color\": \"{{ $json.body.font_color || '&HFFFFFF&' }}\",\n \"lyrics_mode\": \"{{ $json.body.lyrics_mode || 'both' }}\",\n \"lrc_content\": \"{{ $json.body.lrc_content }}\"\n}",
"options": {}
},
"name": "Generate Karaoke",
"type": "n8n-nodes-base.httpRequest",
"position": [
450,
300
]
},
{
"parameters": {
"amount": 180,
"unit": "seconds"
},
"name": "Wait 3 Minutes",
"type": "n8n-nodes-base.wait",
"position": [
650,
300
]
},
{
"parameters": {
"url": "=https://your-space.hf.space/status/{{ $json.job_id }}",
"authentication": "none",
"requestMethod": "GET",
"options": {}
},
"name": "Check Status",
"type": "n8n-nodes-base.httpRequest",
"position": [
850,
300
]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json.status }}",
"operation": "equals",
"value2": "completed"
}
]
}
},
"name": "If Completed",
"type": "n8n-nodes-base.if",
"position": [
1050,
300
]
},
{
"parameters": {
"url": "=https://your-space.hf.space/download/{{ $json.job_id }}",
"authentication": "none",
"requestMethod": "GET",
"responseFormat": "file",
"options": {}
},
"name": "Download Video",
"type": "n8n-nodes-base.httpRequest",
"position": [
1250,
200
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={\n \"success\": true,\n \"job_id\": \"{{ $json.job_id }}\",\n \"message\": \"Karaoke video generated successfully\",\n \"download_url\": \"https://your-space.hf.space/download/{{ $json.job_id }}\"\n}"
},
"name": "Success Response",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
1450,
200
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={\n \"success\": false,\n \"error\": \"{{ $json.error || 'Processing failed or timed out' }}\"\n}",
"options": {
"responseCode": 500
}
},
"name": "Error Response",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
1450,
400
]
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Generate Karaoke",
"type": "main",
"index": 0
}
]
]
},
"Generate Karaoke": {
"main": [
[
{
"node": "Wait 3 Minutes",
"type": "main",
"index": 0
}
]
]
},
"Wait 3 Minutes": {
"main": [
[
{
"node": "Check Status",
"type": "main",
"index": 0
}
]
]
},
"Check Status": {
"main": [
[
{
"node": "If Completed",
"type": "main",
"index": 0
}
]
]
},
"If Completed": {
"main": [
[
{
"node": "Download Video",
"type": "main",
"index": 0
}
],
[
{
"node": "Error Response",
"type": "main",
"index": 0
}
]
]
},
"Download Video": {
"main": [
[
{
"node": "Success Response",
"type": "main",
"index": 0
}
]
]
}
}
}