Overview
The Documents plugin provides file encryption and decryption capabilities through Kafka messaging. This feature allows you to:- Encrypt files - Password-protect one or multiple files stored in the Documents plugin
- Decrypt files - Unlock password-protected files and extract contents from encrypted ZIP archives
Supported file types
When encrypting multiple files, they are automatically bundled into a password-protected ZIP archive. During decryption, ZIP archives are extracted and only files matching supported types are returned.
Prerequisites
Before using the encryption/decryption features, ensure:The Documents plugin is deployed and configured in your environment
Files are already uploaded to the Documents plugin (youβll need file IDs)
Kafka topics are properly configured
Kafka topics
The encryption and decryption operations use dedicated Kafka topics for communication between the FlowX Engine and the Documents plugin.Topic configuration
Encrypting files
Use file encryption to password-protect documents stored in the Documents plugin.How encryption works
- The plugin validates that all specified file(s) exist
- Validates that files are of supported types
- Downloads the file(s) from storage
- Creates a password-protected copy:
- Single file: Creates an encrypted copy with a new file ID
- Multiple files: Creates a ZIP archive containing all files, then password-protects the ZIP
- Returns the file ID of the encrypted document
Request message structure
Configure a Send Message Task node with a Kafka Send action to trigger file encryption. Topic: Use the encryption inbound topic (e.g.,ai.flowx.plugin.document.trigger.encrypt.file.v1)
Request body:
Response message structure
Configure a Receive Message Task node to receive the encryption result. Topic: Use the encryption outbound topic (e.g.,ai.flowx.engine.receive.plugin.document.encrypt.file.results.v1)
Response body:
Example: Encrypt a single file
1
Add a Send Message Task node
Configure a Kafka Send action with the encryption topic and the following message body:
2
Add a Receive Message Task node
Configure the node to listen on the encryption results topic to capture the encrypted file ID.
3
Store the encrypted file ID
Use the response
fileId for subsequent operations (e.g., sending via email, downloading).Decrypting files
Use file decryption to unlock password-protected documents and extract contents from encrypted archives.How decryption works
- The plugin validates that the specified file exists
- Validates that the file is of a supported type
- Downloads the file from storage
- Attempts to open the file:
- First tries without a password
- If that fails, uses the provided password
- If the file is a ZIP archive, extracts its contents
- Filters extracted files by supported types
- Uploads the resulting file(s) to storage
- Returns the file ID(s) of the decrypted/extracted files
Request message structure
Configure a Send Message Task node with a Kafka Send action to trigger file decryption. Topic: Use the decryption inbound topic (e.g.,ai.flowx.plugin.document.trigger.decrypt.file.v1)
Request body:
Response message structure
Configure a Receive Message Task node to receive the decryption result. Topic: Use the decryption outbound topic (e.g.,ai.flowx.engine.receive.plugin.document.decrypt.file.results.v1)
Response body:
When decrypting a ZIP archive, the response contains multiple file IDsβone for each extracted file that matches supported file types.
Example: Decrypt a password-protected file
1
Add a Send Message Task node
Configure a Kafka Send action with the decryption topic and the following message body:
2
Add a Receive Message Task node
Configure the node to listen on the decryption results topic.
3
Process the decrypted files
The response
fileIds array contains all successfully decrypted files. Use these IDs for further document processing.Error handling
Both encryption and decryption operations return descriptive error messages when issues occur.Common error scenarios
Example error response
Security considerations
Password handling
In the current version, passwords are transmitted in clear text. Ensure your Kafka communication is secured with TLS encryption.
File storage
Encrypted files are stored as new documents with unique file IDs. Original files remain unchanged.
Related documentation
Documents plugin overview
Learn about all Documents plugin capabilities
Documents plugin setup
Configure the Documents plugin in your environment
Uploading files
Upload files to the Documents plugin before encryption
Kafka Send action
Configure Kafka Send actions in your process

