In the latest update of K2, there is now a management portal and one of the key new features of this is the ability to schedule workflows. Which up to now was only available if you had K2 for SharePoint , Appit or if you could decipher the K2 Scheduler API. Your only other option was to write a windows service that would call your scheduled workflow.
How to access the K2 Management portal
The K2 management portal can be accessed from here http://[k2servername]/Management
The management portal replaces the management console found in the K2 Work space, but doesn’t replace the work space completely.
The K2 Scheduler lives under ‘Workflow Server’ heading in the menu on the left. Expanding ‘Workflow Server’ you have a number of different options. The one we are after is ‘Schedules’ which is the fourth one down.
Schedules
Clicking on Schedules shows a list of currently scheduled workflows and the ability to ‘Add’, ‘Edit’ and ‘Delete’ scheduled workflows from the scheduler
Creating a new scheduled workflow
To create a new scheduled workflow follow the following steps
- Click on ‘Schedules’
- Click on ‘New’
- A form will pop up, for you to fill in
- Enter a name of what the scheduled workflow will be called
- Enter a description
- Enabled is checked by default
- Next enter the name of the workflow you want to schedule, either by entering it’s full name or by clicking on the search button to search for it
- Once you have found the desired workflow, it’s process data fields will load up and up have the option to populate them with values
- The folio can also use the date and time as default or can be edited with a value
- Now if we scroll down the form, we can now tell the scheduler when it should run
- Under pattern, we can choose what the scheduling pattern should be
Pattern
|
Description
|
---|---|
Once | K2 will schedule the workflow to run just once on a certain day and time
|
Daily | K2 will schedule the workflow to run every weekday or intervals of days. It also has a start date and time and can be configured to end after a number of occurrences or by a end date and time
|
Weekly | K2 will schedule the workflow to run at least once a week on a certain day. It also has a start date and time and can be configured to end after a number of occurrences or by a end date and time
|
Monthly | K2 will schedule a workflow to run at least once a month, in monthly intervals. It has the ability to schedule a workflow to start on the last or first day of the month or first / last day of the week. It also has a start date and time and can be configured to end after a number of occurrences or by a end date and time
|
Yearly | K2 will schedule the workflow to run at least once on a particular month. It has the ability to schedule a workflow to start on the last or first day of the month or first / last day of the week. It also has a start date and time and can be configured to end after a number of occurrences or by a end date and time
|
Interval | With intervals, you can tell K2 to schedule a workflow to start by minutes, hours, days,months and years.It also has a start date and time and can be configured to end after a number of occurrences or by a end date and time
|
12. Click on ‘Ok’, the scheduled workflow is now scheduled to start at it’s selected interval.
13. From here you can see when it last ran, whether it has been successful or failed and also the ability to enable and disable the scheduled workflow
With K2 releasing the Scheduler in the management portal, this means we can now build some interesting workflows that relies on scheduling of workflows to perform autonomous daily tasks. Such as sending out daily emails to a subscription list.