> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# diffFiles

> Compares two text files and writes a unified or HTML diff report to the reports folder, FD REPORTS DIR . Use this operation in pre deploy workflows wh

Compares two text files and writes a unified or HTML diff report to the reports folder, `FD_REPORTS_DIR`. Use this operation in pre-deploy workflows when you need a line-level comparison between a source file and a target file (for example, comparing CSV exports or other text artifacts) before deployment continues.

When **Set Review Required** is enabled and differences are found, the workflow output `FD_REVIEW_REQUIRED` is set to `true`. In a pre-deploy workflow, that output signals FlexDeploy that human review is required before the deploy proceeds.

This operation compares existing file paths only; it does not export packages from FlexDeploy File Package Manager.

# Inputs

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Input Name**</th><th>**Input Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Source File Path</td><td>`FDFILE_INP_SOURCE_PATH`</td><td>Yes</td><td>Path to the left/source file to compare.</td></tr><tr><td>Target File Path</td><td>`FDFILE_INP_TARGET_PATH`</td><td>Yes</td><td>Path to the right/target file to compare.</td></tr><tr><td>Reports Subfolder</td><td>`FDFILE_INP_TARGET_SUBFOLDER`</td><td>No</td><td>Optional sub-folder under the reports directory for the diff report.</td></tr><tr><td>Report File Name</td><td>`FDFILE_INP_DIFF_REPORT_NAME`</td><td>No</td><td>Optional report file name. Defaults to source-vs-target with `.diff` or `.html` extension.</td></tr><tr><td>Report Format</td><td>`FDFILE_INP_DIFF_FORMAT`</td><td>No</td><td>Diff report format: `unified` (default) or `html`.</td></tr><tr><td>Set Review Required</td><td>`FDFILE_INP_SET_REVIEW_REQUIRED`</td><td>No</td><td>When true and differences are found, sets the `FD_REVIEW_REQUIRED` workflow output to true. Enable this when using `diffFiles` in a pre-deploy workflow so review can be required before deploy.</td></tr></tbody></table>

# Outputs

<table><colgroup><col /><col /><col /></colgroup><tbody><tr><th>**Output Name**</th><th>**Output Code**</th><th>**Description**</th></tr><tr><td>Lines Added</td><td>`FDFILE_OUT_LINES_ADDED`</td><td>Number of lines added in the target file relative to the source file.</td></tr><tr><td>Lines Removed</td><td>`FDFILE_OUT_LINES_REMOVED`</td><td>Number of lines removed from the source file relative to the target file.</td></tr><tr><td>Review Required</td><td>`FD_REVIEW_REQUIRED`</td><td>Set to `true` when **Set Review Required** (`FDFILE_INP_SET_REVIEW_REQUIRED`) is enabled and differences are found between the source and target files. Intended for use in pre-deploy workflows so FlexDeploy can require human review before deployment continues. Remains unset or not true when the files match or when Set Review Required is disabled.</td></tr></tbody></table>

# Endpoint Selection

This operation delegates endpoint selection to the workflow developer. The workflow editor will default the selection to "All", which selects all available endpoints associated to the Target. Selecting a specific resource will result in selection of endpoints associated to the Target which have that resource defined.

# Endpoint Execution

This operation delegates endpoint execution to the workflow developer. The workflow editor will default to "Any", which will execute on any one of the selected endpoints, which will be randomly picked from selected endpoints or a specific endpoint where previous step may have executed. Changing this value to "All" will result in execution on all selected endpoints.
