Download File
Provides a file download widget for users in chat interfaces.
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.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Session Id - Unique identifier for the UI client connection.
- File Path - Path to the file to be downloaded.
- Label - Optional label for the download widget.
- Description - Optional description for the download widget.
Options
- File Name - Optional custom name for the downloaded file.
- Button Text - Optional custom text for the download button.
Output
- None (this is a display-only widget)
How It Works
The Download File node creates a widget that allows users to download a file. When executed, the node:
- Validates the provided Session ID and File Path
- Checks that the session is not in conversational mode
- Retrieves app, instance, and run IDs from the session
- Gets an upload link for the file
- Reads and uploads the file data
- Creates a download file widget with the specified label, description, and button text
- Sends the widget to the client with the specified session ID
Requirements
- A valid session ID for an active client connection
- Valid file path to an existing file
- Properly configured client interface that can handle download file widgets
- Session must not be in conversational mode
- Valid app, instance, and run IDs in the session
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid Session ID
- Session not found for the provided ID
- File Path is required but not provided
- File Path is empty
- Cannot use download file in conversational mode
- App ID, Instance ID, and Run ID are required but missing
- Failed to get instance access
- Failed to get upload link
- Failed to read file
- Failed to upload media
- Failed to send widget to client
Usage Notes
- The Session ID must match an active client connection
- The File Path must point to an existing file accessible by the system
- The Label and Description fields are optional but can help users understand what file they're downloading
- The File Name option allows you to specify a different name for the downloaded file
- The Button Text option allows you to customize the text on the download button
- Download file widgets cannot be used in conversational mode