PowerShell Workflow Complete Template

@{
    #* A workflow will only work with the following version of 
    #*   kenaflow. After you tested your workflow with a new 
    #*   version of kenaflow you can change the following 
    #*   setting. 
    Version = "4.0";

    #* set it to $true to ENABLE the workflow. ($false DISABLES it)
    Enabled = $false; 
    
    #* Type = SHAREPOINT, EMAIL, PowerShell
    Type = "POWERSHELL";
        
    #* set it to a meaningful name
    Name = "<<wfname>>"; 
    
    #* a unique (!) id (type 'System.Guid') for this workflow. 
    #*   must be unique in YOUR environment. Use 
    #*   "[guid]::newGuid().tostring('d')" to create a GUID in 
    #*   Powershell. 
    Id = "<<wfid>>"; 
    
    #* A list of one or more files that are checked during deserialization.
    #*   The workflow configuration is reserialized if such an additional
    #*   file was modified since last serialization or is missing.
    #AdditionalConfigFiles = @();

    #* option. can be used to specify the folder where the 
    #*   workflow scripts are in. the workflow directory (where 
    #*   the _wfconfig.ps1 is in) is used if empty. 
    #ScriptFolder = ""; 
    
    #* "Time between execution" => minimal time difference IN 
    #*   SECONDS between two executions of the workflow Make sure 
    #*   you set TBE > 0 to activate time-based execution. First 
    #*   TBE is checked and afterwards CRON if set. 
    TBE = 60; 
    
    #* CRON-style pattern for execution scheduling. Please 
    #*   consult our documentation to get more infos on that. 
    #Cron = "0 * * * *"; 
    
    #* During a time based workflow run the same workflow 
    #*   should start also on another kenaflow server (in case of 
    #*   scaling). If your really sure that you want to run 
    #*   multiple instances of the same workflow than you can set 
    #*   this to $FALSE. 
    #Locking = $true;    
    
    #* This can be used to specify one or more custom 
    #*   PowerShell libariy files that will be executed before 
    #*   workflow script execution. 
    #CustomLibrary = @(""); 
    
    #* Here you can specify a script for error handling. It's 
    #*   processed in case of exceptions within the workflow 
    #*   script. Please read 
    #*   https://doc.kenaflow.com/basics/errorhandling 
    #ErrorHandlingScript = "errorHandling.ps1"
        
    #* Can be used to mark this workflow as "in debug" for use 
    #*   with cmdlet Get-KFInDebug -WorkflowDebugState 
    #Debug = $false; 
    
    #* This file will be serialized for performance reasons. 
    #*   You can prevent serialization by setting this option.
    #NoSerializing = $false;
    
    #* This file will be serialized for performance reasons as 
    #*   long as property 'NoSerializing' is not set to $true. 
    #*   But you can specify a "maximum lifetime" here. if this 
    #*   amount of time elapsed the workflow configuration gets 
    #*   re-serialized. Possible values are TimeSpan (object or 
    #*   string) or amount of seconds (int or string) 
    #MaxLifetimeOfSerialization = "0:5" #5 minutes
    
    #* If set to $false the workflow will continue with the 
    #*   next item on workflow script errors. Default ist $true 
    #*   ("stop workflow on script errors") 
    #StopWorkflowOnScriptError = $true; 

    #* Can be uses to define default config entries that will 
    #*   be deployed to the config list if the workflow config 
    #*   list is created by kenaflow (kenaflow.exe) 
    ConfigListDefaults = @{
        "kenaflow" = "cool"
    }; 

    #* List of mail addresses that will receive mails in case 
    #*   of workflow internal errors. 
    AlertAddresses = @(); 
    
    #* can be used to overwrite the global settings.
    #AlertFloodProtection = 3600; 
    
    #* Address of the sender of mails that the workflow sends. 
    #*   If empty it will be taken from the kenaflow global 
    #*   config 
    #MailFrom = ""; 
    
    #* Address to which uses can reply to. If empty it will be 
    #*   taken from the kenaflow global config 
    #MailReply = ""; 
    
    #* This script contains all to workflow actions
    #Script = "script.ps1";
            
    #* After this amount of time elasped the workflow execution 
    #*   will be stopped; -1 = use default 
    #MaxExecutionTime = -1;     

    #* Specified whether the Workflow needs Remote Event 
    #*   Receiver to execute the workflow scripts immediately 
    #*   after a change in SharePoint. 
    RER = $false; 
    
    #* Specifies how long a Remote Event is valid before it is 
    #*   skipped forever (if not processed). Default: 
    #*   configuration in global config. There is default: 120s. 
    #MaximumRerLifetime = 120;
    
    #* Specifies how long a a remote event is postponed in case 
    #*   of errors during processing. Default: configuration in 
    #*   global config. There is default: 5s. 
    #PostponeFailedRer = 5;
    

    #* +++++++++++++++++++
    #*   runtime settings
        
    #* (only) kenaflow Cmdlets will throw Exceptions on failure 
    #*   ($true) or hide them ($false). In the last case the 
    #*   exception can be queried with Get-KFLastResult. Default 
    #*   is $true 
    #ThrowErrorsPreference = $true; 
    #* This is the default for the common PowerShell variable 
    #*   $ErrorActionPreference that controls the default 
    #*   PowerShell error handling. Default is "Stop". This can 
    #*   be overwritten by Invoke-Kenaflow -ErrorActionPreference 
    #*   <value> or in script using $ErrorActionPreference = 
    #*   <value> 
    #ErrorActionPreference = 'Stop';
    
    #* +++++++++++++++++++
    #*   debug settings 
        
    #* if not specified here the default setting from kenaflow 
    #*   will be used. 
    #writeMailsToDiskDuringDebug = $true;
    
    #* if not specified here the default setting from kenaflow 
    #*   will be used. 
    #alwaysWriteMailsToDiskInsteadSending = $false; 
    
    #* can be used to redirect all mails to the specified 
    #*   account(s) 
    #redirectAllMails = @(); 
    
    #* this parameter can be used to force client processes 
    #*   (--exec) to send PowerShell output serialzied to the 
    #*   main proces (--run) Default: $false
    #SendOutputToMainProcess = $false;
    
    #* this will dump RER file contents to the Log. 
    #DumpRerEventDataToLog = $false

    #* It is possible to save processed remote event files. 
    #*   Normally they are deleted. Saving can be enabled in the 
    #*   global configuration but must be also enabled for each 
    #*   workflow itself by setting this property to $TRUE. 
    #*   Default: $FALSE 
    #SaveRerEventsAfterProcessing = $false
}

if(!$kenaflow){import-module "<<directory>>\kenaflow.runtime.dll";Test-KFConfig;exit}

Discussion

Discussion