Merge Files
The Merge Files component combines multiple input files into a single consolidated file. It supports PDF, DOCX, TXT, and image files and accepts files through DataFrames, File Inputs, or Select Files. The total size of all input files must not exceed 10 MB.
Note: This component is currently in Beta version.
Parameters
| Parameter | Description |
|---|---|
| DataFrame | Specifies a DataFrame containing the file paths to be merged. |
| Number of Files to Merge* | Specifies the number of file inputs to generate. The minimum value is 2. |
| Select Files | Allows you to select or upload multiple files for merging. |
| Source File Name | Specifies the name of the merged output file. |
| File Type | Specifies the File Manager category where the merged file is uploaded, such as KB or Default. |
| Skip Unsupported Files |
Specifies whether unsupported, missing, empty, or corrupted files should be skipped. Enabled – Invalid files are skipped and reported in the output. Disabled – The component throws an error when an invalid file is encountered. |
| Merge in Original Format |
Specifies whether files should be merged while preserving their original format. Enabled – Files are merged in their original format. Disabled – Files are converted to PDF and merged as a PDF. When enabled, all input files must have the same supported format. If files have different formats, the component throws an error. To merge files with different formats, disable this option. |
| Timeout (Seconds) | Specifies the maximum time, in seconds, allowed for the merge operation and related API requests to complete before the operation times out. |
| Retry Count | Specifies the number of times the component retries the merge operation when an execution attempt fails. Default: 1. |
| Delay Between Retries (Seconds) | Specifies the time, in seconds, to wait between consecutive retry attempts. Default: 1 second. |
| Delay Before Execution (Seconds) | Specifies the time, in seconds, to wait before the component starts processing the input files. Default: 0 seconds. |
| Delay After Execution (Seconds) | Specifies the time, in seconds, to wait after the component completes the merge operation. Default: 0 seconds. |
| Continue on Error |
Determines how the workflow proceeds when an unrecoverable error occurs. Stop Workflow – Stops workflow execution. Continue – Skips the current step and continues workflow execution without passing the error downstream. Continue Using Error Output – Continues workflow execution and routes the error details through the error output handle. |
Input File Limit
The Merge Files component supports the following file formats: PDF, DOCX, TXT & Images. The total size of all input files must not exceed 10 MB.
When you increase the Number of Files to Merge, corresponding file inputs such as File 1, File 2, and additional file inputs are generated. You can provide a file path directly or connect a file-producing component to the corresponding input.
File Input Methods
The Merge Files component provides three ways to provide files for merging:
a. DataFrame: Use the DataFrame parameter to provide a DataFrame containing the file paths to be merged. When a valid DataFrame is provided, the file paths in the DataFrame are used as the input files for the merge operation.
b. File Inputs: Use the dynamically generated File 1, File 2, and additional file inputs to provide files individually. The number of file inputs is determined by the Number of Files to Merge parameter. Each input can receive a file path directly or a file from another component.
c. Select Files: Use Select Files to select or upload multiple files directly through the component.
Unsupported Files
When Skip Unsupported Files is:
Enabled: Unsupported, missing, empty, or corrupted files are skipped, and the skipped files are reported in the output.
Disabled: The component throws an error when an invalid file is encountered, and the merge operation does not continue with the invalid file.
Merge in Original Format
The Merge in Original Format option controls how the input files are merged.
Enabled: The input files are merged while retaining their original supported format.
Disabled: The input files are converted to PDF and merged into a single PDF.
When Merge in Original Format is enabled, all input files must be in the same format. For example, multiple DOCX files can be merged into a DOCX file, while multiple TXT files can be merged into a TXT file.
If the input files contain different formats, the component throws an error. To merge files with different formats, disable Merge in Original Format so that the files are converted to PDF before merging.
Outputs
| Output | Description |
|---|---|
| Message | Returns the execution summary of the merge operation, including success, warning, or error information. |
| Data | Returns detailed information about the merge operation, including merged file details, processing statistics, skipped file information, and execution status. |
| DataFrame | Returns the merge results in a tabular format for use by downstream workflow components. |
Tool Mode
Tool Mode allows the Merge Files component to be used as a tool by an AI agent. The agent can invoke the component when it needs to merge files and provide the required files at runtime instead of relying only on files configured in the workflow.
Using Merge Files in Tool Mode
1. Configure the Merge Files component as a tool for the agent.
2. Specify the Number of Files to Merge to define the number of file inputs required.
3. During execution, provide the files through either:
a. Select Files – Select or upload the files to be merged.
b. File Inputs – Provide files through File 1, File 2, and any additional generated file inputs.
4. The component validates the input files and the 10 MB total size limit.
5. The component merges the provided files according to the Merge in Original Format setting.
6. The merged file is uploaded to the configured File Type location in the Robility Flow File Manager.
7. The merge results are returned through the configured outputs.
For example, an agent can be configured to merge documents provided during a user interaction. The agent invokes the Merge Files tool and supplies the required files through the available file inputs. The component validates and processes the files, generates the merged output according to the configured format, uploads it to the File Manager, and returns the merge results to the agent.
Note: The DataFrame parameter is not available in Tool Mode. Tool Mode supports Select Files and File Inputs for providing files to the component.