The Close Document node instructs Photoshop to close the currently active file.
This node is especially important when processing multiple images (for example, within a For Each loop) to prevent your workspace from becoming cluttered with hundreds of open tabs and consuming too much system memory.

Key Settings
The node features a single, crucial setting in its interface: the “Save changes?” dropdown.
- No (Discard): Closes the file without saving any modifications. This is the most common and recommended setting if you have already exported your work using a Save Document node earlier in the chain.
- Yes (Save): Overwrites the original file with any changes made during the workflow before closing it.
How to connect it
- Placement: Add the node at the very end of your editing sequence.
- Input Port (Left): Connect this port to your final action step (such as a Save Document or Transform node).
- Important Note for Loops: If you are using a For Each node, the Close Document node must be connected within the active “Loop” path. This ensures that every file is closed individually after it has been processed. Do not connect it to the “Done” port.
Under the Hood
- Smart Fallback: If complex workflow actions (like reverting the document history) corrupt the internal file reference, the node uses a fallback mechanism to force-close the currently active tab.
- Memory Cleanup: After successfully closing a document, the node automatically clears the workflow’s internal memory to ensure a clean slate for the next file in a batch process.
