Site Workflow Schedule

  • 10 December 2015
  • 5 replies
  • 7 views

Badge +6

Hi,

Is it possible to schedule a site workflow more frequently than every 1 hour?


5 replies

Userlevel 7
Badge +17

Not by the available settings, but possible using PowerShell. Use the windows scheduler and powershell script that starts site workflows. Or create a timer job that starts workflows, you can use an application page for configuration.

Badge +7

Hi Jason,

You could try creating multiple schedules for the same workflow, just tried this with a very simple site workflow and it seems to work. Change the start time so that it's different for each schedule. The following schedules would run every 30 minutes for example.

154534_pastedImage_2.png

154533_pastedImage_1.png

Jan

Userlevel 7
Badge +17

Is there a way to do this without having to hard code the time? otherwise we could set a schedule to 1 minute if we create enough schedules.

Badge +7

I'm just wondering whether you could use the workflow.asmx StartSiteWorkflow method called from PowerShell, if I get time I'll have a play with this.

Badge +7

Yes you can start a site workflow easily using PowerShell, see code snippet below:

$username = "adminaccount" 
$password = "adminpassword" 
$domain = "mydomain"  
$siteURL = "http://mynintexsite"

$wsUrl = $siteURL + "/_vti_bin/NintexWorkflow/Workflow.asmx?WSDL" 
$proxy = New-WebServiceProxy -Uri $wsUrl 
$proxy.Credentials = new-object System.Net.NetworkCredential($username, $password, $domain) 
[xml]$response = $proxy.StartSiteWorkflow('My site workflow name','')

You could then schedule this script to run more frequently than hourly. You'd probably need to add some logic to prevent the workflow starting again if it was already running though.

Jan

Reply