Friday, August 1, 2025

AX 2012 - Failed to find workflow

 We recently had an issue where our workflow batch job would fail with this error.  Other workflows would be partially run but not fully due to the failure.  For example, if you approved a workflow it would show the approval in the 'Workflow history' but it wouldn't advance the workflow.  It would just sit in review.

The solution turned out to be pretty easy. I found this blog post

Run this query to get a RecId of the corrupted record:

Select a.RECID 
FROM SYSWORKFLOWMESSAGETABLE a 
WHERE a.ROOTCORRELATIONID 
NOT IN(Select b.ROOTCORRELATIONID from SYSWORKFLOWTABLE b) 
and a.MESSAGELIFECYCLESTATE = 1

Run this query to update the record found:

Update SYSWORKFLOWMESSAGETABLE 
Set MESSAGELIFECYCLESTATE = 2 
where RECID = [RecId from above]

That's it!


No comments:

Post a Comment