AutomationFlowsAI & RAG › Generate AI Songs From Telegram Prompts with Openai and Suno

Generate AI Songs From Telegram Prompts with Openai and Suno

ByDr. Firas @drfiras on n8n.io

This workflow listens for Telegram messages containing a song idea, uses OpenAI to expand the idea into a Suno-ready prompt, submits a generation request to the Suno API, polls until the track is ready, and then sends the finished audio and details back to the user in Telegram.…

Event trigger★★★★☆ complexityAI-powered16 nodesTelegram TriggerTelegramAgentOpenAI ChatHTTP Request
AI & RAG Trigger: Event Nodes: 16 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #16900 — we link there as the canonical source.

This workflow follows the Agent → HTTP Request 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 →

Download .json
{
  "id": "7HpdYimtQ7mInouC",
  "meta": {
    "builderVariant": "mcp",
    "aiBuilderAssisted": true
  },
  "name": "Generate AI songs from Telegram prompts with Suno",
  "tags": [],
  "nodes": [
    {
      "id": "18335773-b193-48d7-9d63-d3a38264a189",
      "name": "Receive Song Idea on Telegram",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -320,
        224
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "40cae096-a0cd-4167-865e-27089ae1d574",
      "name": "Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -80,
        224
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cfg-song-prompt",
              "name": "song_prompt",
              "type": "string",
              "value": "={{ $('Receive Song Idea on Telegram').item.json.message.text }}"
            },
            {
              "id": "cfg-chat-id",
              "name": "telegram_chat_id",
              "type": "string",
              "value": "={{ $('Receive Song Idea on Telegram').item.json.message.chat.id }}"
            },
            {
              "id": "cfg-base-url",
              "name": "suno_base_url",
              "type": "string",
              "value": "https://api.sunoapi.org/api/v1"
            },
            {
              "id": "cfg-model",
              "name": "suno_model",
              "type": "string",
              "value": "V4_5"
            },
            {
              "id": "cfg-custom-mode",
              "name": "custom_mode",
              "type": "boolean",
              "value": false
            },
            {
              "id": "cfg-instrumental",
              "name": "make_instrumental",
              "type": "boolean",
              "value": false
            },
            {
              "id": "cfg-callback",
              "name": "suno_callback_url",
              "type": "string",
              "value": "https://webhook.site/your-unused-callback"
            },
            {
              "id": "cfg-poll",
              "name": "poll_interval_seconds",
              "type": "number",
              "value": 20
            },
            {
              "id": "cfg-style",
              "name": "style_preferences",
              "type": "string",
              "value": "modern, radio-ready, clear vocals"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "3b29bcab-2ce4-437f-8617-d1d3caf4a732",
      "name": "Acknowledge Request on Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        96,
        224
      ],
      "parameters": {
        "text": "Got your idea. I'm composing your song now. This usually takes 1 to 3 minutes.",
        "chatId": "={{ $('Configuration').item.json.telegram_chat_id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cbbd36c3-65e2-42c6-a0ec-026f44f3d65d",
      "name": "Enrich Prompt for Suno",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        352,
        224
      ],
      "parameters": {
        "text": "={{ $('Configuration').item.json.song_prompt }}",
        "options": {
          "systemMessage": "=You are a music prompt engineer for the Suno AI music generator. Turn the user's short idea into a single vivid, concise description (max 40 words) covering genre, mood, instrumentation and tempo. Take these style preferences into account: {{ $('Configuration').item.json.style_preferences }}. Output ONLY the final prompt text, with no quotes, labels or explanations."
        },
        "promptType": "define"
      },
      "typeVersion": 3.1
    },
    {
      "id": "359397c2-ef4e-4375-b8aa-a86cbe4472bd",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        352,
        448
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "gpt-4.1-mini"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "3063bde1-0860-45ee-844f-48ea04773c56",
      "name": "Suno: Submit Song Generation",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        624,
        224
      ],
      "parameters": {
        "url": "={{ $('Configuration').item.json.suno_base_url }}/generate",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ JSON.stringify({ prompt: $('Enrich Prompt for Suno').item.json.output, customMode: $('Configuration').item.json.custom_mode, instrumental: $('Configuration').item.json.make_instrumental, model: $('Configuration').item.json.suno_model, callBackUrl: $('Configuration').item.json.suno_callback_url }) }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "c9b24b85-9a91-40a7-aca8-093a7e53fb5d",
      "name": "Wait for Generation",
      "type": "n8n-nodes-base.wait",
      "position": [
        768,
        224
      ],
      "parameters": {
        "amount": "={{ $('Configuration').item.json.poll_interval_seconds }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "e7271097-0c34-4330-9f03-03e78518b6e4",
      "name": "Suno: Get Song Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        912,
        224
      ],
      "parameters": {
        "url": "={{ $('Configuration').item.json.suno_base_url }}/generate/record-info?taskId={{ $('Suno: Submit Song Generation').item.json.data.taskId }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "5e90109d-7d0c-4094-91a8-37c9d7a7125f",
      "name": "Is Song Ready?",
      "type": "n8n-nodes-base.if",
      "position": [
        1040,
        224
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.data.status }}",
              "rightValue": "SUCCESS"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "53c10c66-c4c4-4611-b45d-33585e759e3e",
      "name": "Send Song Audio on Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1216,
        176
      ],
      "parameters": {
        "file": "={{ $('Suno: Get Song Status').item.json.data.response.sunoData[0].audioUrl }}",
        "chatId": "={{ $('Configuration').item.json.telegram_chat_id }}",
        "operation": "sendAudio",
        "additionalFields": {
          "title": "={{ $('Suno: Get Song Status').item.json.data.response.sunoData[0].title }}",
          "caption": "={{ $('Suno: Get Song Status').item.json.data.response.sunoData[0].title }}",
          "performer": "Suno AI"
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f4e41067-4001-42d1-825d-8ff271d56e24",
      "name": "Send Completion Message on Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1344,
        288
      ],
      "parameters": {
        "text": "=Your song {{ $('Suno: Get Song Status').item.json.data.response.sunoData[0].title }} is ready. Duration: {{ Math.round($('Suno: Get Song Status').item.json.data.response.sunoData[0].duration) }}s. Enjoy.",
        "chatId": "={{ $('Configuration').item.json.telegram_chat_id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9b171a26-c121-47bf-ae75-12ec82805818",
      "name": "Sticky Note a9702544",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        0
      ],
      "parameters": {
        "width": 520,
        "height": 1072,
        "content": "# Generate AI songs from Telegram prompts with Suno\n\n# \ud83d\udce5 [Open full documentation on Notion](https://automatisation.notion.site/Course-support-Generate-AI-songs-from-Telegram-prompts-with-Suno-3963d6550fd981ed9082ee9df600f442)\n\nSend a text idea to your Telegram bot and get back a finished, AI-generated song, all inside n8n.\n\n## How it works\n1. You message your Telegram bot with a song idea.\n2. The Configuration node centralises every adjustable setting.\n3. An AI Agent turns your short idea into a richer prompt tuned for Suno.\n4. The workflow submits the job to the Suno API, then waits and polls until the song is ready.\n5. The finished audio is sent straight back to you on Telegram, followed by a short recap message.\n\n## Setup\n1. Select your Telegram credential on the trigger and the three Telegram nodes.\n2. Select your OpenAI credential on the OpenAI Chat Model node.\n3. Create an HTTP Header Auth credential (Name: Authorization, Value: Bearer YOUR_SUNO_KEY) and select it on both Suno HTTP nodes.\n4. Open Configuration and set your defaults (model, poll interval, callback URL).\n\n## Requirements\n- An n8n instance (Cloud or self-hosted).\n- A Telegram bot token.\n- An OpenAI API key.\n- A Suno API key from a Suno-compatible REST provider (targets the api.sunoapi.org response shape).\n\n## Customization\n- Change the Suno model or toggle custom_mode / make_instrumental in Configuration.\n- Adjust poll_interval_seconds if generation is slow.\n- Edit the AI Agent system prompt to steer the musical style."
      },
      "typeVersion": 1
    },
    {
      "id": "f027773c-2ab0-4e11-b869-4f047224342a",
      "name": "Sticky Note 4a76c227",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        16
      ],
      "parameters": {
        "color": 7,
        "width": 740,
        "height": 408,
        "content": "## 1. Telegram input\nThe user sends a song idea. Configuration centralises every adjustable setting, then the bot acknowledges the request."
      },
      "typeVersion": 1
    },
    {
      "id": "48fbe767-6376-498d-9a56-f3b8ef35d436",
      "name": "Sticky Note 6aafcb58",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        16
      ],
      "parameters": {
        "color": 7,
        "width": 300,
        "height": 420,
        "content": "## 2. AI prompt enrichment\nAn AI Agent expands the short idea into a richer, Suno-ready prompt."
      },
      "typeVersion": 1
    },
    {
      "id": "94e43887-5f78-4fb8-add4-84492dc8837a",
      "name": "Sticky Note 3a7358fe",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        608,
        16
      ],
      "parameters": {
        "color": 7,
        "width": 560,
        "height": 424,
        "content": "## 3. Suno generation and polling\nSubmit the job to Suno, then wait and poll until the status is SUCCESS. After import, manually select the Suno API credential on both HTTP nodes."
      },
      "typeVersion": 1
    },
    {
      "id": "34e0cad8-a59b-4297-bf7a-09cc4721703d",
      "name": "Sticky Note f15674fe",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        16
      ],
      "parameters": {
        "color": 7,
        "width": 300,
        "height": 428,
        "content": "## 4. Deliver on Telegram\nSend the finished audio back to the user, then a short recap message."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": true,
    "executionOrder": "v1"
  },
  "versionId": "9f3a60a5-4e90-413a-a263-d6e35770a2be",
  "nodeGroups": [],
  "connections": {
    "Configuration": {
      "main": [
        [
          {
            "node": "Acknowledge Request on Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Song Ready?": {
      "main": [
        [
          {
            "node": "Send Song Audio on Telegram",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait for Generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Enrich Prompt for Suno",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Generation": {
      "main": [
        [
          {
            "node": "Suno: Get Song Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Suno: Get Song Status": {
      "main": [
        [
          {
            "node": "Is Song Ready?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich Prompt for Suno": {
      "main": [
        [
          {
            "node": "Suno: Submit Song Generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Song Audio on Telegram": {
      "main": [
        [
          {
            "node": "Send Completion Message on Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Suno: Submit Song Generation": {
      "main": [
        [
          {
            "node": "Wait for Generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Song Idea on Telegram": {
      "main": [
        [
          {
            "node": "Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Acknowledge Request on Telegram": {
      "main": [
        [
          {
            "node": "Enrich Prompt for Suno",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow listens for Telegram messages containing a song idea, uses OpenAI to expand the idea into a Suno-ready prompt, submits a generation request to the Suno API, polls until the track is ready, and then sends the finished audio and details back to the user in Telegram.…

Source: https://n8n.io/workflows/16900/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Generate AI viral videos with NanoBanana & VEO3, shared on socials via Blotato 2. Uses @blotato/n8n-nodes-blotato, googleSheets, lmChatOpenAi, toolThink. Event-driven trigger; 94 nodes.

@Blotato/N8N Nodes Blotato, Google Sheets, OpenAI Chat +9
AI & RAG

RAG CHATBOT Main. Uses telegram, telegramTrigger, lmChatOpenAi, n8n-nodes-mcp. Event-driven trigger; 87 nodes.

Telegram, Telegram Trigger, OpenAI Chat +8
AI & RAG

Bitlab-Chatbot. Uses telegramTrigger, telegram, snowflake, httpRequest. Event-driven trigger; 87 nodes.

Telegram Trigger, Telegram, Snowflake +13
AI & RAG

Digital marketers, content creators, social media managers, and businesses who want to use AI marketing automation for YouTube Shorts without spending hours on production. This AI workflow helps anyon

OpenAI, HTTP Request, OpenAI Chat +7
AI & RAG

Transform your salon/service business with this streamlined Telegram automation system featuring Claude integration, zero-setup database management, and intelligent conversation handling. Claude MCP I

Redis, Agent Tool, Google Calendar +10