Skip to main content

Copy File

Files & FoldersFilesWrites files

Copies a file to a specified destination while keeping the original file unchanged.

Inputs

NameTypeRequiredDefaultDescription
Source File
sourcePath
fileRequired
Destination File
destPath
fileRequired
Overwrite Existing
overwriteExisting
booleanOptionalfalse
Create Missing Folders
createMissingFolders
booleanOptionalfalse
Output Variable
outputVariable
variableOptionalCopyResult

Output

$outputVariableObject

Object describing the copy result. Reference {CopyResult.destinationPath}, {CopyResult.sourcePath}, {CopyResult.sizeBytes}, {CopyResult.overwritten}, or {CopyResult} alone (resolves to the destination path).

  • successBoolean
  • destinationPathString
  • sourcePathString
  • sizeBytesNumber
  • overwrittenBoolean
  • pathString

Compatibility

WindowsLinuxAttendedUnattended

When to use

Use Copy File to duplicate a file from one location to another while leaving the original in place: archiving inputs before processing, staging a file for another system, or fanning one document out to several folders.

  • Back up an input file before a workflow modifies it
  • Stage a report into a shared or network folder
  • Duplicate a template before filling it in

When not to use

  • To relocate a file (remove it from the source), use Move File.
  • To copy a whole directory tree, use a folder-level copy rather than looping this activity over every file by hand.

Best practices

  • Confirm the destination folder exists first (create it if needed) so the copy does not fail on a missing path.
  • Decide explicitly whether an existing destination should be overwritten, and set that behavior rather than relying on the default.
  • Use absolute paths, or resolve relative paths against a known base, so the activity behaves the same on every runner.

Common mistakes

  • Destination folder missing — copying into a path that does not exist.
  • Locked file — the source is open in another program and cannot be read.
  • Silent overwrite — replacing a file at the destination that you meant to keep.

FAQs

Does it overwrite an existing file? Depending on the overwrite setting — configure it to match your intent.

Can it copy across drives or network shares? Yes, as long as the runner's account has read access to the source and write access to the destination.

Related activities