Decrypt files with PGP

Description

The Decrypt Files With PGP action can be used to decrypt files.

GnuPG package must be installed in the runtime environment and encryption keys added to the runtime user keystore for this to function.

Options

General tab

Option Description

Action name

The name of the workflow action.

GPG location

The file path of the GnuPG executable (e.g. /usr/bin/gpg).

Include Subfolders

Also processes the files in the subfolders of a source folder.

Copy previous results to args

Take the files from the result rows of the previous action instead of from the list. The fields are read by position: file/folder source, wildcard, passphrase, file/folder destination.

File/Folder source

The file to decrypt, can be added to the Files/Folders list using Add.

File/Folder destination

The destination of the decrypted files.

Wildcard

A regex wildcard.

Passphrase

The passphrase of the private key the files are encrypted for.

Files/Folders

The files to decrypt.

Destination file tab

Option Description

Destination file

Create destination folder

Whether or not to create the destination folder.

Destination is a file

Whether or not the destination is a file.

Do not keep folder structure

Writes the files of subfolders directly in the destination folder. When unchecked, the subfolders of the source are kept in the destination.

Add date to filename

Adds the date to the file name.

Add time to filename

Adds the time to the file name.

Specify Date time format

Whether or not to specify the date time format.

Date time format

The format of the date time.

Add date before extension

Before or after extension.

If destination file exists

What to do when the destination file already exists. Delete source file deletes the source and leaves the destination unchanged. Move source file to folder leaves the destination unchanged and moves the source into Destination folder. Do nothing leaves an existing file unchanged.

  • Do nothing (default)

  • Overwrite destination file

  • Create file with unique name

  • Delete source file

  • Move source file to folder

  • Fail

Move to folder

Destination folder

The destination folder.

Create folder

Whether or not to create the folder.

Add date

Adds the date.

Add time

Adds the time.

Specify format

Whether or not to specify the date time format.

Add date before extension

The format of the date time.

If file exists in destination folder

Used with Move source file to folder, when the file already exists in Destination folder:

  • Do nothing (default)

  • Overwrite file

  • Unique name

  • Fail

Advanced tab

Option Description

Success On

Success condition

Which condition to validate for a successful run

  • Success when all works fine (default)

  • Success when at least x files decrypted

  • Success when number of errors lesser than

Nr errors lesser than

The limit used by the success condition: the number of errors, or the number of files for Success when at least x files decrypted (default 10).

Result files name

Add files to result files name

Adds the decrypted files to the result files. See Result.

Result

What this action passes on to the next action. See Action results for how results travel through a workflow.

Result Value

True

Depends on Success condition (Advanced tab):

  • Success when all works fine (default): no file failed. An empty Files/Folders list, no file matching the wildcard, or Copy previous results to args without previous result rows is also true.

  • Success when at least x files decrypted: at least Nr errors lesser than files were decrypted, whatever the number of errors.

  • Success when number of errors lesser than: the number of errors is at most Nr errors lesser than. When an entry of the list brings the errors to that number and entries are left, the action stops and is false; when the last entry does, the action is still true.

False

The success condition is not met. A file or an entry of the list fails, and counts as an error, when its source doesn’t exist, the passphrase is wrong, the file is not encrypted, or the destination file exists and If destination file exists is Fail. It is also false, before any file and whatever the success condition, when If destination file exists is Move source file to folder while Destination folder is empty, or doesn’t exist and Create folder is unchecked. With Success when all works fine or Success when number of errors lesser than, the action stops once the condition is broken: the remaining files are not processed.

Errors

The number of files and entries that failed. Inside a folder, the action stops once the success condition is broken, and that failure counts as one error. A GPG location that is empty or not found counts as 1 error, before any file: the action is false with Success when all works fine and Success when at least x files decrypted, and true with Success when number of errors lesser than.

Result files

With Add files to result files name, the decrypted file is added. That includes a file that did not exist yet, whatever If destination file exists says, because that option only applies when the destination already exists. When it does, the written file is added for Overwrite destination file and Create file with unique name (the new file). Move source file to folder adds the moved source, not the existing destination. Delete source file, Do nothing and Fail add nothing. The result files of the previous action are kept.

Result rows

Passed on unchanged.

Lines written

The number of files decrypted. Delete source file counts the deleted source and does not write the destination. A source moved to a new name is not counted; overwriting or giving a unique name to a file that already exists in Destination folder counts that file. A file left in place by Do nothing, and a file rejected by Fail or by If file exists in destination folder set to Fail, is not counted. When the check of Destination folder (Move to folder) fails, or the action stops on the success condition between two entries of the list, the value of the previous action is passed on.

The decrypted file keeps the name of the source file: a.txt.gpg becomes a.txt.gpg in the destination folder.
A GPG location that is empty or not found counts as 1 error, before any file. The action is false with Success when all works fine and Success when at least x files decrypted, and true with Success when number of errors lesser than (the default limit is 10). When the action is false, the error hop is followed. The workflow itself keeps running.
Delete source file deletes the source and leaves the existing destination unchanged. Move source file to folder leaves the existing destination unchanged and moves the source into Destination folder.
When the destination file exists, Create file with unique name writes the decrypted file under a new name, with the date and time added after the file name (for example a.txt.gpg30102026_140548429), and Do nothing keeps the existing file and doesn’t decrypt the source.