{ "kind": "open-flow-workflow", "version": 1, "name": "Send Telegram Documents to Kindle", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_75253c578e44b640": { "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_f4cda2ec224e37a5": { "inputs": { "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_75253c578e44b640", "output": "body" } ] }, "recipient": { "kind": "value", "value": "YOUR_KINDLE_EMAIL" } }, "name": "Check the message and destination", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object" }, "nullable": false, "handle": "body" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "recipient" } ], "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": "integer", "exclusiveMinimum": 0, "description": "The message ID to reply to." }, "nullable": true, "handle": "replyId" }, { "jsonSchema": { "type": "array", "items": { "anyOf": [ { "type": "string", "minLength": 1, "description": "Schema for nonEmptyString." }, { "type": "object", "properties": { "address": { "type": "string", "minLength": 1, "description": "Recipient email address." }, "name": { "type": "string", "description": "Recipient display name." } }, "required": [ "address" ], "additionalProperties": false, "description": "Schema for recipientAddressInputSchema." } ], "description": "Recipient email address or recipient object with display name." }, "description": "Primary recipients for the draft message." }, "nullable": true, "handle": "recipients" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "hasDocument" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "fileId" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "fileRequest" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "fileName" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "mimeType" } ], "name": "Check the message and destination", "moduleId": "n_4a5c9061b29512fa", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_aa8fbebaf6dc4332": { "inputs": {}, "name": "Message contains a document", "kind": "condition", "matchMode": "first", "cases": [ { "output": "document", "groups": [ { "expressions": [ { "left": { "kind": "source", "source": { "kind": "node", "nodeId": "n_f4cda2ec224e37a5", "output": "hasDocument" } }, "operator": "==", "right": { "kind": "value", "value": true } } ] } ] } ] }, "n_cd1b00e772db8619": { "inputs": { "chatId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_f4cda2ec224e37a5", "output": "chatId" } ] }, "replyToMessageId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_f4cda2ec224e37a5", "output": "replyId" } ] }, "text": { "kind": "value", "value": "There is no file in message.Please check." } }, "name": "Ask for a document", "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 a document", "executor": { "kind": "connector", "action": "telegram.send_message", "outputMode": "value" } } }, "n_dc34a5cd7ed96b41": { "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_4f6fc1e907b2994a": { "inputs": { "botToken": { "kind": "unset" }, "providerBotId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_dc34a5cd7ed96b41", "output": "id" } ] }, "providerIsBot": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_dc34a5cd7ed96b41", "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_f2bafccf255ddc22", "capabilities": [ { "kind": "http", "hosts": [ "api.telegram.org" ] } ] } }, "n_4fcb9a77e8301279": { "inputs": { "endpoint": { "kind": "value", "value": "/getFile" }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_f4cda2ec224e37a5", "output": "fileRequest" } ] } }, "name": "Get the document 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 document path", "executor": { "providerId": "telegram", "method": "POST", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "json", "kind": "connector-proxy" } } }, "n_cd2e056162fb4a6f": { "inputs": { "botToken": { "kind": "unset" }, "verified": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_4f6fc1e907b2994a", "output": "verified" } ] }, "reply": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_4fcb9a77e8301279", "output": "body" } ] }, "statusCode": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_4fcb9a77e8301279", "output": "statusCode" } ] }, "fileId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_f4cda2ec224e37a5", "output": "fileId" } ] }, "fileName": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_f4cda2ec224e37a5", "output": "fileName" } ] }, "mimeType": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_f4cda2ec224e37a5", "output": "mimeType" } ] } }, "name": "Download the document", "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": "fileName" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "mimeType" } ], "outputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "name" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "mimeType" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "contentBase64" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "mailBody" } ], "name": "Download the document", "moduleId": "n_369907fd79bd8e46", "capabilities": [ { "kind": "http", "hosts": [ "api.telegram.org" ] } ] } }, "n_1ba2c5b561bde4b0": { "inputs": { "subject": { "kind": "value", "value": "book from telegram bot" }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_cd2e056162fb4a6f", "output": "mailBody" } ] }, "isHtml": { "kind": "value", "value": false }, "toRecipients": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_f4cda2ec224e37a5", "output": "recipients" } ] } }, "name": "Create an Outlook draft", "kind": "task", "task": { "inputs": [ { "description": "Subject line for the draft message.", "jsonSchema": { "type": "string", "description": "Subject line for the draft message." }, "nullable": false, "handle": "subject" }, { "description": "Body content for the draft message.", "jsonSchema": { "type": "string", "description": "Body content for the draft message." }, "nullable": false, "handle": "body" }, { "description": "Whether the draft body is already HTML content.", "jsonSchema": { "type": "boolean", "description": "Whether the draft body is already HTML content." }, "nullable": true, "handle": "isHtml", "value": null }, { "description": "Primary recipients for the draft message.", "jsonSchema": { "type": "array", "items": { "anyOf": [ { "type": "string", "minLength": 1, "description": "Schema for nonEmptyString." }, { "type": "object", "properties": { "address": { "type": "string", "minLength": 1, "description": "Recipient email address." }, "name": { "type": "string", "description": "Recipient display name." } }, "required": [ "address" ], "additionalProperties": false, "description": "Schema for recipientAddressInputSchema." } ], "description": "Recipient email address or recipient object with display name." }, "description": "Primary recipients for the draft message." }, "nullable": true, "handle": "toRecipients", "value": null }, { "description": "Cc recipients for the draft message.", "jsonSchema": { "type": "array", "items": { "anyOf": [ { "type": "string", "minLength": 1, "description": "Schema for nonEmptyString." }, { "type": "object", "properties": { "address": { "type": "string", "minLength": 1, "description": "Recipient email address." }, "name": { "type": "string", "description": "Recipient display name." } }, "required": [ "address" ], "additionalProperties": false, "description": "Schema for recipientAddressInputSchema." } ], "description": "Recipient email address or recipient object with display name." }, "description": "Cc recipients for the draft message." }, "nullable": true, "handle": "ccRecipients", "value": null }, { "description": "Bcc recipients for the draft message.", "jsonSchema": { "type": "array", "items": { "anyOf": [ { "type": "string", "minLength": 1, "description": "Schema for nonEmptyString." }, { "type": "object", "properties": { "address": { "type": "string", "minLength": 1, "description": "Recipient email address." }, "name": { "type": "string", "description": "Recipient display name." } }, "required": [ "address" ], "additionalProperties": false, "description": "Schema for recipientAddressInputSchema." } ], "description": "Recipient email address or recipient object with display name." }, "description": "Bcc recipients for the draft message." }, "nullable": true, "handle": "bccRecipients", "value": null }, { "description": "Reply-to recipients for the draft message.", "jsonSchema": { "type": "array", "items": { "anyOf": [ { "type": "string", "minLength": 1, "description": "Schema for nonEmptyString." }, { "type": "object", "properties": { "address": { "type": "string", "minLength": 1, "description": "Recipient email address." }, "name": { "type": "string", "description": "Recipient display name." } }, "required": [ "address" ], "additionalProperties": false, "description": "Schema for recipientAddressInputSchema." } ], "description": "Recipient email address or recipient object with display name." }, "description": "Reply-to recipients for the draft message." }, "nullable": true, "handle": "replyTo", "value": null }, { "description": "Message importance.", "jsonSchema": { "type": "string", "enum": [ "low", "normal", "high" ], "description": "Message importance." }, "nullable": true, "handle": "importance", "value": null }, { "description": "Categories to apply to the draft.", "jsonSchema": { "type": "array", "items": { "type": "string", "minLength": 1, "description": "Schema for nonEmptyString." }, "description": "Categories to apply to the draft." }, "nullable": true, "handle": "categories", "value": null } ], "outputs": [ { "description": "Outlook message resource.", "jsonSchema": { "type": "object", "properties": { "@odata.etag": { "type": "string", "description": "Entity tag for the message." }, "id": { "type": "string", "description": "Message ID." }, "createdDateTime": { "type": "string", "description": "Timestamp when the message was created." }, "lastModifiedDateTime": { "type": "string", "description": "Timestamp when the message was last modified." }, "changeKey": { "type": "string", "description": "Change key for the message." }, "categories": { "type": "array", "items": { "type": "string", "description": "An array item." }, "description": "Categories applied to the message." }, "receivedDateTime": { "type": "string", "description": "Timestamp when the message was received." }, "sentDateTime": { "type": "string", "description": "Timestamp when the message was sent." }, "hasAttachments": { "type": "boolean", "description": "Whether the message has attachments." }, "internetMessageId": { "type": "string", "description": "Internet message identifier for the message." }, "subject": { "type": "string", "description": "Message subject." }, "bodyPreview": { "type": "string", "description": "Preview snippet of the message body." }, "importance": { "type": "string", "description": "Message importance." }, "parentFolderId": { "type": "string", "description": "Parent folder ID for the message." }, "conversationId": { "type": "string", "description": "Conversation ID for the message." }, "conversationIndex": { "type": "string", "description": "Conversation index for the message." }, "isDeliveryReceiptRequested": { "type": "boolean", "description": "Whether delivery receipts are requested." }, "isReadReceiptRequested": { "type": "boolean", "description": "Whether read receipts are requested." }, "isRead": { "type": "boolean", "description": "Whether the message is marked as read." }, "isDraft": { "type": "boolean", "description": "Whether the message is a draft." }, "webLink": { "type": "string", "description": "Web URL for the message in Outlook." }, "inferenceClassification": { "type": "string", "description": "Outlook inference classification for the message." }, "body": { "type": "object", "properties": { "contentType": { "type": "string", "description": "Message body content type." }, "content": { "type": "string", "description": "Message body content." } }, "required": [ "contentType", "content" ], "additionalProperties": false, "description": "Message body." }, "sender": { "type": "object", "properties": { "emailAddress": { "type": "object", "properties": { "name": { "type": "string", "description": "Display name for the email address." }, "address": { "type": "string", "description": "Email address value." } }, "required": [ "address" ], "additionalProperties": false, "description": "Recipient email address." } }, "required": [ "emailAddress" ], "additionalProperties": false, "description": "Sender of the message." }, "from": { "type": "object", "properties": { "emailAddress": { "type": "object", "properties": { "name": { "type": "string", "description": "Display name for the email address." }, "address": { "type": "string", "description": "Email address value." } }, "required": [ "address" ], "additionalProperties": false, "description": "Recipient email address." } }, "required": [ "emailAddress" ], "additionalProperties": false, "description": "Mailbox owner and sender of the message." }, "toRecipients": { "type": "array", "items": { "type": "object", "properties": { "emailAddress": { "type": "object", "properties": { "name": { "type": "string", "description": "Display name for the email address." }, "address": { "type": "string", "description": "Email address value." } }, "required": [ "address" ], "additionalProperties": false, "description": "Recipient email address." } }, "required": [ "emailAddress" ], "additionalProperties": false, "description": "Recipient object returned by Outlook." }, "description": "Primary recipients." }, "ccRecipients": { "type": "array", "items": { "type": "object", "properties": { "emailAddress": { "type": "object", "properties": { "name": { "type": "string", "description": "Display name for the email address." }, "address": { "type": "string", "description": "Email address value." } }, "required": [ "address" ], "additionalProperties": false, "description": "Recipient email address." } }, "required": [ "emailAddress" ], "additionalProperties": false, "description": "Recipient object returned by Outlook." }, "description": "Cc recipients." }, "bccRecipients": { "type": "array", "items": { "type": "object", "properties": { "emailAddress": { "type": "object", "properties": { "name": { "type": "string", "description": "Display name for the email address." }, "address": { "type": "string", "description": "Email address value." } }, "required": [ "address" ], "additionalProperties": false, "description": "Recipient email address." } }, "required": [ "emailAddress" ], "additionalProperties": false, "description": "Recipient object returned by Outlook." }, "description": "Bcc recipients." }, "replyTo": { "type": "array", "items": { "type": "object", "properties": { "emailAddress": { "type": "object", "properties": { "name": { "type": "string", "description": "Display name for the email address." }, "address": { "type": "string", "description": "Email address value." } }, "required": [ "address" ], "additionalProperties": false, "description": "Recipient email address." } }, "required": [ "emailAddress" ], "additionalProperties": false, "description": "Recipient object returned by Outlook." }, "description": "Reply-to recipients." }, "flag": { "type": "object", "properties": { "flagStatus": { "type": "string", "description": "Follow-up flag status." }, "startDateTime": { "type": "object", "properties": { "dateTime": { "type": "string", "description": "Date and time value." }, "timeZone": { "type": "string", "description": "Time zone identifier for the date and time value." } }, "required": [ "dateTime", "timeZone" ], "additionalProperties": false, "description": "Follow-up start date and time." }, "dueDateTime": { "type": "object", "properties": { "dateTime": { "type": "string", "description": "Date and time value." }, "timeZone": { "type": "string", "description": "Time zone identifier for the date and time value." } }, "required": [ "dateTime", "timeZone" ], "additionalProperties": false, "description": "Follow-up due date and time." }, "completedDateTime": { "type": "object", "properties": { "dateTime": { "type": "string", "description": "Date and time value." }, "timeZone": { "type": "string", "description": "Time zone identifier for the date and time value." } }, "required": [ "dateTime", "timeZone" ], "additionalProperties": false, "description": "Follow-up completion date and time." } }, "additionalProperties": true, "description": "Follow-up flag details." } }, "required": [ "id" ], "additionalProperties": true, "description": "Outlook message resource." }, "nullable": false, "handle": "output" } ], "name": "Create an Outlook draft", "executor": { "kind": "connector", "action": "outlook.create_draft", "outputMode": "value" } } }, "n_2a8263d7116188eb": { "inputs": { "draft": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_1ba2c5b561bde4b0", "output": "output" } ] }, "name": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_cd2e056162fb4a6f", "output": "name" } ] }, "mimeType": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_cd2e056162fb4a6f", "output": "mimeType" } ] }, "contentBase64": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_cd2e056162fb4a6f", "output": "contentBase64" } ] } }, "name": "Prepare the attachment", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "@odata.etag": { "type": "string", "description": "Entity tag for the message." }, "id": { "type": "string", "description": "Message ID." }, "createdDateTime": { "type": "string", "description": "Timestamp when the message was created." }, "lastModifiedDateTime": { "type": "string", "description": "Timestamp when the message was last modified." }, "changeKey": { "type": "string", "description": "Change key for the message." }, "categories": { "type": "array", "items": { "type": "string", "description": "An array item." }, "description": "Categories applied to the message." }, "receivedDateTime": { "type": "string", "description": "Timestamp when the message was received." }, "sentDateTime": { "type": "string", "description": "Timestamp when the message was sent." }, "hasAttachments": { "type": "boolean", "description": "Whether the message has attachments." }, "internetMessageId": { "type": "string", "description": "Internet message identifier for the message." }, "subject": { "type": "string", "description": "Message subject." }, "bodyPreview": { "type": "string", "description": "Preview snippet of the message body." }, "importance": { "type": "string", "description": "Message importance." }, "parentFolderId": { "type": "string", "description": "Parent folder ID for the message." }, "conversationId": { "type": "string", "description": "Conversation ID for the message." }, "conversationIndex": { "type": "string", "description": "Conversation index for the message." }, "isDeliveryReceiptRequested": { "type": "boolean", "description": "Whether delivery receipts are requested." }, "isReadReceiptRequested": { "type": "boolean", "description": "Whether read receipts are requested." }, "isRead": { "type": "boolean", "description": "Whether the message is marked as read." }, "isDraft": { "type": "boolean", "description": "Whether the message is a draft." }, "webLink": { "type": "string", "description": "Web URL for the message in Outlook." }, "inferenceClassification": { "type": "string", "description": "Outlook inference classification for the message." }, "body": { "type": "object", "properties": { "contentType": { "type": "string", "description": "Message body content type." }, "content": { "type": "string", "description": "Message body content." } }, "required": [ "contentType", "content" ], "additionalProperties": false, "description": "Message body." }, "sender": { "type": "object", "properties": { "emailAddress": { "type": "object", "properties": { "name": { "type": "string", "description": "Display name for the email address." }, "address": { "type": "string", "description": "Email address value." } }, "required": [ "address" ], "additionalProperties": false, "description": "Recipient email address." } }, "required": [ "emailAddress" ], "additionalProperties": false, "description": "Sender of the message." }, "from": { "type": "object", "properties": { "emailAddress": { "type": "object", "properties": { "name": { "type": "string", "description": "Display name for the email address." }, "address": { "type": "string", "description": "Email address value." } }, "required": [ "address" ], "additionalProperties": false, "description": "Recipient email address." } }, "required": [ "emailAddress" ], "additionalProperties": false, "description": "Mailbox owner and sender of the message." }, "toRecipients": { "type": "array", "items": { "type": "object", "properties": { "emailAddress": { "type": "object", "properties": { "name": { "type": "string", "description": "Display name for the email address." }, "address": { "type": "string", "description": "Email address value." } }, "required": [ "address" ], "additionalProperties": false, "description": "Recipient email address." } }, "required": [ "emailAddress" ], "additionalProperties": false, "description": "Recipient object returned by Outlook." }, "description": "Primary recipients." }, "ccRecipients": { "type": "array", "items": { "type": "object", "properties": { "emailAddress": { "type": "object", "properties": { "name": { "type": "string", "description": "Display name for the email address." }, "address": { "type": "string", "description": "Email address value." } }, "required": [ "address" ], "additionalProperties": false, "description": "Recipient email address." } }, "required": [ "emailAddress" ], "additionalProperties": false, "description": "Recipient object returned by Outlook." }, "description": "Cc recipients." }, "bccRecipients": { "type": "array", "items": { "type": "object", "properties": { "emailAddress": { "type": "object", "properties": { "name": { "type": "string", "description": "Display name for the email address." }, "address": { "type": "string", "description": "Email address value." } }, "required": [ "address" ], "additionalProperties": false, "description": "Recipient email address." } }, "required": [ "emailAddress" ], "additionalProperties": false, "description": "Recipient object returned by Outlook." }, "description": "Bcc recipients." }, "replyTo": { "type": "array", "items": { "type": "object", "properties": { "emailAddress": { "type": "object", "properties": { "name": { "type": "string", "description": "Display name for the email address." }, "address": { "type": "string", "description": "Email address value." } }, "required": [ "address" ], "additionalProperties": false, "description": "Recipient email address." } }, "required": [ "emailAddress" ], "additionalProperties": false, "description": "Recipient object returned by Outlook." }, "description": "Reply-to recipients." }, "flag": { "type": "object", "properties": { "flagStatus": { "type": "string", "description": "Follow-up flag status." }, "startDateTime": { "type": "object", "properties": { "dateTime": { "type": "string", "description": "Date and time value." }, "timeZone": { "type": "string", "description": "Time zone identifier for the date and time value." } }, "required": [ "dateTime", "timeZone" ], "additionalProperties": false, "description": "Follow-up start date and time." }, "dueDateTime": { "type": "object", "properties": { "dateTime": { "type": "string", "description": "Date and time value." }, "timeZone": { "type": "string", "description": "Time zone identifier for the date and time value." } }, "required": [ "dateTime", "timeZone" ], "additionalProperties": false, "description": "Follow-up due date and time." }, "completedDateTime": { "type": "object", "properties": { "dateTime": { "type": "string", "description": "Date and time value." }, "timeZone": { "type": "string", "description": "Time zone identifier for the date and time value." } }, "required": [ "dateTime", "timeZone" ], "additionalProperties": false, "description": "Follow-up completion date and time." } }, "additionalProperties": true, "description": "Follow-up flag details." } }, "required": [ "id" ], "additionalProperties": true, "description": "Outlook message resource." }, "nullable": false, "handle": "draft" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "name" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "mimeType" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "contentBase64" } ], "outputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "id" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "endpoint" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "body" } ], "name": "Prepare the attachment", "moduleId": "n_d078496870cb1281", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_7d65117b441e6289": { "inputs": { "endpoint": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_2a8263d7116188eb", "output": "endpoint" } ] }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_2a8263d7116188eb", "output": "body" } ] } }, "name": "Attach the document", "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": "Attach the document", "executor": { "providerId": "outlook", "method": "POST", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "json", "kind": "connector-proxy" } } }, "n_c90ae5f6a65b6c03": { "inputs": { "statusCode": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_7d65117b441e6289", "output": "statusCode" } ] }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_7d65117b441e6289", "output": "body" } ] }, "id": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_2a8263d7116188eb", "output": "id" } ] } }, "name": "Confirm the attachment", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "id" } ], "outputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "id" } ], "name": "Confirm the attachment", "moduleId": "n_e69e682078a2dd95", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_b90dc9d843e54086": { "inputs": { "messageId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_c90ae5f6a65b6c03", "output": "id" } ] } }, "name": "Send the Outlook draft", "kind": "task", "task": { "inputs": [ { "description": "Outlook message ID.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Outlook message ID." }, "nullable": false, "handle": "messageId" } ], "outputs": [ { "description": "Whether the Outlook operation completed successfully.", "jsonSchema": { "const": true, "description": "Whether the Outlook operation completed successfully." }, "nullable": false, "handle": "success" } ], "name": "Send the Outlook draft", "executor": { "kind": "connector", "action": "outlook.send_draft" } } }, "n_5e340bb2d0978750": { "inputs": { "chatId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_f4cda2ec224e37a5", "output": "chatId" } ] }, "replyToMessageId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_f4cda2ec224e37a5", "output": "replyId" } ] }, "text": { "kind": "value", "value": "file is sent to kindle successfully!" } }, "name": "Confirm in Telegram", "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": "Confirm in Telegram", "executor": { "kind": "connector", "action": "telegram.send_message", "outputMode": "value" } } } }, "edges": [ { "source": "n_75253c578e44b640", "target": "n_f4cda2ec224e37a5" }, { "source": "n_f4cda2ec224e37a5", "target": "n_aa8fbebaf6dc4332" }, { "source": "n_aa8fbebaf6dc4332", "target": "n_cd1b00e772db8619", "sourceHandle": "otherwise" }, { "source": "n_aa8fbebaf6dc4332", "target": "n_dc34a5cd7ed96b41", "sourceHandle": "document" }, { "source": "n_dc34a5cd7ed96b41", "target": "n_4f6fc1e907b2994a" }, { "source": "n_4f6fc1e907b2994a", "target": "n_4fcb9a77e8301279" }, { "source": "n_4fcb9a77e8301279", "target": "n_cd2e056162fb4a6f" }, { "source": "n_cd2e056162fb4a6f", "target": "n_1ba2c5b561bde4b0" }, { "source": "n_1ba2c5b561bde4b0", "target": "n_2a8263d7116188eb" }, { "source": "n_2a8263d7116188eb", "target": "n_7d65117b441e6289" }, { "source": "n_7d65117b441e6289", "target": "n_c90ae5f6a65b6c03" }, { "source": "n_c90ae5f6a65b6c03", "target": "n_b90dc9d843e54086" }, { "source": "n_b90dc9d843e54086", "target": "n_5e340bb2d0978750" } ] } }, "modules": { "n_4a5c9061b29512fa": { "name": "Check the message and destination", "imports": [], "source": "export default function prepare({body,recipient}){\n const m=body?.message,d=m?.document;\n if(!m||(!Number.isSafeInteger(m.message_id)||m.message_id<=0)||!Number.isSafeInteger(m.chat?.id))throw Error('Telegram message has no chat or message ID');\n const base={chatId:String(m.chat.id),replyId:m.message_id,recipients:[recipient]};\n if(!d||typeof d!=='object'||Array.isArray(d))return {...base,hasDocument:false,fileId:'-',fileRequest:{},fileName:'',mimeType:'application/octet-stream'};\n if(typeof recipient!=='string'||!/^\\S+@\\S+\\.\\S+$/.test(recipient)||recipient.startsWith('YOUR_'))throw Error('Set the destination email address');\n if(typeof d.file_id!=='string'||!d.file_id)throw Error('Missing Telegram file ID');\n return {...base,hasDocument:true,fileId:d.file_id,fileRequest:{file_id:d.file_id},fileName:typeof d.file_name==='string'?d.file_name:'',mimeType:typeof d.mime_type==='string'&&d.mime_type?d.mime_type:'application/octet-stream'};\n}\n" }, "n_f2bafccf255ddc22": { "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_369907fd79bd8e46": { "name": "Download the document", "imports": [], "source": "import {Buffer} from 'node:buffer';\nexport default async function download({botToken,verified,reply,statusCode,fileId,fileName,mimeType},context){\n if(verified!==true||typeof botToken!=='string'||!/^\\d+:[A-Za-z0-9_-]+$/.test(botToken))throw Error('Verify the Telegram 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 Error('Telegram did not confirm a valid downloadable document');\n const name=fileName||path.split('/').at(-1);if(!name)throw Error('Missing document name');\n 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(typeof file.file_size==='number'&&(!Number.isSafeInteger(file.file_size)||file.file_size<0||file.file_size!==bytes.length))throw Error('Size mismatch');return {name,mimeType,contentBase64:Buffer.from(bytes).toString('base64'),mailBody:`This is a book named ${name} from telegram bot.`};}catch{throw Error('Telegram document download failed; no draft was created');}\n}\n" }, "n_d078496870cb1281": { "name": "Prepare the attachment", "imports": [], "source": "export default function attachment({draft,name,mimeType,contentBase64}){\n const id=draft?.id;if(typeof id!=='string'||!id)throw Error('Outlook did not confirm draft ID; inspect drafts before retrying');\n return {id,endpoint:'/me/messages/'+encodeURIComponent(id)+'/attachments',body:{'@odata.type':'#microsoft.graph.fileAttachment',name,contentType:mimeType,contentBytes:contentBase64}};\n}\n" }, "n_e69e682078a2dd95": { "name": "Confirm the attachment", "imports": [], "source": "export default function confirm({statusCode,body,id}){if(statusCode!==201||typeof body?.id!=='string'||!body.id)throw Error('Attachment not confirmed; inspect Outlook draft before retrying');return {id};}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }