Overview
A workflow is a YAML or JSON document containing step-based actions or tasks that must be performed by a processing engine. It aids development by providing a simple method of chaining discrete tasks without the need to write expansive functions. At the highest level in the workflow document are tasks and below it are the task’s arguments.
In the example workflow above, the first properties of the workflow document are two tasks named taskOne and taskTwo . Both tasks are of the log type and will print a line to the debug log. However, each task will print a unique message specified by it’s message argument value .
For the remainder of this document all workflow examples will be written in YAML as it provides a simpler syntax and the ability to use inline comments. YAML is available in DIRECT 6.1 or higher and older versions of DirectGVR must use JSON.
Chaining tasks
Tasks in a workflow can be chained together and processed. The workflow engine starts processing a task chain by specifying the first task it will run. The name of this task is also known as an entry point .Entry points
The following task names are reserved as specific workflow entry points.
Other Reserved Names
SubTasks
Every task can have a success , failure , and complete property that specifies what task should be run next based on the result of the current task. Some task types have additional properties that specify tasks to run. The example below which shows how the stringCompare task has an equalTo property that specifies the task to run when the two strings specified are equal to one another.Managing large workflows
In order to make large workflows easier to manage it is possible to split your tasks into multiple document files. As a requirement your workflow must first be in the YAML format which supports aninclude array at the root level that contains a list of files or URLs to merge in-to the current document.
Expandable strings
The workflow engine supports expandable strings which are evaluated at run-time. In addition to the core set of expandable strings, the workflow engine also supports these specific strings that are available in certain instances depending on the location specified for the workflow.Object expansion
Also unique to the workflow engine is the ability to target specific objects to handle string expansion. A target object might be the workflow itself or a particular task. The following keywords are supported that allow you to specify which object you wish to handle the expansion.
Examples
In the example below, the download task downloads a file specified by it’s url property. When the download is successful, it will the launch task which will launch the file specified by it’s parent task’s outputPath status property.
Tasks
Required arguments are bold in the arguments list. All tasks can have the following reserved arguments:Error handling
When a task has an error it will bubble up to all the tasks that ran before it unless the ignoreError task argument is set to true. Tasks are also bubbled up from one workflow to another when called through the workflowRun task.Task errors
All tasks can return the following errors:Platform errors
The following error codes are used throughout the workflow engine.Analytics
When configured in the client, analytics will be sent to the analytics server for routing. An event is queued and sent for each task that gets completed. It contains the following information:- Task name
- Task arguments dictionary
- Task status dictionary
- Elapsed time
- Completion/cancelled state
Task types
Below is a list of all the supported task types.aggregate
Queues a new task constructed from an existing task in the workflow (source) and arguments specified remotely or in the content property (target). Version: 5.1 Arguments:
Additional Notes:
- url or content arguments are required (not both)
- Only used in conjunction with url argument
- 5.2 - Added store argument
- 6.1 - Removed concurrentTasks argument
Changes:
- 5.2 - Removed Aggregate_Error_Request error
analytics
Add additional analytics properties to send for every event. Version: 5.1.9 Arguments:
Additional Notes:
- url or key/value orkeyValuePairs arguments are required (not all)
- 5.2 - Added global argument
certStoreLoad
Load a certificate store valid for this workflow only. Version: 5.2 Arguments:
Errors:
JWKS Documentation
Documentation of the file format can be found at https://auth0.com/docs/jwks
Thumbprint List Example:
Key is the friendly name of the thumbprint, value is a base64 encoded thumbprint (sha1, sha224, sha256, sha384, sha512 supported)
directoryCopy
Copies the contents of a directory from one location to another. Version: 5.1.8 Arguments:
Changes:
- 5.2 - Added overwrite argument
directoryCreate
Creates a directory on the file system. Version: 5.1 Arguments:
Example:
directoryMove
Moves the contents of a directory from one location to another. Version: 5.1.8 Arguments:
Example:
directoryDelete
Delete a directory from the file system recursively. If the specified directory does not exist, the task will succeed. Version: 5.1 Arguments:
Example:
directoryList
Enumerates a directory. Version: 5.2 Arguments:
Status Variables:
Example:
directoryExists
Check if a directory exists on the file system. Version: 5.1 Arguments:
Example:
directoryIsEmpty
Check if a directory is empty. Ignores shell browsing metadata files like .DS_Store, thumbs.db, and desktop.ini. Version: 5.1.3 Arguments:
Example:
directoryIsWritable
Check if a directory is writable by the current process. Version: 5.1.8 Supported OS:- Windows (not supported on UWP)
- macOS
- Linux
Example:
diskSpaceCheck
Checks the disk space on a certain path. Version: 5.1 Arguments:
Example:
dmgMount
Mounts an apple disk image. Version: 5.1 Supported OS:- macOS
Errors:
Example:
dmgUnmount
Unmounts an apple disk image. Version: 5.1 Supported OS:- macOS
Errors:
Example:
download
Downloads a file to disk. Version: 5.1.2 Arguments:
Status Variables:
Errors:
Changes:
- 5.2 - Added status variables
- active, skipped, activeTime, pauseTime, canPauseResume, supportResume, supportPause, supportSkip
- totalBytes, completeBytes, existingBytes
- responseCode, responseVersion, responseMessage, responseHeaders
- 5.2 - Added skipTimestamp, overwriteIfNewer, overwriteIfOlder, cookies, and maxRetries arguments
- 5.2 - Removed json and authenticateJson argument (use JSONRead task instead)
- 6.0.2 - Added allowHeadRequest argument
environmentGet
Gets an environment variable for the current process. Version: 6.1 Arguments:
Example:
environmentSet
Sets an environment variable for the current process. Version: 6.1 Arguments:
Additional Notes:
- key /value or keyValuePairs arguments are required (not both)
error
Sets an error for the current task chain. Alternatively sets the exit code without shutting down. Version: 5.1 Arguments:
Example:
fileAuthenticate
Authenticates the signature of a file on disk. Version: 5.1.3 Arguments:
Changes:
- 5.2 - Added store argument
fileCopy
Copies files from one location to another on disk. Version: 5.1 Arguments:
Changes:
- 6.1 - Added readOnly argument
fileDelete
Deletes a file from the file system. If the specified file does not exists, the task will succeed. Version: 5.1 Arguments:
Example:
fileExists
Check if a file exists on the file system. Version: 5.1 Arguments:
Example:
fileHash
Gets or compares the hash of a file on disk. Version: 5.1.3 Arguments:
Additional Notes:
- If expectedDigest is an empty string, the task will complete successfully without equalTo or notEqual sub-actions being called**.**
Changes:
- 7.0 - Removed MD2 & MD4 hash algorithms.
fileMove
Moves a file from one location on disk to another. Version: 5.1 Arguments:
Example:
jsonRead
Reads values from an json file. Version: 5.1.8 Arguments:
Additional Notes:
- path or url or content arguments are required (not both)
- key /value or keys arguments are required (not both)
- 5.2 - Added store argument
Errors:
Changes:
- 5.2 - Added content argument
- 5.2 - Added url argument
- 5.2 - Added JSON_Error_Parse error
jsonWrite
Adds or edits values in a json file. Version: 5.1.8 Arguments:
Additional Notes:
- key /value or keyValuePairs arguments are required (not both)
Example:
JSON:
implode
Deletes the executable for the current process after exiting. Version: 5.1.9 Supported OS:- Windows (not supported on UWP)
- macOS (does nothing)
- Linux (does nothing)
iniRead
Reads a value from an ini file. Version: 5.1 Arguments:
Additional Notes:
- key or keys arguments are required (not both)
- 7.2.108 - Added
escapeargument
Errors:
Example:
iniWrite
Writes a value to an ini file. Version: 5.1 Arguments:
Additional Notes:
- key /value or keyValuePairs arguments are required (not both)
- If the ini file exists, unicode arguement is ignored and the encoding of the existing file is used
- 7.2.108 - Added
escapeargument
Example:
interopLoad
Loads an interop library. Version: 5.1 Arguments:
Changes:
- 5.2: Added store argument
Example:
interopUnload
Unloads an interop library. Version: 5.1 Arguments:
Additional Notes:
- Must be the same value that was used for interopLoad.
Example:
launch
Launch an application. Version: 5.1 Supported OS:- Windows (not supported on UWP)
- macOS
- Linux
Status Variables:
Errors:
Example:
log
Logs a message to the debug log. Version: 5.1 Arguments:
Changes:
- 6.1 - Argument message supports array of strings
macro
Load macros from a JSON URL or javascript object. Version: 5.1 Arguments:
Additional Notes:
- url or key/value orkeyValuePairs arguments are required (not all)
- 5.2 - Added store, authenticate arguments
Changes:
- 5.2 - Removed Macro_Error_Request error
msi
Runs an MSI installer. Version: 5.1 Supported OS:- Windows (not supported on UWP)
Errors:
Example:
notification
Sends a NotificationCenter event. This task is useful for one-way communication between the workflow engine and the javascript or interop. For two-way communication consider a javascript or interop workflow task. Version: 5.2 Arguments:
Example:
workflow.yaml:
numberCompare
Compare two numbers. Version: 5.1 Arguments:
Example:
pkg
Runs a PKG installer. This task inherits the arguments of the launch task. Version: 5.1 Supported OS:- macOS
Example:
plistRead
Reads values from a property list file. Version: 5.1 Arguments:
Additional Notes:
- key /value or keys arguments are required (not both)
Errors:
Example:
plistWrite
Adds or edits values in a property list file. Version: 5.1 Arguments:
Additional Notes:
- key /value or keyValuePairs arguments are required (not both)
Example:
preferencesDelete
Delete a preferences key. Version: 8.0.52 Supported OS:- macOS
Errors:
Example:
preferencesExists
Check if a preferences key exists. Version: 8.0.52 Supported OS:- macOS
Example:
preferencesRead
Reads a preference. Version: 8.0.52 Supported OS:- macOS
Additional Notes:
- key /value or keys arguments are required (not both)
Example:
preferencesWrite
Adds or edits preferences. Version: 8.0.52 Supported OS:- macOS
Additional Notes:
- key /value or keyValuePairs arguments are required (not both)
- If the preferences location does not exist, it will be created
- If the preferences key already exists, it will be overwritten
Example:
processIsOpen
Checks to see if a program is running. Version: 5.2 (previously known as “programIsOpen” in 5.1) Supported OS:- Windows (not supported on UWP)
- macOS
Status Variables:
Additional Notes:
- path or id arguments are required (not both)
- 6.1 - Added id argument to search for process by id
processList
Enumerates processes. Version: 5.2 Arguments:
Status Variables:
Changes:
- 6.1 - Added path argument.
processOpen
Opens an executable, a file, or a url using the default editor. This task automatically downgrades the elevation rights to “User”. Version: 5.2 (previously known as “open” or “programOpen”) Supported OS:- Windows (not supported on UWP)
- macOS
Status Variables:
Errors:
Changes:
- 5.2 - Added path status variable.
- 7.1.45 - Added arguments.
- 8.0.76 - Added environmentVariables.
- 8.1.14 - Added displayErrors and allowMultipleInstances for macOS.
processClose
Closes a program based on its process id. Terminates after attempting to close a program gracefully. Version: 5.2 (previously known as “programClose” in 5.1) Supported OS:- Windows (not supported on UWP)
- macOS
- Linux
Changes:
- 6.1 - Added waitForClose argument
progress
Unified progress for multiple tasks. See the unified progress bar documentation. Version: 5.1queue
Queue of workflow tasks to run. Version: 5.1 Arguments:
Status Variables:
Additional Notes:
- When an action fails, no further actions are run.
- 5.2 - Added totalActions, runningActions, completeActions, currentAction status variables
- 6.1 - Removed concurrentTasks, runningActions
registryKeyCreate
Create a registry key. Version: 5.1 Supported OS:- Windows (not supported on UWP)
Errors:
Changes:
- 7.0 - Remove support for macOS
registryKeyDelete
Delete a registry key or registry value. Version: 5.1 Supported OS:- Windows (not supported on UWP)
Errors:
Changes:
- 6.1 - Support multiple views
- 7.0 - Remove support for macOS
- 7.1 - Added value argument
registryKeyExists
Check if a registry key exists. Version: 5.1 Supported OS:- Windows (not supported on UWP)
Changes:
- 6.1 - Support multiple views
- 7.0 - Remove support for macOS
registryKeyRead
Reads registry keys. Version: 5.1 Supported OS:- Windows (not supported on UWP)
Additional Notes:
- key /value or keys arguments are required (not both)
- 6.1 - Support multiple views
- 7.0 - Remove support for macOS
Example:
registryKeyWrite
Adds or edits registry keys. Version: 5.1 Supported OS:- Windows (not supported on UWP)
Additional Notes:
- key /value or keyValuePairs arguments are required (not both)
- If the registry location does not exist, it will be created
- If the registry key already exists, it will be overwritten
Changes:
- 6.1 - Added onlyIfExists argument
- 7.0 - Remove support for macOS
repository*
The following arguments are shared among the repositorySync/repositoryCheck/repositoryErase tasks. Arguments:
Additional Notes:
- Setting cleanup to false also disables file deletion during patch application
- 7.2 - Added authenticate argument to all repository tasks
Phases container
Configure progress status/weighting based on the current phase of a download
Phase Container
Example:
Storage container
In the workflow, storage containers are local , backup , pending and remote .
Status Variables:
It’s recommend to rely only on the top level items, items in the sub levels are for internal usage and debugging.
repositoryCheck
Checks to see if an existing repository needs to be updated. Version: 5.1 Arguments:
See Repository Configuration documentation for additional information.
Changes:
- 5.2 - Added store argument
repositoryErase
Erase an existing repository. Version: 5.1 Arguments: See Repository Configuration documentation for additional information. Example:repositoryFileCheck
Checks to see if an existing repository needs to be repaired by examining the existance, size, and modified timestamp of the files on disk. Version: 5.1.9 Arguments:
Errors:
Example:
repositorySync
Updates an existing repository. Version: 5.1 Arguments:
See Repository Configuration documentation for additional information.
Additional Notes:
- Tasks with repair enabled will ignore the source and mask fields if returned by the catalog file, so that whole pieces are used to repair the filesystem and no pieces are skipped.
- 5.2 - Added store argument
restorePoint
Sets a restore point. Version: 5.1.8 (previously known as “restorePointBegin”) Supported OS:- Windows (elevation required, not supported on UWP)
Notes:
- Starts the restore point before the actions are executed. If any of the actions fails, the restore point is cancelled. If all the actions succeed, then the restore point ends.
Example:
shortcutCreate
Creates a shortcut. Version: 5.1 Supported OS:- Windows (not supported on UWP)
- Linux
Errors:
Example:
shortcutDelete
Deletes a shortcut. Version: 5.1 Supported OS:- Windows (not supported on UWP)
- Linux
Errors:
Example:
shutdown
Stops further tasks from being run. Version: 5.1 Arguments:
Example:
singleton
Prevents launching concurrent tasks across multiple workflows. Version: 6.1 Supported OS:- Windows (not supported on UWP)
- macOS
- Linux
Example:
skinFileExtract
Extracts a file from the skin to disk. Version: 6.1 Supported:- Only available in the DirectGVR Client (host).
Example:
sleep
Waits for a specified amount of time. Version: 5.1 Arguments:
Example:
status
Updates the status for a specific object in the workflow. Version: 5.1 Arguments:
Example:
stringCompare
Compare two strings. Version: 5.1 Arguments:
Example:
stringContains
Check if one string contains another. Version: 5.1 Arguments:
Example:
unzip
Extracts a zip archive to disk. Version: 5.1 Arguments:
Status Variables:
Changes:
- 5.2 - Added password argument for encrypted archives
- 5.2 - Added support for AES encrypted archives
urlRedirect
DEPRECATED: This task can cause a naming conflict if the beginsWith parameter matches another beginsWith parameter in this or a separate workflow. Redirection should be configured in the webget section of the host configuration. Redirects one URL to another. Version: 5.1 Arguments:
Additional Notes:
- beginsWith /append or beginsWith /replace arguments are required (not all).
urlRedirectMacro
DEPRECATED: This task can cause a naming conflict if the key parameter matches another key parameter in this or a separate workflow. Macros should be configured in the webget section of the host configuration. Adds a custom macro to the URL redirection subsystem to be used by the urlRedirect task. Version: 5.1.8 Arguments:
Additional Notes:
- key/value orkeyValuePairs arguments are required (not all)
versionCompare
Compares two version numbers. A version number contains up to 4 numbers separated by periods or commas representing major, minor, release and build numbers. A version number string an optionally begin with the letter v. Example of a switch key usage: application.exe /action uninstall /key value Version: 5.1 Arguments:
Example:
wmi
Queries the Windows Management Instrumentation service. Version: 5.1.3 Supported OS:- Windows (not supported on UWP)
Additional Notes:
- key or keys arguments are required (not both)
Example:
workflowRun
Runs a separate workflow.1 Version: 5.1 Arguments:
Additional Notes:
- This task is not supported in the self-update workflow apply entry point.
- To ensure that macros are passed from an unelevated to an elevated workflow properly, the load entry point task must be a macro task. Otherwise, any macros passed from an unelevated to an elevated workflow may be overwritten by tasks further down the load entry point task chain in the elevated process.
- 5.2 - Added store argument
Errors:
Example:
xmlRead
Reads values from an xml file. Version: 5.1 Arguments:
Additional Notes:
- path or url arguments are required (not both)
- key /value or keys arguments are required (not both)
Errors:
Changes:
- 5.2 - Added url argument
- 5.2 - Added Xml_Error_Parse error
xmlWrite
Adds or edits values in a xml file. Version: 5.1 Arguments:
Additional Notes:
- key /value or keyValuePairs arguments are required (not both)
Example:
Xml:

