{ "kind": "open-flow-workflow", "version": 1, "name": "Analyze Telegram Images with AI", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_d5d3e81b53ad860b": { "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_2d7cb31c249e6be5": { "inputs": { "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d5d3e81b53ad860b", "output": "body" } ] } }, "name": "Check for a photo", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object" }, "nullable": false, "handle": "body" } ], "outputs": [ { "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" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "hasPhoto" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "fileId" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "fileRequest" } ], "name": "Check for a photo", "moduleId": "n_071f06b3c5932180", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_d333fa30ae3355c0": { "inputs": {}, "name": "Photo received?", "kind": "condition", "matchMode": "first", "cases": [ { "output": "yes", "groups": [ { "expressions": [ { "left": { "kind": "source", "source": { "kind": "node", "nodeId": "n_2d7cb31c249e6be5", "output": "hasPhoto" } }, "operator": "isTrue" } ] } ] } ] }, "n_ff4260d19f0a6276": { "inputs": {}, "name": "Wait three hours", "kind": "wait", "inputDefinitions": [], "prompt": "Wait three hours", "autoContinue": { "kind": "after", "durationMs": 10800000 } }, "n_3af9135af4a47e53": { "inputs": { "chatId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_2d7cb31c249e6be5", "output": "chatId" } ] }, "text": { "kind": "value", "value": "Please Upload an Image ...." } }, "name": "Ask for an image", "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": "Ask for an image", "executor": { "kind": "connector", "action": "telegram.send_message", "outputMode": "value" } } }, "n_35110a02d4e6c83f": { "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_d015c94b9faecdd5": { "inputs": { "botToken": { "kind": "unset" }, "providerBotId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_35110a02d4e6c83f", "output": "id" } ] }, "providerIsBot": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_35110a02d4e6c83f", "output": "isBot" } ] } }, "name": "Verify the download token", "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 download token", "moduleId": "n_6e65f95cd445414f", "capabilities": [ { "kind": "http", "hosts": [ "api.telegram.org" ] } ] } }, "n_a96de8e117ad0556": { "inputs": { "endpoint": { "kind": "value", "value": "/getFile" }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_2d7cb31c249e6be5", "output": "fileRequest" } ] } }, "name": "Get the photo 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 photo path", "executor": { "providerId": "telegram", "method": "POST", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "json", "kind": "connector-proxy" } } }, "n_fecc72d95f6bb47d": { "inputs": { "botToken": { "kind": "unset" }, "verified": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d015c94b9faecdd5", "output": "verified" } ] }, "reply": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_a96de8e117ad0556", "output": "body" } ] }, "statusCode": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_a96de8e117ad0556", "output": "statusCode" } ] }, "fileId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_2d7cb31c249e6be5", "output": "fileId" } ] } }, "name": "Download the photo", "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" } ], "outputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "image" } ], "name": "Download the photo", "moduleId": "n_bc419925de4636ae", "capabilities": [ { "kind": "http", "hosts": [ "api.telegram.org" ] } ] } }, "n_a56c7ab1130bc17f": { "inputs": { "image": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_fecc72d95f6bb47d", "output": "image" } ] } }, "name": "Prepare image analysis", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "image" } ], "outputs": [ { "jsonSchema": { "anyOf": [ { "type": "string", "description": "A plain text prompt." }, { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string", "enum": [ "system", "user", "assistant", "developer" ], "description": "The role of the message author." }, "content": { "anyOf": [ { "type": "string", "description": "Plain text content for a simple message." }, { "type": "array", "items": { "anyOf": [ { "type": "object", "properties": { "type": { "const": "input_text", "description": "The content type. Must be input_text." }, "text": { "type": "string", "description": "The text content sent to the model." } }, "required": [ "type", "text" ], "additionalProperties": false, "description": "A text content block for a response input message." }, { "type": "object", "properties": { "type": { "const": "input_image", "description": "The content type. Must be input_image." }, "image_url": { "type": "string", "description": "A remote image URL or a data URL containing the image bytes." }, "detail": { "type": "string", "enum": [ "auto", "low", "high", "original" ], "description": "The requested image detail level." } }, "required": [ "type", "image_url" ], "additionalProperties": false, "description": "An image content block for a response input message." }, { "type": "object", "properties": { "type": { "const": "input_file", "description": "The content type. Must be input_file." }, "file_id": { "type": "string", "description": "The uploaded file ID to reference." }, "file_data": { "type": "string", "description": "The inline file data encoded as base64 or supplied as a data URL." }, "filename": { "type": "string", "description": "The filename to report for inline file data." } }, "required": [ "type" ], "additionalProperties": false, "description": "A file content block for a response input message." } ], "description": "A structured content block." }, "minItems": 1, "description": "Structured multimodal content blocks." } ], "description": "The content for the message." } }, "required": [ "role", "content" ], "additionalProperties": false, "description": "A message in the Responses API input array." }, "minItems": 1, "description": "An ordered array of conversation messages." } ], "description": "The input prompt or message array sent to the model." }, "nullable": false, "handle": "input" } ], "name": "Prepare image analysis", "moduleId": "n_e1a7701c6bf4c023", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_bf7e0a815ee501a3": { "inputs": { "model": { "kind": "value", "value": "gpt-4.1-mini" }, "input": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_a56c7ab1130bc17f", "output": "input" } ] }, "max_output_tokens": { "kind": "value", "value": 300 }, "store": { "kind": "value", "value": false } }, "name": "Analyze the image", "kind": "task", "task": { "inputs": [ { "description": "The model to use for the response.", "jsonSchema": { "type": "string", "description": "The model to use for the response." }, "nullable": false, "handle": "model" }, { "description": "The input prompt or message array sent to the model.", "jsonSchema": { "anyOf": [ { "type": "string", "description": "A plain text prompt." }, { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string", "enum": [ "system", "user", "assistant", "developer" ], "description": "The role of the message author." }, "content": { "anyOf": [ { "type": "string", "description": "Plain text content for a simple message." }, { "type": "array", "items": { "anyOf": [ { "type": "object", "properties": { "type": { "const": "input_text", "description": "The content type. Must be input_text." }, "text": { "type": "string", "description": "The text content sent to the model." } }, "required": [ "type", "text" ], "additionalProperties": false, "description": "A text content block for a response input message." }, { "type": "object", "properties": { "type": { "const": "input_image", "description": "The content type. Must be input_image." }, "image_url": { "type": "string", "description": "A remote image URL or a data URL containing the image bytes." }, "detail": { "type": "string", "enum": [ "auto", "low", "high", "original" ], "description": "The requested image detail level." } }, "required": [ "type", "image_url" ], "additionalProperties": false, "description": "An image content block for a response input message." }, { "type": "object", "properties": { "type": { "const": "input_file", "description": "The content type. Must be input_file." }, "file_id": { "type": "string", "description": "The uploaded file ID to reference." }, "file_data": { "type": "string", "description": "The inline file data encoded as base64 or supplied as a data URL." }, "filename": { "type": "string", "description": "The filename to report for inline file data." } }, "required": [ "type" ], "additionalProperties": false, "description": "A file content block for a response input message." } ], "description": "A structured content block." }, "minItems": 1, "description": "Structured multimodal content blocks." } ], "description": "The content for the message." } }, "required": [ "role", "content" ], "additionalProperties": false, "description": "A message in the Responses API input array." }, "minItems": 1, "description": "An ordered array of conversation messages." } ], "description": "The input prompt or message array sent to the model." }, "nullable": false, "handle": "input" }, { "description": "A top-level instruction string applied before the input.", "jsonSchema": { "type": "string", "description": "A top-level instruction string applied before the input." }, "nullable": true, "handle": "instructions", "value": null }, { "description": "The maximum number of output tokens to generate.", "jsonSchema": { "type": "integer", "minimum": 1, "description": "The maximum number of output tokens to generate." }, "nullable": true, "handle": "max_output_tokens", "value": null }, { "description": "String metadata attached to the response.", "jsonSchema": { "type": "object", "additionalProperties": { "type": "string", "description": "Metadata field value." }, "description": "String metadata attached to the response." }, "nullable": true, "handle": "metadata", "value": null }, { "description": "The ID of a previous response to continue from.", "jsonSchema": { "type": "string", "description": "The ID of a previous response to continue from." }, "nullable": true, "handle": "previous_response_id", "value": null }, { "description": "Whether the response may be stored by the upstream platform.", "jsonSchema": { "type": "boolean", "description": "Whether the response may be stored by the upstream platform." }, "nullable": true, "handle": "store", "value": null }, { "description": "The sampling temperature.", "jsonSchema": { "type": "number", "minimum": 0, "maximum": 2, "description": "The sampling temperature." }, "nullable": true, "handle": "temperature", "value": null }, { "description": "Text output configuration for the response.", "jsonSchema": { "type": "object", "properties": { "format": { "anyOf": [ { "type": "object", "properties": { "type": { "const": "json_object", "description": "The format type. Must be json_object." } }, "required": [ "type" ], "additionalProperties": false, "description": "A flexible JSON object output format." }, { "type": "object", "properties": { "type": { "const": "json_schema", "description": "The format type. Must be json_schema." }, "name": { "type": "string", "description": "The schema name reported to the model." }, "schema": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "The JSON Schema definition used for output validation." }, "strict": { "type": "boolean", "description": "Whether the model must strictly follow the declared schema." } }, "required": [ "type", "name", "schema" ], "additionalProperties": false, "description": "A JSON Schema output format." } ], "description": "The output format configuration." } }, "additionalProperties": false, "description": "Text output configuration for the response." }, "nullable": true, "handle": "text", "value": null }, { "description": "The nucleus sampling threshold.", "jsonSchema": { "type": "number", "minimum": 0, "maximum": 1, "description": "The nucleus sampling threshold." }, "nullable": true, "handle": "top_p", "value": null }, { "description": "An end-user identifier passed through to the upstream API.", "jsonSchema": { "type": "string", "description": "An end-user identifier passed through to the upstream API." }, "nullable": true, "handle": "user", "value": null }, { "description": "Whether to request a streaming response. This connector only accepts false or an omitted value.", "jsonSchema": { "type": "boolean", "description": "Whether to request a streaming response. This connector only accepts false or an omitted value." }, "nullable": true, "handle": "stream", "value": null } ], "outputs": [ { "description": "The response payload returned by the OpenAI Responses API.", "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "The response identifier." }, "object": { "type": "string", "description": "The top-level object type." }, "created_at": { "type": "integer", "description": "The Unix timestamp when the response was created." }, "status": { "type": "string", "description": "The response status." }, "model": { "type": "string", "description": "The model that generated the response." }, "output": { "type": "array", "items": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Any JSON object." }, "description": "The raw output items returned by the response." }, "output_text": { "type": "string", "description": "The aggregated plain text extracted from the output items." }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "The number of input tokens consumed." }, "output_tokens": { "type": "integer", "description": "The number of output tokens generated." }, "total_tokens": { "type": "integer", "description": "The total number of tokens used." }, "input_tokens_details": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Detailed usage information for input tokens." }, "output_tokens_details": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Detailed usage information for output tokens." } }, "additionalProperties": true, "description": "Usage statistics for the response." }, "error": { "type": [ "object", "null" ], "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "The upstream error payload, when the response is incomplete." }, "incomplete_details": { "type": [ "object", "null" ], "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "The upstream incomplete details payload, if provided." }, "previous_response_id": { "type": [ "string", "null" ], "description": "The previous response ID referenced by this response." }, "store": { "type": "boolean", "description": "Whether the response is stored by the upstream platform." }, "expire_at": { "type": "integer", "description": "The Unix timestamp when the stored response expires." } }, "required": [ "id", "output" ], "additionalProperties": true, "description": "The response payload returned by the OpenAI Responses API." }, "nullable": false, "handle": "output" } ], "name": "Analyze the image", "executor": { "kind": "connector", "action": "openai.create_response", "outputMode": "value" } } }, "n_e4332b198e693bf8": { "inputs": { "response": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_bf7e0a815ee501a3", "output": "output" } ] } }, "name": "Read the analysis", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "The response identifier." }, "object": { "type": "string", "description": "The top-level object type." }, "created_at": { "type": "integer", "description": "The Unix timestamp when the response was created." }, "status": { "type": "string", "description": "The response status." }, "model": { "type": "string", "description": "The model that generated the response." }, "output": { "type": "array", "items": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Any JSON object." }, "description": "The raw output items returned by the response." }, "output_text": { "type": "string", "description": "The aggregated plain text extracted from the output items." }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "The number of input tokens consumed." }, "output_tokens": { "type": "integer", "description": "The number of output tokens generated." }, "total_tokens": { "type": "integer", "description": "The total number of tokens used." }, "input_tokens_details": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Detailed usage information for input tokens." }, "output_tokens_details": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Detailed usage information for output tokens." } }, "additionalProperties": true, "description": "Usage statistics for the response." }, "error": { "type": [ "object", "null" ], "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "The upstream error payload, when the response is incomplete." }, "incomplete_details": { "type": [ "object", "null" ], "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "The upstream incomplete details payload, if provided." }, "previous_response_id": { "type": [ "string", "null" ], "description": "The previous response ID referenced by this response." }, "store": { "type": "boolean", "description": "Whether the response is stored by the upstream platform." }, "expire_at": { "type": "integer", "description": "The Unix timestamp when the stored response expires." } }, "required": [ "id", "output" ], "additionalProperties": true, "description": "The response payload returned by the OpenAI Responses API." }, "nullable": false, "handle": "response" } ], "outputs": [ { "jsonSchema": { "type": "string", "maxLength": 4096, "minLength": 1, "description": "The text of the message to send." }, "nullable": false, "handle": "text" } ], "name": "Read the analysis", "moduleId": "n_4c3436e1a9b518c4", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_a1ddb94bcc671353": { "inputs": { "chatId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_2d7cb31c249e6be5", "output": "chatId" } ] }, "text": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_e4332b198e693bf8", "output": "text" } ] } }, "name": "Send the analysis", "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": "Send the analysis", "executor": { "kind": "connector", "action": "telegram.send_message", "outputMode": "value" } } } }, "edges": [ { "source": "n_d5d3e81b53ad860b", "target": "n_2d7cb31c249e6be5" }, { "source": "n_2d7cb31c249e6be5", "target": "n_d333fa30ae3355c0" }, { "source": "n_d333fa30ae3355c0", "target": "n_ff4260d19f0a6276", "sourceHandle": "otherwise" }, { "source": "n_ff4260d19f0a6276", "target": "n_3af9135af4a47e53", "sourceHandle": "continue" }, { "source": "n_d333fa30ae3355c0", "target": "n_35110a02d4e6c83f", "sourceHandle": "yes" }, { "source": "n_35110a02d4e6c83f", "target": "n_d015c94b9faecdd5" }, { "source": "n_d015c94b9faecdd5", "target": "n_a96de8e117ad0556" }, { "source": "n_a96de8e117ad0556", "target": "n_fecc72d95f6bb47d" }, { "source": "n_fecc72d95f6bb47d", "target": "n_a56c7ab1130bc17f" }, { "source": "n_a56c7ab1130bc17f", "target": "n_bf7e0a815ee501a3" }, { "source": "n_bf7e0a815ee501a3", "target": "n_e4332b198e693bf8" }, { "source": "n_e4332b198e693bf8", "target": "n_a1ddb94bcc671353" } ] } }, "modules": { "n_071f06b3c5932180": { "name": "Check for a photo", "imports": [], "source": "export default function plan({body}){const m=body?.message,id=m?.chat?.id;if(!Number.isSafeInteger(id))throw Error('Missing Telegram chat');const photos=m?.photo;if(photos==null||Array.isArray(photos)&&photos.length===0)return{chatId:id,hasPhoto:false,fileId:'unused',fileRequest:{}};if(!Array.isArray(photos))throw Error('Invalid Telegram photos');const photo=photos.at(-1);if(typeof photo?.file_id!=='string'||!photo.file_id)throw Error('Missing photo file ID');return{chatId:id,hasPhoto:true,fileId:photo.file_id,fileRequest:{file_id:photo.file_id}}}\n" }, "n_6e65f95cd445414f": { "name": "Verify the download token", "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 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 Telegram Bot Token must identify the same bot as the selected Telegram connection.');}\n}\n" }, "n_bc419925de4636ae": { "name": "Download the photo", "imports": [], "source": "import {Buffer} from 'node:buffer';\nexport default async function download({botToken,verified,reply,statusCode,fileId},context){if(verified!==true||typeof botToken!=='string'||!/^\\d+:[A-Za-z0-9_-]+$/.test(botToken))throw Error('Verify the Telegram bot token');const f=reply?.result,path=f?.file_path;if(statusCode!==200||reply?.ok!==true||f?.file_id!==fileId||typeof path!=='string'||!/^photos\\/[A-Za-z0-9_.-]+\\.jpe?g$/i.test(path))throw Error('Telegram did not confirm a valid photo path');try{const r=await context.fetch('https://api.telegram.org/file/bot'+botToken+'/'+path.split('/').map(encodeURIComponent).join('/'),{method:'GET'});if(!r.ok)throw Error('Download failed');const bytes=new Uint8Array(await r.arrayBuffer());if(!bytes.length||bytes.length>700000||bytes[0]!==255||bytes[1]!==216||bytes[2]!==255||(typeof f.file_size==='number'&&f.file_size!==bytes.length))throw Error('Invalid photo');return{image:'data:image/jpeg;base64,'+Buffer.from(bytes).toString('base64')}}catch{throw Error('Telegram photo download failed or exceeds the supported size')}}\n" }, "n_e1a7701c6bf4c023": { "name": "Prepare image analysis", "imports": [], "source": "export default function request({image}){if(typeof image!=='string'||!image.startsWith('data:image/jpeg;base64,'))throw Error('Missing image');return{input:[{role:'user',content:[{type:'input_text',text:\"What's in this image?\"},{type:'input_image',image_url:image,detail:'auto'}]}]}}\n" }, "n_4c3436e1a9b518c4": { "name": "Read the analysis", "imports": [], "source": "export default function answer({response}){if(!response||response.status!=='completed'||!Array.isArray(response.output))throw Error('Image analysis did not complete');const texts=response.output.flatMap(x=>Array.isArray(x.content)?x.content.filter(y=>y.type==='output_text'&&typeof y.text==='string').map(y=>y.text):[]),text=texts.join('\\n').trim();if(!text||text.length>4096)throw Error('Image analysis response is empty or too long');return{text}}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }