{ "kind": "open-flow-workflow", "version": 1, "name": "Telegram Voice Language Translator", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_79145ac9be0663a9": { "name": "Receive a Telegram message", "kind": "integration", "config": { "updates": { "kind": "value", "value": [ "message" ] }, "chatIds": { "kind": "value", "value": [] }, "userIds": { "kind": "value", "value": [] }, "dropPendingUpdates": { "kind": "value", "value": false } }, "definition": { "configInputs": [ { "description": "Only accept updates from these numeric Telegram chat IDs. Empty means every chat.", "jsonSchema": { "type": "array", "items": { "type": "string", "pattern": "^-?[0-9]{1,20}$" }, "maxItems": 100, "uniqueItems": true }, "nullable": false, "handle": "chatIds", "value": [] }, { "description": "Discard updates queued before the webhook is created or resumed.", "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "dropPendingUpdates", "value": true }, { "description": "Telegram update types that trigger a Run. Use * for the Telegram default set.", "jsonSchema": { "type": "array", "items": { "enum": [ "*", "message", "edited_message", "channel_post", "edited_channel_post", "business_connection", "business_message", "edited_business_message", "deleted_business_messages", "guest_message", "message_reaction", "message_reaction_count", "inline_query", "chosen_inline_result", "callback_query", "shipping_query", "pre_checkout_query", "purchased_paid_media", "poll", "poll_answer", "my_chat_member", "chat_member", "chat_join_request", "chat_boost", "removed_chat_boost", "managed_bot", "subscription" ] }, "minItems": 1, "uniqueItems": true }, "nullable": false, "handle": "updates" }, { "description": "Only accept updates from these numeric Telegram user IDs. Empty means every user.", "jsonSchema": { "type": "array", "items": { "type": "string", "pattern": "^[0-9]{1,20}$" }, "maxItems": 100, "uniqueItems": true }, "nullable": false, "handle": "userIds", "value": [] } ], "definitionVersion": 2, "description": "Triggers when the connected Telegram bot receives a selected update.", "displayName": "Bot Update", "key": "telegram.on_update", "name": "on_update", "outputs": [ { "jsonSchema": { "type": "object" }, "nullable": false, "handle": "body" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "deliveryId" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "event" } ], "provider": "telegram", "type": "integration", "endpoint": { "body": { "allowArray": false, "allowEmpty": false, "formats": [ "json" ] }, "methods": [ "POST" ], "successStatus": 200 } } }, "n_40cca74555af1b37": { "inputs": { "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_79145ac9be0663a9", "output": "body" } ] }, "languageNative": { "kind": "value", "value": "english" }, "languageTranslate": { "kind": "value", "value": "french" } }, "name": "Prepare the voice translation", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object" }, "nullable": false, "handle": "body" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "languageNative" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "languageTranslate" } ], "outputs": [ { "jsonSchema": { "type": "string", "pattern": "^-?[0-9]+$" }, "nullable": false, "handle": "chatId" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "fileId" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "fileRequest" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "languageNative" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "languageTranslate" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "voiceMime" } ], "name": "Prepare the voice translation", "moduleId": "n_6120f854e7b67e1d", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_7a7faf45174b8772": { "inputs": {}, "name": "Identify the connected bot", "kind": "task", "task": { "inputs": [], "outputs": [ { "description": "The unique identifier of the user or bot.", "jsonSchema": { "type": "integer", "description": "The unique identifier of the user or bot." }, "nullable": false, "handle": "id" }, { "description": "Whether this account is a bot.", "jsonSchema": { "type": "boolean", "description": "Whether this account is a bot." }, "nullable": false, "handle": "isBot" }, { "description": "The first name of the user or bot.", "jsonSchema": { "type": "string", "description": "The first name of the user or bot." }, "nullable": false, "handle": "firstName" }, { "description": "The username of the user or bot.", "jsonSchema": { "type": "string", "description": "The username of the user or bot." }, "nullable": true, "handle": "username" }, { "description": "The IETF language tag of the user.", "jsonSchema": { "type": "string", "description": "The IETF language tag of the user." }, "nullable": true, "handle": "languageCode" }, { "description": "Whether the bot can be invited to groups.", "jsonSchema": { "type": "boolean", "description": "Whether the bot can be invited to groups." }, "nullable": true, "handle": "canJoinGroups" }, { "description": "Whether privacy mode is disabled for the bot.", "jsonSchema": { "type": "boolean", "description": "Whether privacy mode is disabled for the bot." }, "nullable": true, "handle": "canReadAllGroupMessages" }, { "description": "Whether the bot supports inline queries.", "jsonSchema": { "type": "boolean", "description": "Whether the bot supports inline queries." }, "nullable": true, "handle": "supportsInlineQueries" }, { "description": "Whether the bot can be connected to a Telegram Business account.", "jsonSchema": { "type": "boolean", "description": "Whether the bot can be connected to a Telegram Business account." }, "nullable": true, "handle": "canConnectToBusiness" }, { "description": "Whether the bot has a main Web App configured.", "jsonSchema": { "type": "boolean", "description": "Whether the bot has a main Web App configured." }, "nullable": true, "handle": "hasMainWebApp" } ], "name": "Identify the connected bot", "executor": { "kind": "connector", "action": "telegram.get_me" } } }, "n_c12ff9fc95062668": { "inputs": { "botToken": { "kind": "unset" }, "providerBotId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_7a7faf45174b8772", "output": "id" } ] }, "providerIsBot": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_7a7faf45174b8772", "output": "isBot" } ] } }, "name": "Verify the audio token matches", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "botToken" }, { "jsonSchema": { "type": "integer", "description": "The unique identifier of the user or bot." }, "nullable": false, "handle": "providerBotId" }, { "jsonSchema": { "type": "boolean", "description": "Whether this account is a bot." }, "nullable": false, "handle": "providerIsBot" } ], "outputs": [ { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "verified" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "botId" } ], "name": "Verify the audio token matches", "moduleId": "n_7d59af82e364ab74", "capabilities": [ { "kind": "http", "hosts": [ "api.telegram.org" ] } ] } }, "n_5145f02179d089a7": { "inputs": { "endpoint": { "kind": "value", "value": "/getFile" }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_40cca74555af1b37", "output": "fileRequest" } ] } }, "name": "Get the original voice file path", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "endpoint" }, { "jsonSchema": {}, "nullable": true, "handle": "body" } ], "outputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" }, { "jsonSchema": { "const": "base64" }, "nullable": true, "handle": "bodyEncoding" } ], "name": "Get the original voice file path", "executor": { "providerId": "telegram", "method": "POST", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "json", "kind": "connector-proxy" } } }, "n_1be341e41810648f": { "inputs": { "botToken": { "kind": "unset" }, "verified": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_c12ff9fc95062668", "output": "verified" } ] }, "reply": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5145f02179d089a7", "output": "body" } ] }, "statusCode": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5145f02179d089a7", "output": "statusCode" } ] }, "fileId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_40cca74555af1b37", "output": "fileId" } ] }, "voiceMime": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_40cca74555af1b37", "output": "voiceMime" } ] } }, "name": "Download the complete voice bytes", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "botToken" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "verified" }, { "jsonSchema": {}, "nullable": true, "handle": "reply" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "fileId" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "voiceMime" } ], "outputs": [ { "jsonSchema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "description": "The filename to report when uploading the audio file." }, "mimetype": { "type": "string", "description": "The MIME type of the audio file." }, "url": { "type": "string", "description": "A public URL pointing to the audio file." }, "content_base64": { "type": "string", "minLength": 1, "description": "The base64-encoded audio content to upload." } }, "required": [ "name" ], "additionalProperties": false, "description": "The audio file source to transcribe." }, "nullable": false, "handle": "file" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "audioBytes" } ], "name": "Download the complete voice bytes", "moduleId": "n_5cacb714c30c8f07", "capabilities": [ { "kind": "http", "hosts": [ "api.telegram.org" ] } ] } }, "n_c62fc0fc1b563dfc": { "inputs": { "file": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_1be341e41810648f", "output": "file" } ] }, "model": { "kind": "value", "value": "whisper-1" }, "response_format": { "kind": "value", "value": "json" } }, "name": "Transcribe the voice message", "kind": "task", "task": { "inputs": [ { "description": "The audio file source to transcribe.", "jsonSchema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "description": "The filename to report when uploading the audio file." }, "mimetype": { "type": "string", "description": "The MIME type of the audio file." }, "url": { "type": "string", "description": "A public URL pointing to the audio file." }, "content_base64": { "type": "string", "minLength": 1, "description": "The base64-encoded audio content to upload." } }, "required": [ "name" ], "additionalProperties": false, "description": "The audio file source to transcribe." }, "nullable": false, "handle": "file" }, { "description": "The transcription model to use.", "jsonSchema": { "type": "string", "description": "The transcription model to use." }, "nullable": false, "handle": "model" }, { "description": "The chunking strategy configuration accepted by the upstream API.", "jsonSchema": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "The chunking strategy configuration accepted by the upstream API." }, "nullable": true, "handle": "chunking_strategy", "value": null }, { "description": "Additional response fields to include.", "jsonSchema": { "type": "array", "items": { "type": "string", "description": "One additional response field to include." }, "minItems": 1, "description": "Additional response fields to include." }, "nullable": true, "handle": "include", "value": null }, { "description": "The language code of the source audio.", "jsonSchema": { "type": "string", "description": "The language code of the source audio." }, "nullable": true, "handle": "language", "value": null }, { "description": "A guiding prompt for the transcription.", "jsonSchema": { "type": "string", "description": "A guiding prompt for the transcription." }, "nullable": true, "handle": "prompt", "value": null }, { "description": "The response format to return.", "jsonSchema": { "type": "string", "description": "The response format to return." }, "nullable": true, "handle": "response_format", "value": null }, { "description": "Whether to request a streaming transcription response. This connector only accepts false or an omitted value.", "jsonSchema": { "type": "boolean", "description": "Whether to request a streaming transcription response. This connector only accepts false or an omitted value." }, "nullable": true, "handle": "stream", "value": null }, { "description": "The sampling temperature.", "jsonSchema": { "type": "number", "minimum": 0, "maximum": 1, "description": "The sampling temperature." }, "nullable": true, "handle": "temperature", "value": null }, { "description": "The timestamp granularities to include.", "jsonSchema": { "type": "array", "items": { "type": "string", "enum": [ "word", "segment" ], "description": "One timestamp granularity value." }, "minItems": 1, "description": "The timestamp granularities to include." }, "nullable": true, "handle": "timestamp_granularities", "value": null } ], "outputs": [ { "description": "The normalized payload returned by an OpenAI audio text endpoint.", "jsonSchema": { "type": "object", "properties": { "text": { "type": "string", "description": "The transcribed or translated text." }, "language": { "type": "string", "description": "The detected or returned language code." }, "duration": { "type": "number", "description": "The duration of the processed audio in seconds." }, "segments": { "type": "array", "items": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Any JSON object." }, "description": "The segment-level timing details." }, "words": { "type": "array", "items": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Any JSON object." }, "description": "The word-level timing details." }, "logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Any JSON object." }, "description": "The token log probabilities, if requested." }, "usage": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Usage details returned by the API." } }, "additionalProperties": true, "description": "The normalized payload returned by an OpenAI audio text endpoint." }, "nullable": false, "handle": "output" } ], "name": "Transcribe the voice message", "executor": { "kind": "connector", "action": "openai.create_audio_transcription", "outputMode": "value" } } }, "n_9cca2792cf299157": { "inputs": { "transcription": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_c62fc0fc1b563dfc", "output": "output" } ] }, "languageNative": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_40cca74555af1b37", "output": "languageNative" } ] }, "languageTranslate": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_40cca74555af1b37", "output": "languageTranslate" } ] } }, "name": "Apply the two language settings", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "text": { "type": "string", "description": "The transcribed or translated text." }, "language": { "type": "string", "description": "The detected or returned language code." }, "duration": { "type": "number", "description": "The duration of the processed audio in seconds." }, "segments": { "type": "array", "items": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Any JSON object." }, "description": "The segment-level timing details." }, "words": { "type": "array", "items": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Any JSON object." }, "description": "The word-level timing details." }, "logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Any JSON object." }, "description": "The token log probabilities, if requested." }, "usage": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Usage details returned by the API." } }, "additionalProperties": true, "description": "The normalized payload returned by an OpenAI audio text endpoint." }, "nullable": false, "handle": "transcription" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "languageNative" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "languageTranslate" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "transcription" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "prompt" } ], "name": "Apply the two language settings", "moduleId": "n_ac2195465c8c9f5d", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_4b2c0882486ea050": { "inputs": { "prompt": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_9cca2792cf299157", "output": "prompt" } ] } }, "name": "Detect and translate the language", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "prompt" } ], "outputs": [ { "description": "The final result produced by the Agent.", "jsonSchema": { "type": "string" }, "nullable": false, "handle": "output" } ], "name": "Detect and translate the language", "executor": { "kind": "agent", "code": false, "model": "gpt-5-mini", "prompt": "{{prompt}}", "maxRounds": 1, "tools": [] } } }, "n_3fc9f929a23dc10d": { "inputs": { "translation": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_4b2c0882486ea050", "output": "output" } ] } }, "name": "Keep the complete translated text", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "translation" } ], "outputs": [ { "jsonSchema": { "type": "string", "maxLength": 4096, "minLength": 1, "description": "The text of the message to send." }, "nullable": false, "handle": "translation" } ], "name": "Keep the complete translated text", "moduleId": "n_7d6d56071d680363", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_b2d69d7daeafbc0e": { "inputs": { "chatId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_40cca74555af1b37", "output": "chatId" } ] }, "text": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_3fc9f929a23dc10d", "output": "translation" } ] } }, "name": "Reply with the translation text", "kind": "task", "task": { "inputs": [ { "description": "The target Telegram chat ID or channel username.", "jsonSchema": { "anyOf": [ { "type": "integer", "description": "A numeric Telegram chat identifier." }, { "type": "string", "pattern": "^-?[0-9]+$", "description": "A numeric Telegram chat identifier encoded as a string." }, { "type": "string", "pattern": "^@[A-Za-z0-9_]+$", "description": "A Telegram @username that identifies a public chat or channel." } ], "description": "The target Telegram chat ID or channel username." }, "nullable": false, "handle": "chatId" }, { "description": "The text of the message to send.", "jsonSchema": { "type": "string", "maxLength": 4096, "minLength": 1, "description": "The text of the message to send." }, "nullable": false, "handle": "text" }, { "description": "The unique identifier of the Telegram business connection.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The unique identifier of the Telegram business connection." }, "nullable": true, "handle": "businessConnectionId", "value": null }, { "description": "The parse mode used for message entities.", "jsonSchema": { "type": "string", "enum": [ "Markdown", "MarkdownV2", "HTML" ], "description": "The parse mode used for message entities." }, "nullable": true, "handle": "parseMode", "value": null }, { "description": "Whether to send the message silently.", "jsonSchema": { "type": "boolean", "description": "Whether to send the message silently." }, "nullable": true, "handle": "disableNotification", "value": null }, { "description": "Whether to protect the sent message from forwarding and saving.", "jsonSchema": { "type": "boolean", "description": "Whether to protect the sent message from forwarding and saving." }, "nullable": true, "handle": "protectContent", "value": null }, { "description": "Whether to disable link previews in the message.", "jsonSchema": { "type": "boolean", "description": "Whether to disable link previews in the message." }, "nullable": true, "handle": "disableWebPagePreview", "value": null }, { "description": "The forum topic ID for the target message thread.", "jsonSchema": { "type": "integer", "exclusiveMinimum": 0, "description": "The forum topic ID for the target message thread." }, "nullable": true, "handle": "messageThreadId", "value": null }, { "description": "The message ID to reply to.", "jsonSchema": { "type": "integer", "exclusiveMinimum": 0, "description": "The message ID to reply to." }, "nullable": true, "handle": "replyToMessageId", "value": null } ], "outputs": [ { "description": "A normalized Telegram message record.", "jsonSchema": { "type": "object", "properties": { "messageId": { "type": "integer", "description": "The unique message identifier inside the chat." }, "date": { "type": "integer", "description": "The Unix timestamp when the message was sent." }, "chat": { "type": "object", "properties": { "id": { "type": "integer", "description": "The unique identifier of the chat." }, "type": { "type": "string", "description": "The chat type." }, "title": { "type": "string", "description": "The chat title." }, "username": { "type": "string", "description": "The public username of the chat." }, "firstName": { "type": "string", "description": "The first name for a private chat counterpart." }, "lastName": { "type": "string", "description": "The last name for a private chat counterpart." } }, "required": [ "id", "type" ], "additionalProperties": true, "description": "A Telegram chat record." }, "businessConnectionId": { "type": "string", "minLength": 1, "description": "The unique identifier of the Telegram business connection." }, "from": { "type": "object", "properties": { "id": { "type": "integer", "description": "The unique identifier of the user or bot." }, "isBot": { "type": "boolean", "description": "Whether the account is a bot." }, "firstName": { "type": "string", "description": "The first name of the user or bot." }, "username": { "type": "string", "description": "The username of the user or bot." } }, "required": [ "id", "isBot", "firstName" ], "additionalProperties": true, "description": "A Telegram user record." }, "senderChat": { "type": "object", "properties": { "id": { "type": "integer", "description": "The unique identifier of the chat." }, "type": { "type": "string", "description": "The chat type." }, "title": { "type": "string", "description": "The chat title." }, "username": { "type": "string", "description": "The public username of the chat." }, "firstName": { "type": "string", "description": "The first name for a private chat counterpart." }, "lastName": { "type": "string", "description": "The last name for a private chat counterpart." } }, "required": [ "id", "type" ], "additionalProperties": true, "description": "A Telegram chat record." }, "text": { "type": "string", "description": "The message text, when present." }, "caption": { "type": "string", "description": "The media caption, when present." }, "photo": { "type": "array", "items": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the photo." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the photo." }, "width": { "type": "integer", "description": "The photo width in pixels." }, "height": { "type": "integer", "description": "The photo height in pixels." }, "fileSize": { "type": "integer", "description": "The photo file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "width", "height" ], "additionalProperties": true, "description": "A Telegram photo or thumbnail size." }, "description": "The available sizes of the attached photo." }, "document": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the document." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the document." }, "fileName": { "type": "string", "description": "The original document filename." }, "mimeType": { "type": "string", "description": "The MIME type of the document." }, "fileSize": { "type": "integer", "description": "The document file size in bytes." } }, "required": [ "fileId", "fileUniqueId" ], "additionalProperties": true, "description": "A Telegram document file." }, "location": { "type": "object", "properties": { "latitude": { "type": "number", "description": "The latitude of the location." }, "longitude": { "type": "number", "description": "The longitude of the location." }, "horizontalAccuracy": { "type": "number", "description": "The radius of uncertainty in meters." }, "livePeriod": { "type": "integer", "description": "The live location update period in seconds." }, "heading": { "type": "integer", "description": "The direction of travel in degrees." }, "proximityAlertRadius": { "type": "integer", "description": "The proximity alert radius in meters." } }, "required": [ "latitude", "longitude" ], "additionalProperties": true, "description": "A Telegram geographic location." }, "poll": { "type": "object", "properties": { "id": { "type": "string", "description": "The unique poll identifier." }, "question": { "type": "string", "description": "The poll question." }, "options": { "type": "array", "items": { "type": "object", "properties": { "text": { "type": "string", "description": "The poll option text." }, "voterCount": { "type": "integer", "description": "The number of votes for the option." } }, "required": [ "text", "voterCount" ], "additionalProperties": true, "description": "A Telegram poll option." }, "description": "The available poll options." }, "totalVoterCount": { "type": "integer", "description": "The total number of poll voters." }, "isClosed": { "type": "boolean", "description": "Whether the poll is closed." }, "isAnonymous": { "type": "boolean", "description": "Whether the poll is anonymous." }, "type": { "type": "string", "enum": [ "regular", "quiz" ], "description": "The poll type." }, "allowsMultipleAnswers": { "type": "boolean", "description": "Whether the poll allows multiple answers." }, "closeDate": { "type": "integer", "description": "The Unix timestamp when the poll closes." }, "openPeriod": { "type": "integer", "description": "The number of seconds the poll remains open." }, "explanation": { "type": "string", "description": "The explanation shown for a quiz poll." }, "correctOptionId": { "type": "integer", "description": "The zero-based identifier of the correct quiz option." } }, "required": [ "id", "question", "options", "totalVoterCount", "isClosed", "isAnonymous", "type", "allowsMultipleAnswers" ], "additionalProperties": true, "description": "A Telegram poll." }, "entities": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true, "description": "A Telegram MessageEntity object." }, "description": "The entities parsed from the message text." }, "captionEntities": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true, "description": "A Telegram MessageEntity object." }, "description": "The entities parsed from the media caption." }, "forwardDate": { "type": "integer", "description": "The Unix timestamp of the original forwarded message." }, "forwardFrom": { "type": "object", "properties": { "id": { "type": "integer", "description": "The unique identifier of the user or bot." }, "isBot": { "type": "boolean", "description": "Whether the account is a bot." }, "firstName": { "type": "string", "description": "The first name of the user or bot." }, "username": { "type": "string", "description": "The username of the user or bot." } }, "required": [ "id", "isBot", "firstName" ], "additionalProperties": true, "description": "A Telegram user record." }, "forwardFromChat": { "type": "object", "properties": { "id": { "type": "integer", "description": "The unique identifier of the chat." }, "type": { "type": "string", "description": "The chat type." }, "title": { "type": "string", "description": "The chat title." }, "username": { "type": "string", "description": "The public username of the chat." }, "firstName": { "type": "string", "description": "The first name for a private chat counterpart." }, "lastName": { "type": "string", "description": "The last name for a private chat counterpart." } }, "required": [ "id", "type" ], "additionalProperties": true, "description": "A Telegram chat record." }, "forwardFromMessageId": { "type": "integer", "description": "The original message identifier inside the source chat." }, "forwardSignature": { "type": "string", "description": "The original author signature for a forwarded channel post." }, "forwardSenderName": { "type": "string", "description": "The display name of a forwarded sender who disallows linking." }, "linkPreviewOptions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "The link preview options attached to the message." }, "video": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the video." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the video." }, "width": { "type": "integer", "description": "The video width in pixels." }, "height": { "type": "integer", "description": "The video height in pixels." }, "duration": { "type": "integer", "description": "The video duration in seconds." }, "thumbnail": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the photo." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the photo." }, "width": { "type": "integer", "description": "The photo width in pixels." }, "height": { "type": "integer", "description": "The photo height in pixels." }, "fileSize": { "type": "integer", "description": "The photo file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "width", "height" ], "additionalProperties": true, "description": "A Telegram photo or thumbnail size." }, "cover": { "type": "array", "items": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the photo." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the photo." }, "width": { "type": "integer", "description": "The photo width in pixels." }, "height": { "type": "integer", "description": "The photo height in pixels." }, "fileSize": { "type": "integer", "description": "The photo file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "width", "height" ], "additionalProperties": true, "description": "A Telegram photo or thumbnail size." }, "description": "The available sizes of the video cover." }, "startTimestamp": { "type": "integer", "description": "The start timestamp for the video in the message." }, "qualities": { "type": "array", "items": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse this video quality." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of this video quality." }, "width": { "type": "integer", "description": "The video width in pixels." }, "height": { "type": "integer", "description": "The video height in pixels." }, "codec": { "type": "string", "description": "The codec used to encode the video." }, "fileSize": { "type": "integer", "description": "The video quality file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "width", "height", "codec" ], "additionalProperties": true, "description": "A Telegram video file at one available quality." }, "description": "The available encoded video qualities." }, "fileName": { "type": "string", "description": "The original video filename." }, "mimeType": { "type": "string", "description": "The MIME type of the video." }, "fileSize": { "type": "integer", "description": "The video file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "width", "height", "duration" ], "additionalProperties": true, "description": "A Telegram video file." }, "audio": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the audio." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the audio." }, "duration": { "type": "integer", "description": "The audio duration in seconds." }, "performer": { "type": "string", "description": "The performer of the audio." }, "title": { "type": "string", "description": "The audio track title." }, "fileName": { "type": "string", "description": "The original audio filename." }, "mimeType": { "type": "string", "description": "The MIME type of the audio." }, "fileSize": { "type": "integer", "description": "The audio file size in bytes." }, "thumbnail": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the photo." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the photo." }, "width": { "type": "integer", "description": "The photo width in pixels." }, "height": { "type": "integer", "description": "The photo height in pixels." }, "fileSize": { "type": "integer", "description": "The photo file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "width", "height" ], "additionalProperties": true, "description": "A Telegram photo or thumbnail size." } }, "required": [ "fileId", "fileUniqueId", "duration" ], "additionalProperties": true, "description": "A Telegram audio file." }, "voice": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the voice message." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the voice message." }, "duration": { "type": "integer", "description": "The voice message duration in seconds." }, "mimeType": { "type": "string", "description": "The MIME type of the voice message." }, "fileSize": { "type": "integer", "description": "The voice message file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "duration" ], "additionalProperties": true, "description": "A Telegram voice message file." }, "animation": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the animation." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the animation." }, "width": { "type": "integer", "description": "The animation width in pixels." }, "height": { "type": "integer", "description": "The animation height in pixels." }, "duration": { "type": "integer", "description": "The animation duration in seconds." }, "thumbnail": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the photo." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the photo." }, "width": { "type": "integer", "description": "The photo width in pixels." }, "height": { "type": "integer", "description": "The photo height in pixels." }, "fileSize": { "type": "integer", "description": "The photo file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "width", "height" ], "additionalProperties": true, "description": "A Telegram photo or thumbnail size." }, "fileName": { "type": "string", "description": "The original animation filename." }, "mimeType": { "type": "string", "description": "The MIME type of the animation." }, "fileSize": { "type": "integer", "description": "The animation file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "width", "height", "duration" ], "additionalProperties": true, "description": "A Telegram animation file." }, "contact": { "type": "object", "properties": { "phoneNumber": { "type": "string", "description": "The contact phone number." }, "firstName": { "type": "string", "description": "The contact first name." }, "lastName": { "type": "string", "description": "The contact last name." }, "userId": { "type": "integer", "description": "The Telegram user identifier associated with the contact." }, "vcard": { "type": "string", "description": "Additional contact data in vCard format." } }, "required": [ "phoneNumber", "firstName" ], "additionalProperties": true, "description": "A Telegram contact." }, "venue": { "type": "object", "properties": { "location": { "type": "object", "properties": { "latitude": { "type": "number", "description": "The latitude of the location." }, "longitude": { "type": "number", "description": "The longitude of the location." }, "horizontalAccuracy": { "type": "number", "description": "The radius of uncertainty in meters." }, "livePeriod": { "type": "integer", "description": "The live location update period in seconds." }, "heading": { "type": "integer", "description": "The direction of travel in degrees." }, "proximityAlertRadius": { "type": "integer", "description": "The proximity alert radius in meters." } }, "required": [ "latitude", "longitude" ], "additionalProperties": true, "description": "A Telegram geographic location." }, "title": { "type": "string", "description": "The venue name." }, "address": { "type": "string", "description": "The venue address." }, "foursquareId": { "type": "string", "description": "The Foursquare place identifier." }, "foursquareType": { "type": "string", "description": "The Foursquare place type." }, "googlePlaceId": { "type": "string", "description": "The Google Places identifier." }, "googlePlaceType": { "type": "string", "description": "The Google Places type." } }, "required": [ "location", "title", "address" ], "additionalProperties": true, "description": "A Telegram venue." }, "dice": { "type": "object", "properties": { "emoji": { "type": "string", "description": "The emoji used for the animation." }, "value": { "type": "integer", "description": "The generated dice value." } }, "required": [ "emoji", "value" ], "additionalProperties": true, "description": "A Telegram animated dice result." } }, "required": [ "messageId", "date", "chat" ], "additionalProperties": true, "description": "A normalized Telegram message record." }, "nullable": false, "handle": "output" } ], "name": "Reply with the translation text", "executor": { "kind": "connector", "action": "telegram.send_message", "outputMode": "value" } } }, "n_c159c067c10f8c87": { "inputs": { "message": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b2d69d7daeafbc0e", "output": "output" } ] }, "chatId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_40cca74555af1b37", "output": "chatId" } ] } }, "name": "Confirm the text reply", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "messageId": { "type": "integer", "description": "The unique message identifier inside the chat." }, "date": { "type": "integer", "description": "The Unix timestamp when the message was sent." }, "chat": { "type": "object", "properties": { "id": { "type": "integer", "description": "The unique identifier of the chat." }, "type": { "type": "string", "description": "The chat type." }, "title": { "type": "string", "description": "The chat title." }, "username": { "type": "string", "description": "The public username of the chat." }, "firstName": { "type": "string", "description": "The first name for a private chat counterpart." }, "lastName": { "type": "string", "description": "The last name for a private chat counterpart." } }, "required": [ "id", "type" ], "additionalProperties": true, "description": "A Telegram chat record." }, "businessConnectionId": { "type": "string", "minLength": 1, "description": "The unique identifier of the Telegram business connection." }, "from": { "type": "object", "properties": { "id": { "type": "integer", "description": "The unique identifier of the user or bot." }, "isBot": { "type": "boolean", "description": "Whether the account is a bot." }, "firstName": { "type": "string", "description": "The first name of the user or bot." }, "username": { "type": "string", "description": "The username of the user or bot." } }, "required": [ "id", "isBot", "firstName" ], "additionalProperties": true, "description": "A Telegram user record." }, "senderChat": { "type": "object", "properties": { "id": { "type": "integer", "description": "The unique identifier of the chat." }, "type": { "type": "string", "description": "The chat type." }, "title": { "type": "string", "description": "The chat title." }, "username": { "type": "string", "description": "The public username of the chat." }, "firstName": { "type": "string", "description": "The first name for a private chat counterpart." }, "lastName": { "type": "string", "description": "The last name for a private chat counterpart." } }, "required": [ "id", "type" ], "additionalProperties": true, "description": "A Telegram chat record." }, "text": { "type": "string", "description": "The message text, when present." }, "caption": { "type": "string", "description": "The media caption, when present." }, "photo": { "type": "array", "items": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the photo." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the photo." }, "width": { "type": "integer", "description": "The photo width in pixels." }, "height": { "type": "integer", "description": "The photo height in pixels." }, "fileSize": { "type": "integer", "description": "The photo file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "width", "height" ], "additionalProperties": true, "description": "A Telegram photo or thumbnail size." }, "description": "The available sizes of the attached photo." }, "document": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the document." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the document." }, "fileName": { "type": "string", "description": "The original document filename." }, "mimeType": { "type": "string", "description": "The MIME type of the document." }, "fileSize": { "type": "integer", "description": "The document file size in bytes." } }, "required": [ "fileId", "fileUniqueId" ], "additionalProperties": true, "description": "A Telegram document file." }, "location": { "type": "object", "properties": { "latitude": { "type": "number", "description": "The latitude of the location." }, "longitude": { "type": "number", "description": "The longitude of the location." }, "horizontalAccuracy": { "type": "number", "description": "The radius of uncertainty in meters." }, "livePeriod": { "type": "integer", "description": "The live location update period in seconds." }, "heading": { "type": "integer", "description": "The direction of travel in degrees." }, "proximityAlertRadius": { "type": "integer", "description": "The proximity alert radius in meters." } }, "required": [ "latitude", "longitude" ], "additionalProperties": true, "description": "A Telegram geographic location." }, "poll": { "type": "object", "properties": { "id": { "type": "string", "description": "The unique poll identifier." }, "question": { "type": "string", "description": "The poll question." }, "options": { "type": "array", "items": { "type": "object", "properties": { "text": { "type": "string", "description": "The poll option text." }, "voterCount": { "type": "integer", "description": "The number of votes for the option." } }, "required": [ "text", "voterCount" ], "additionalProperties": true, "description": "A Telegram poll option." }, "description": "The available poll options." }, "totalVoterCount": { "type": "integer", "description": "The total number of poll voters." }, "isClosed": { "type": "boolean", "description": "Whether the poll is closed." }, "isAnonymous": { "type": "boolean", "description": "Whether the poll is anonymous." }, "type": { "type": "string", "enum": [ "regular", "quiz" ], "description": "The poll type." }, "allowsMultipleAnswers": { "type": "boolean", "description": "Whether the poll allows multiple answers." }, "closeDate": { "type": "integer", "description": "The Unix timestamp when the poll closes." }, "openPeriod": { "type": "integer", "description": "The number of seconds the poll remains open." }, "explanation": { "type": "string", "description": "The explanation shown for a quiz poll." }, "correctOptionId": { "type": "integer", "description": "The zero-based identifier of the correct quiz option." } }, "required": [ "id", "question", "options", "totalVoterCount", "isClosed", "isAnonymous", "type", "allowsMultipleAnswers" ], "additionalProperties": true, "description": "A Telegram poll." }, "entities": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true, "description": "A Telegram MessageEntity object." }, "description": "The entities parsed from the message text." }, "captionEntities": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true, "description": "A Telegram MessageEntity object." }, "description": "The entities parsed from the media caption." }, "forwardDate": { "type": "integer", "description": "The Unix timestamp of the original forwarded message." }, "forwardFrom": { "type": "object", "properties": { "id": { "type": "integer", "description": "The unique identifier of the user or bot." }, "isBot": { "type": "boolean", "description": "Whether the account is a bot." }, "firstName": { "type": "string", "description": "The first name of the user or bot." }, "username": { "type": "string", "description": "The username of the user or bot." } }, "required": [ "id", "isBot", "firstName" ], "additionalProperties": true, "description": "A Telegram user record." }, "forwardFromChat": { "type": "object", "properties": { "id": { "type": "integer", "description": "The unique identifier of the chat." }, "type": { "type": "string", "description": "The chat type." }, "title": { "type": "string", "description": "The chat title." }, "username": { "type": "string", "description": "The public username of the chat." }, "firstName": { "type": "string", "description": "The first name for a private chat counterpart." }, "lastName": { "type": "string", "description": "The last name for a private chat counterpart." } }, "required": [ "id", "type" ], "additionalProperties": true, "description": "A Telegram chat record." }, "forwardFromMessageId": { "type": "integer", "description": "The original message identifier inside the source chat." }, "forwardSignature": { "type": "string", "description": "The original author signature for a forwarded channel post." }, "forwardSenderName": { "type": "string", "description": "The display name of a forwarded sender who disallows linking." }, "linkPreviewOptions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "The link preview options attached to the message." }, "video": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the video." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the video." }, "width": { "type": "integer", "description": "The video width in pixels." }, "height": { "type": "integer", "description": "The video height in pixels." }, "duration": { "type": "integer", "description": "The video duration in seconds." }, "thumbnail": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the photo." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the photo." }, "width": { "type": "integer", "description": "The photo width in pixels." }, "height": { "type": "integer", "description": "The photo height in pixels." }, "fileSize": { "type": "integer", "description": "The photo file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "width", "height" ], "additionalProperties": true, "description": "A Telegram photo or thumbnail size." }, "cover": { "type": "array", "items": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the photo." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the photo." }, "width": { "type": "integer", "description": "The photo width in pixels." }, "height": { "type": "integer", "description": "The photo height in pixels." }, "fileSize": { "type": "integer", "description": "The photo file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "width", "height" ], "additionalProperties": true, "description": "A Telegram photo or thumbnail size." }, "description": "The available sizes of the video cover." }, "startTimestamp": { "type": "integer", "description": "The start timestamp for the video in the message." }, "qualities": { "type": "array", "items": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse this video quality." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of this video quality." }, "width": { "type": "integer", "description": "The video width in pixels." }, "height": { "type": "integer", "description": "The video height in pixels." }, "codec": { "type": "string", "description": "The codec used to encode the video." }, "fileSize": { "type": "integer", "description": "The video quality file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "width", "height", "codec" ], "additionalProperties": true, "description": "A Telegram video file at one available quality." }, "description": "The available encoded video qualities." }, "fileName": { "type": "string", "description": "The original video filename." }, "mimeType": { "type": "string", "description": "The MIME type of the video." }, "fileSize": { "type": "integer", "description": "The video file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "width", "height", "duration" ], "additionalProperties": true, "description": "A Telegram video file." }, "audio": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the audio." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the audio." }, "duration": { "type": "integer", "description": "The audio duration in seconds." }, "performer": { "type": "string", "description": "The performer of the audio." }, "title": { "type": "string", "description": "The audio track title." }, "fileName": { "type": "string", "description": "The original audio filename." }, "mimeType": { "type": "string", "description": "The MIME type of the audio." }, "fileSize": { "type": "integer", "description": "The audio file size in bytes." }, "thumbnail": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the photo." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the photo." }, "width": { "type": "integer", "description": "The photo width in pixels." }, "height": { "type": "integer", "description": "The photo height in pixels." }, "fileSize": { "type": "integer", "description": "The photo file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "width", "height" ], "additionalProperties": true, "description": "A Telegram photo or thumbnail size." } }, "required": [ "fileId", "fileUniqueId", "duration" ], "additionalProperties": true, "description": "A Telegram audio file." }, "voice": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the voice message." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the voice message." }, "duration": { "type": "integer", "description": "The voice message duration in seconds." }, "mimeType": { "type": "string", "description": "The MIME type of the voice message." }, "fileSize": { "type": "integer", "description": "The voice message file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "duration" ], "additionalProperties": true, "description": "A Telegram voice message file." }, "animation": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the animation." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the animation." }, "width": { "type": "integer", "description": "The animation width in pixels." }, "height": { "type": "integer", "description": "The animation height in pixels." }, "duration": { "type": "integer", "description": "The animation duration in seconds." }, "thumbnail": { "type": "object", "properties": { "fileId": { "type": "string", "description": "The file identifier used to download or reuse the photo." }, "fileUniqueId": { "type": "string", "description": "The stable unique identifier of the photo." }, "width": { "type": "integer", "description": "The photo width in pixels." }, "height": { "type": "integer", "description": "The photo height in pixels." }, "fileSize": { "type": "integer", "description": "The photo file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "width", "height" ], "additionalProperties": true, "description": "A Telegram photo or thumbnail size." }, "fileName": { "type": "string", "description": "The original animation filename." }, "mimeType": { "type": "string", "description": "The MIME type of the animation." }, "fileSize": { "type": "integer", "description": "The animation file size in bytes." } }, "required": [ "fileId", "fileUniqueId", "width", "height", "duration" ], "additionalProperties": true, "description": "A Telegram animation file." }, "contact": { "type": "object", "properties": { "phoneNumber": { "type": "string", "description": "The contact phone number." }, "firstName": { "type": "string", "description": "The contact first name." }, "lastName": { "type": "string", "description": "The contact last name." }, "userId": { "type": "integer", "description": "The Telegram user identifier associated with the contact." }, "vcard": { "type": "string", "description": "Additional contact data in vCard format." } }, "required": [ "phoneNumber", "firstName" ], "additionalProperties": true, "description": "A Telegram contact." }, "venue": { "type": "object", "properties": { "location": { "type": "object", "properties": { "latitude": { "type": "number", "description": "The latitude of the location." }, "longitude": { "type": "number", "description": "The longitude of the location." }, "horizontalAccuracy": { "type": "number", "description": "The radius of uncertainty in meters." }, "livePeriod": { "type": "integer", "description": "The live location update period in seconds." }, "heading": { "type": "integer", "description": "The direction of travel in degrees." }, "proximityAlertRadius": { "type": "integer", "description": "The proximity alert radius in meters." } }, "required": [ "latitude", "longitude" ], "additionalProperties": true, "description": "A Telegram geographic location." }, "title": { "type": "string", "description": "The venue name." }, "address": { "type": "string", "description": "The venue address." }, "foursquareId": { "type": "string", "description": "The Foursquare place identifier." }, "foursquareType": { "type": "string", "description": "The Foursquare place type." }, "googlePlaceId": { "type": "string", "description": "The Google Places identifier." }, "googlePlaceType": { "type": "string", "description": "The Google Places type." } }, "required": [ "location", "title", "address" ], "additionalProperties": true, "description": "A Telegram venue." }, "dice": { "type": "object", "properties": { "emoji": { "type": "string", "description": "The emoji used for the animation." }, "value": { "type": "integer", "description": "The generated dice value." } }, "required": [ "emoji", "value" ], "additionalProperties": true, "description": "A Telegram animated dice result." } }, "required": [ "messageId", "date", "chat" ], "additionalProperties": true, "description": "A normalized Telegram message record." }, "nullable": false, "handle": "message" }, { "jsonSchema": { "type": "string", "pattern": "^-?[0-9]+$" }, "nullable": false, "handle": "chatId" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "textMessage" } ], "name": "Confirm the text reply", "moduleId": "n_37c3645c7bd5ab69", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_b4f3992e13c892fe": { "inputs": { "model": { "kind": "value", "value": "tts-1" }, "input": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_3fc9f929a23dc10d", "output": "translation" } ] }, "voice": { "kind": "value", "value": "alloy" }, "response_format": { "kind": "value", "value": "mp3" }, "speed": { "kind": "value", "value": 1 } }, "name": "Synthesize translated speech", "kind": "task", "task": { "inputs": [ { "description": "The text-to-speech model to use.", "jsonSchema": { "type": "string", "description": "The text-to-speech model to use." }, "nullable": false, "handle": "model" }, { "description": "The text to synthesize into speech.", "jsonSchema": { "type": "string", "description": "The text to synthesize into speech." }, "nullable": false, "handle": "input" }, { "description": "The voice configuration used for synthesis.", "jsonSchema": { "anyOf": [ { "type": "string", "description": "A built-in voice name." }, { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "A structured voice object accepted by the API." } ], "description": "The voice configuration used for synthesis." }, "nullable": false, "handle": "voice" }, { "description": "Optional voice instructions that guide the synthesis style.", "jsonSchema": { "type": "string", "description": "Optional voice instructions that guide the synthesis style." }, "nullable": true, "handle": "instructions", "value": null }, { "description": "The audio format to return.", "jsonSchema": { "type": "string", "enum": [ "mp3", "opus", "aac", "flac", "wav", "pcm" ], "description": "The audio format to return." }, "nullable": true, "handle": "response_format", "value": null }, { "description": "The playback speed multiplier.", "jsonSchema": { "type": "number", "minimum": 0.25, "maximum": 4, "description": "The playback speed multiplier." }, "nullable": true, "handle": "speed", "value": null }, { "description": "The speech response delivery format. This connector only accepts audio or an omitted value.", "jsonSchema": { "type": "string", "enum": [ "audio", "sse" ], "description": "The speech response delivery format. This connector only accepts audio or an omitted value." }, "nullable": true, "handle": "stream_format", "value": null } ], "outputs": [ { "description": "The synthesized audio encoded as base64.", "jsonSchema": { "type": "string", "description": "The synthesized audio encoded as base64." }, "nullable": false, "handle": "content_base64" }, { "description": "The MIME type of the synthesized audio.", "jsonSchema": { "type": "string", "description": "The MIME type of the synthesized audio." }, "nullable": false, "handle": "content_type" } ], "name": "Synthesize translated speech", "executor": { "kind": "connector", "action": "openai.create_speech" } } }, "n_7745da3944941aaa": { "inputs": { "botToken": { "kind": "unset" }, "verified": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_c12ff9fc95062668", "output": "verified" } ] }, "chatId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_40cca74555af1b37", "output": "chatId" } ] }, "contentBase64": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b4f3992e13c892fe", "output": "content_base64" } ] }, "contentType": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b4f3992e13c892fe", "output": "content_type" } ] } }, "name": "Reply with the original audio bytes", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "botToken" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "verified" }, { "jsonSchema": { "type": "string", "pattern": "^-?[0-9]+$" }, "nullable": false, "handle": "chatId" }, { "jsonSchema": { "type": "string", "description": "The synthesized audio encoded as base64." }, "nullable": false, "handle": "contentBase64" }, { "jsonSchema": { "type": "string", "description": "The MIME type of the synthesized audio." }, "nullable": false, "handle": "contentType" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "audioMessage" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "audioBytes" } ], "name": "Reply with the original audio bytes", "moduleId": "n_5dde77fcb928f808", "capabilities": [ { "kind": "http", "hosts": [ "api.telegram.org" ] } ] } }, "n_036c807b29cf23e2": { "name": "Confirmed text and audio replies", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "transcription" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "translation" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "textMessage" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "audioMessage" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "audioBytes" } ], "outputMappings": { "transcription": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_9cca2792cf299157", "output": "transcription" } ] }, "translation": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_3fc9f929a23dc10d", "output": "translation" } ] }, "textMessage": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_c159c067c10f8c87", "output": "textMessage" } ] }, "audioMessage": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_7745da3944941aaa", "output": "audioMessage" } ] }, "audioBytes": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_7745da3944941aaa", "output": "audioBytes" } ] } } } }, "edges": [ { "source": "n_79145ac9be0663a9", "target": "n_40cca74555af1b37" }, { "source": "n_40cca74555af1b37", "target": "n_7a7faf45174b8772" }, { "source": "n_7a7faf45174b8772", "target": "n_c12ff9fc95062668" }, { "source": "n_c12ff9fc95062668", "target": "n_5145f02179d089a7" }, { "source": "n_5145f02179d089a7", "target": "n_1be341e41810648f" }, { "source": "n_1be341e41810648f", "target": "n_c62fc0fc1b563dfc" }, { "source": "n_c62fc0fc1b563dfc", "target": "n_9cca2792cf299157" }, { "source": "n_9cca2792cf299157", "target": "n_4b2c0882486ea050" }, { "source": "n_4b2c0882486ea050", "target": "n_3fc9f929a23dc10d" }, { "source": "n_3fc9f929a23dc10d", "target": "n_b2d69d7daeafbc0e" }, { "source": "n_b2d69d7daeafbc0e", "target": "n_c159c067c10f8c87" }, { "source": "n_c159c067c10f8c87", "target": "n_b4f3992e13c892fe" }, { "source": "n_b4f3992e13c892fe", "target": "n_7745da3944941aaa" }, { "source": "n_7745da3944941aaa", "target": "n_036c807b29cf23e2" } ] } }, "modules": { "n_6120f854e7b67e1d": { "name": "Prepare the voice translation", "imports": [], "source": "export default function prepareTelegramTranslation({body,languageNative,languageTranslate}) {\n const message=body?.message,voice=message?.voice;\n if(!message||!voice||typeof voice.file_id!=='string'||!voice.file_id||!Number.isSafeInteger(message.chat?.id))throw new Error('This workflow requires a Telegram voice message with a chat ID.');\n if(typeof languageNative!=='string'||!languageNative.trim()||typeof languageTranslate!=='string'||!languageTranslate.trim()||languageNative.trim().toLowerCase()===languageTranslate.trim().toLowerCase())throw new Error('Configure two different translation languages.');\n return {chatId:String(message.chat.id),fileId:voice.file_id,fileRequest:{file_id:voice.file_id},languageNative:languageNative.trim(),languageTranslate:languageTranslate.trim(),voiceMime:typeof voice.mime_type==='string'?voice.mime_type:'audio/ogg'};\n}\n" }, "n_7d59af82e364ab74": { "name": "Verify the audio token matches", "imports": [], "source": "export default async function verifyTelegramAudioBot({botToken,providerBotId,providerIsBot},context) {\n if(typeof botToken!=='string'||!/^\\d+:[A-Za-z0-9_-]+$/.test(botToken))throw new Error('Select the Telegram audio Bot Token Variable.');\n if(!Number.isSafeInteger(providerBotId)||providerIsBot!==true)throw new Error('The Telegram connection did not identify a bot.');\n try {\n const response=await context.fetch('https://api.telegram.org/bot'+botToken+'/getMe',{method:'GET'});\n if(!response.ok)throw new Error('Unconfirmed identity.');\n const reply=await response.json();\n if(reply?.ok!==true||reply.result?.is_bot!==true||reply.result.id!==providerBotId)throw new Error('Unmatched bot.');\n return {verified:true,botId:providerBotId};\n } catch {throw new Error('The audio Bot Token must identify the same bot as the selected Telegram connection.');}\n}\n" }, "n_5cacb714c30c8f07": { "name": "Download the complete voice bytes", "imports": [], "source": "import {Buffer} from 'node:buffer';\nexport default async function downloadTelegramVoice({botToken,verified,reply,statusCode,fileId,voiceMime},context) {\n if(verified!==true||typeof botToken!=='string'||!/^\\d+:[A-Za-z0-9_-]+$/.test(botToken))throw new Error('Verify the audio Bot Token before downloading.');\n const file=reply?.result,path=file?.file_path;\n if(statusCode!==200||reply?.ok!==true||file?.file_id!==fileId||typeof path!=='string'||!path||path.startsWith('/')||path.split('/').some(x=>!x||x==='.'||x==='..')||/[?#\\\\\\x00-\\x20]/.test(path))throw new Error('Telegram did not confirm a valid downloadable voice file.');\n const ext=path.split('.').at(-1)?.toLowerCase(),extensions={oga:'ogg',ogg:'ogg',opus:'ogg',mp3:'mp3',m4a:'m4a',mp4:'mp4',mpeg:'mpeg',mpga:'mpga',wav:'wav',webm:'webm',flac:'flac'},extension=extensions[ext];\n if(!extension)throw new Error('Telegram returned an unsupported voice-file format.');\n try {\n const response=await context.fetch('https://api.telegram.org/file/bot'+botToken+'/'+path.split('/').map(encodeURIComponent).join('/'),{method:'GET'});\n if(!response.ok)throw new Error('Download not confirmed.');\n const bytes=new Uint8Array(await response.arrayBuffer());\n if(bytes.length===0)throw new Error('Empty audio.');\n return {file:{name:'voice.'+extension,mimetype:typeof voiceMime==='string'&&voiceMime.startsWith('audio/')?voiceMime:'application/octet-stream',content_base64:Buffer.from(bytes).toString('base64')},audioBytes:bytes.length};\n } catch {throw new Error('Telegram voice download failed; no partial audio is returned.');}\n}\n" }, "n_ac2195465c8c9f5d": { "name": "Apply the two language settings", "imports": [], "source": "export default function telegramTranslationPrompt({transcription,languageNative,languageTranslate}) {\n const text=transcription?.text;\n if(typeof text!=='string'||!text.trim())throw new Error('Transcription did not return nonempty text.');\n if(typeof languageNative!=='string'||typeof languageTranslate!=='string')throw new Error('Missing language configuration.');\n return {transcription:text,prompt:'Detect the language of the text that follows. \\n- If it is '+languageNative+' translate to '+languageTranslate+'. \\n- If it is in '+languageTranslate+' translate to '+languageNative+' . \\n- In the output just provide the translation and do not explain it. Just provide the translation without anything else.\\n\\nText:\\n '+text+'\\n'};\n}\n" }, "n_7d6d56071d680363": { "name": "Keep the complete translated text", "imports": [], "source": "export default function validateTelegramTranslation({translation}) {if(typeof translation!=='string'||!translation.trim())throw new Error('Translation did not return text.');return {translation};}\n" }, "n_37c3645c7bd5ab69": { "name": "Confirm the text reply", "imports": [], "source": "export default function confirmTelegramTranslationText({message,chatId}) {if(!Number.isSafeInteger(message?.messageId)||message.messageId<1||String(message.chat?.id)!==chatId)throw new Error('Telegram text reply was not confirmed; inspect the chat before replay.');return {textMessage:message};}\n" }, "n_5dde77fcb928f808": { "name": "Reply with the original audio bytes", "imports": [], "source": "import {Buffer} from 'node:buffer';\nexport default async function sendTelegramTranslatedAudio({botToken,verified,chatId,contentBase64,contentType},context) {\n if(verified!==true||typeof botToken!=='string'||!/^\\d+:[A-Za-z0-9_-]+$/.test(botToken)||typeof chatId!=='string'||!/^\\-?\\d+$/.test(chatId))throw new Error('Verify the Telegram audio bot and chat before sending.');\n if(typeof contentBase64!=='string'||!contentBase64||contentBase64.length%4!==0||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(contentBase64))throw new Error('Speech returned invalid audio encoding.');\n if(typeof contentType!=='string'||!['audio/mpeg','audio/mp3','application/octet-stream'].includes(contentType.split(';')[0].trim().toLowerCase()))throw new Error('Speech did not return MP3 audio.');\n const audioBuffer=Buffer.from(contentBase64,'base64'),audio=new Uint8Array(audioBuffer);\n if(!audio.length||audioBuffer.toString('base64')!==contentBase64)throw new Error('Speech returned incomplete audio encoding.');\n let index=0,boundary;\n do {boundary='oomol-telegram-audio-'+index++;}while(audioBuffer.includes(Buffer.from(boundary)));\n const head=new TextEncoder().encode('--'+boundary+'\\r\\nContent-Disposition: form-data; name=\"chat_id\"\\r\\n\\r\\n'+chatId+'\\r\\n--'+boundary+'\\r\\nContent-Disposition: form-data; name=\"audio\"; filename=\"translation.mp3\"\\r\\nContent-Type: audio/mpeg\\r\\n\\r\\n'),tail=new TextEncoder().encode('\\r\\n--'+boundary+'--\\r\\n'),body=new Uint8Array(head.length+audio.length+tail.length);body.set(head);body.set(audio,head.length);body.set(tail,head.length+audio.length);\n try {\n const response=await context.fetch('https://api.telegram.org/bot'+botToken+'/sendAudio',{method:'POST',headers:{'content-type':'multipart/form-data; boundary='+boundary},body});\n if(!response.ok)throw new Error('Send not confirmed.');\n const reply=await response.json(),message=reply?.result;\n if(reply?.ok!==true||!Number.isSafeInteger(message?.message_id)||message.message_id<1||String(message.chat?.id)!==chatId||typeof message.audio?.file_id!=='string'||!message.audio.file_id)throw new Error('Invalid audio receipt.');\n return {audioMessage:message,audioBytes:audio.length};\n } catch {throw new Error('Telegram audio reply was not confirmed; inspect the chat before replay.');}\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }