Site 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 = "SHAREPOINT";
    
    #* SubType 
    #*   if "SHAREPOINT" then ALL, LASTMODIFIED (alias LIST), 
    #*   QUERY, SITE, STATEMACHINE if "EMAIL" then 
    #*   EXCHANGE2007SP1, EXCHANGE2010, EXCHANGE2010SP1, 
    #*   EXCHANGE2010SP2, EXCHANGE2013, EXCHANGE2013SP1, 
    #*   EXCHANGE, EXCHANGEONLINE, POP3, IMAP if "POWERSHELL" => EMPTY
    SubType = "SITE";
    
    #* set it to a meaningful name
    Name = "<<wfname>>"; 
    
    #* what SharePoint do you use? Possible values: "sp2013" or 
    #*   "sp2016" or "sp2019" or "spo" 
    Platform = ""; 
    
    #* 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
    
    #UserProfileCacheLifetime = 60; #In seconds. If not specified the global setting from kenaflow.conf is used
    
    #* Force workflow script to run again in case of "version 
    #*   conflict" (parallel item modifications in SharePoint). 
    #*   Default: $false 
    #RetryOnVersionConflict = $false; 
    
    #* 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; 
    
    
    #* The following two parameters can be used to specify credentials
    #*   however it is possible to store credentials in a 
    #*   protected fashion using the parameters --setusername 
    #*   and --setpassword on kenaflow.exe while running the 
    #*   program inside a workflow folder that contains 
    #*   _wfconfig.ps1. this will create a file 
    #*   _wfconfig-cred.ps1 that contains encrypted credentials. 
    #*   the credentials can only decrypted on the same machine. 
    #*   on other machines the file is worthless. 
    #spUser = "";
    #spPwd = '';
    
    #* only if platform is 'spo' = SharePoint Online
    #spoAppId = ""; 
    #* only if platform is 'spo' = SharePoint Online
    #spoAppSecret = ''; 
    
    #* You can execute a SharePoint 
    #*   workflow on multiple webs (and multiple lists if 
    #*   workflow types *list* and *state machine*). The executed 
    #*   workflow script is always the same. All other settings 
    #*   are identical (names of lists such as error list or data 
    #*   list). If you configure this property you cannot 
    #*   configure `Web` and `AlternateWebUrls` in parallel. 
    <#
    Connection = @(
      @{ 
        Web = "https://firstweb.sharepoint.farm"; 
        AlternateWebUrls = @();
      },
      @{ 
        Web = "https://secondweb.sharepoint.farm"; 
        AlternateWebUrls = @();
      }
    )
    #>
    
    #* Full URL to the SharePoint web where the workflow list 
    #*   is in 
    Web = ""; 
    
    #* A list of alternate URLS, e.g. if a web application has 
    #*   Alternate Access Mappings. Remove Events could be 
    #*   received with such an alternate URL 
    #AlternateWebUrls = @();
    
    #* a list for global config values
    ConfigList = "WFconfig"; 
    
    #* a list that can be used to store data
    DataList = "WFData"; 
    
    #* a list that can be used to record log information
    HistoryList = "WFHistory"; 
    
    #* Workflow errors will be stored in this SharePoint list
    ErrorList = "WFErrors";
        
    #* 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;
    

    #* Some item permission related Cmdlets in workflows can 
    #*   simply set "CRUD" +M (Manage) +A (Approve) permissions 
    #*   by specifying some characters from set [C, R, U, D, M, 
    #*   A]. They refer to permission set that the Site 
    #*   Collection administrator has to create. They must also 
    #*   be named here 
    #PermissionSetCreate="";
    #PermissionSetRead="";
    #PermissionSetUpdate="";
    #PermissionSetDelete="";
    #PermissionSetManage="";
    #PermissionSetApprove="";
    
    
    #* +++++++++++++++++++
    #*   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