Send Photo
Sends a photo to a Telegram chat. Supports both local file paths and URLs, with optional captions and reply functionality.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Input
- Client Id - (Optional) The unique identifier for the bot client connection obtained from the Connect node. If not provided, you can use Bot Token instead.
- Chat Id - The target chat identifier where the photo will be sent. Can be:
- A user's Telegram ID (e.g.,
123456789) - A group chat ID (e.g.,
-987654321) - A channel ID (e.g.,
-1001234567890)
- A user's Telegram ID (e.g.,
- Photo Url or Path - The photo source. Can be:
- A local file path (e.g.,
C:\Users\John\Pictures\photo.jpg) - A URL to an image (e.g.,
https://example.com/image.jpg)
- A local file path (e.g.,
Options
- Bot Token - (Optional) The Telegram bot token credential. This is an alternative to using Client Id - provide either Client Id OR Bot Token.
- Reply Id - (Optional) The message ID to reply to. If specified, the photo will be sent as a reply. Default:
0(no reply). - Caption - (Optional) Text caption for the photo. Supports up to 1024 characters and can include formatting.
Output
- n/a - No output
How It Works
The Send Photo node sends an image to a specified Telegram chat. When executed, the node:
- Either uses the provided Client Id or creates a temporary connection using Bot Token
- Validates the Chat Id and Photo Url or Path
- Determines if the input is a URL or file path
- For URLs: Uses Telegram's FromURL method to send the image directly
- For file paths: Reads the local file and uploads it to Telegram
- Applies the optional caption if provided
- If Reply Id is provided, sends the photo as a reply to that message
- Returns success or error based on the API response
Requirements
- Either a valid Client Id from a Connect node OR a valid Bot Token credential
- A valid Chat Id where the bot has permission to send photos
- For file paths:
- The file must exist and be readable
- Supported formats: JPG, PNG, GIF, BMP, WEBP
- Maximum file size: 10 MB
- Recommended resolution: Up to 1280×1280 pixels
- For URLs:
- The URL must be publicly accessible
- Must point directly to an image file
- Same size and format limitations apply
Error Handling
The node will return errors in the following cases:
- Empty or invalid Chat Id
- Empty or invalid Photo Url or Path
- File not found (for local paths)
- File too large (over 10 MB)
- Unsupported image format
- URL not accessible or not pointing to an image
- Bot doesn't have permission to send photos to the chat
- Network connectivity issues
- Telegram API errors
Usage Examples
Send Local Photo:
Connect
→ Send Photo (
Chat Id: 123456789,
Photo Url or Path: "C:\Reports\chart.png"
)
→ Disconnect
Send Photo from URL:
Send Photo:
Chat Id: 123456789
Photo Url or Path: "https://example.com/image.jpg"
Caption: "Here's the image you requested"
Send Photo with Caption:
Send Photo:
Chat Id: 123456789
Photo Url or Path: "/tmp/screenshot.png"
Caption: "Screenshot taken at 10:30 AM"
Reply with Photo:
Receive Message
→ Send Photo (
Chat Id: message.chat.id,
Reply Id: message.message_id,
Photo Url or Path: "/path/to/response.jpg"
)
Supported Image Formats
- JPG/JPEG - Most common, good compression
- PNG - Supports transparency
- GIF - Static images (use Send Animation for animated GIFs)
- BMP - Uncompressed format
- WEBP - Modern format with good compression
Use Cases
Automated Reporting:
Generate Chart
→ Save as PNG
→ Send Photo (chart to manager)
Visual Notifications:
Trigger (on alert)
→ Take Screenshot
→ Send Photo (to monitoring channel)
Product Catalog Bot:
Receive Message (product query)
→ Search Database
→ Send Photo (product image with caption)
Image Processing:
Receive Message (with photo)
→ Download File
→ Apply Filters
→ Send Photo (processed image)
Daily Reports:
Schedule (daily at 9 AM)
→ Generate Report Chart
→ Send Photo (to team channel with summary caption)
Best Practices
- Optimize image size - Compress images to under 1 MB for faster uploads
- Use appropriate formats - JPG for photos, PNG for graphics with transparency
- Add captions - Include context to make photos more meaningful
- Validate paths - Check that files exist before attempting to send
- Handle URLs carefully - Verify URLs are accessible and point to images
- Use absolute paths - Always use full paths for local files
- Test with small files first - Verify your flow works before sending large images
- Consider privacy - Be careful with sensitive images
File Path Examples
Windows:
C:\Users\John\Documents\report.png
D:\Images\photo.jpg
\\NetworkShare\Photos\image.png
Linux/Mac:
/home/user/documents/report.png
/tmp/screenshot.jpg
~/Pictures/photo.png
URL Examples
https://example.com/images/photo.jpg
https://cdn.example.com/static/image.png
https://api.example.com/files/12345.jpg
Caption Formatting
Captions support the same formatting as Send Message:
MarkdownV2:
*Bold* _italic_ `code` [link](https://example.com)
HTML:
<b>Bold</b> <i>italic</i> <code>code</code>
Note: Set Parse Mode in the caption if you want formatting (this requires additional configuration).
Common Patterns
Send Multiple Photos:
For Each (imagePath in imageList)
→ Send Photo (Chat Id: chatId, Photo Url or Path: imagePath)
→ Delay (1 second) // Avoid rate limits
Photo with Dynamic Caption:
let caption = `Report for ${date}
Total: ${total}
Status: ${status}`;
// Use in Caption field
Conditional Photo Sending:
If (reportType == "visual")
→ Send Photo (chart image)
Else
→ Send Message (text report)
Error Handling:
Try {
Send Photo (local file)
}
Catch {
Send Photo (backup URL)
}
Image Quality Tips
- Resolution: Keep under 1280×1280 for optimal display
- File Size: Aim for under 1 MB for quick uploads
- Aspect Ratio: Telegram preserves aspect ratio
- Compression: Use 85-90% quality for JPG to balance size and quality
- Thumbnails: Telegram automatically generates thumbnails
Telegram Display Behavior
- Photos are displayed inline in the chat
- Users can tap to view full-size
- Photos show previews in chat list
- Captions appear below the photo
- Photos can be saved by users (unless Protect Content is used in Forward)
Troubleshooting
File Not Found:
- Verify the file path is correct and absolute
- Check file permissions
- Ensure the file hasn't been moved or deleted
Upload Fails:
- Check file size (must be under 10 MB)
- Verify image format is supported
- Test with a smaller image
URL Not Working:
- Ensure URL is publicly accessible
- Check that URL points directly to image file
- Try downloading the URL manually to verify
Poor Quality:
- Use higher resolution source images
- Choose appropriate format (PNG for graphics, JPG for photos)
- Avoid re-compressing already compressed images
Tips
- Telegram automatically creates multiple sizes for efficient loading
- Photos sent by URL are downloaded by Telegram's servers, not your bot
- Local files are uploaded from your machine
- For multiple photos, consider using a photo album (requires multiple Send Photo nodes)
- Caption length is limited to 1024 characters (vs. 4096 for regular messages)
- You can edit captions after sending using Telegram's edit message API
- Photos preserve EXIF data unless removed before sending
- Animated GIFs should use Send Animation node instead