Workflow schedules set, but not firing
kbt149872
PRODUCTIssue
The scheduled workflow stops running.Symptoms
The enabled schedule is set in the workflow, but no instances are started.
There is a known issue where a running workflow schedule is not properly updated after the last run and causes subsequent instances to not fire according to the set schedule.
This scenario can occur when the ServiceID column for the Workflow schedule is stuck on a value not equal to 0. The following query can be run against the K2 Database to check on the workflow schedule properties:
SELECT si.[ID] as ScheduleInstanceID, [si].[ServiceID], [si].[ExecutionDate] , [s].[ID] as [ScheduleID], [s].[RecurenceTypeID], [s].[RecurencePatternID] , [s].[RecurenceRangeID], [s].[LastRunDate], [s].[SuccessfulCount], [s].[FailedCount] , [s].[Disabled], [s].[Name] , [rp].[Years], [rp].[Months], [rp].[Weeks], [rp].[Days], [rp].[Hours], [rp].[Minutes] , [rp].[Seconds], [rp].[EveryXDays], [rp].[EveryWeekDay] , [rp].[EveryXWeeks], [rp].[Sunday], [rp].[Monday], [rp].[Tuesday], [rp].[Wednesday], [rp].[Thursday], [rp].[Friday], [rp].[Saterday] , [rp].[DayX], [EveryXMonth], [WeekX], [DayType], [StartTime] , [rp].[YearEveryXMonth], [rp].[YearDayX], [rp].[YearWeekX], [rp].[YearDayType] , [rr].[StartDate], [rr].[EndDate], [rr].[Occurences] FROM [Eventbus].[ScheduleInstance] AS si INNER JOIN [Eventbus].[Schedule] AS s WITH (NOLOCK) ON si.ScheduleID = s.ID INNER JOIN [Eventbus].[RecurrencePattern] AS rp ON s.RecurencePatternID = rp.[ID] INNER JOIN [Eventbus].[RecurrenceRange] AS rr ON s.RecurenceRangeID = rr.[ID] ORDER BY si.ExecutionDate ASC;
Additional Script to check - IF the execution date is in the future it's good. Only the ones with an execution date in the past is problematic and can be reset.
SELECT * FROM [Eventbus].[ScheduleInstance] WHERE [ServiceID] > 0 AND GETDATE() > DATEADD(minute,1,[ExecutionDate])
Resolution
If the ServiceID is not equal to 0 for a scheduled workflow according to the above query, the following query can be updated and run to correct a specific workflow schedule:
Provide the ScheduleID of the workflow schedule that is not running:
Also see:
http://help.k2.com/onlinehelp/k2blackpearl/devref/current/default.htm#Database_Reference.html