Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Workflow history cleanup

(0) ShareShare
ReportReport
Posted on by 50

Hi All,

Let me post another query regarding with AX2009 workflow. Is there anyway to clean up the workflow history? We are not sure how many tables we have to look at. 

We are reluctant to do that because we are having a lot of workflow error (deadlock, fail to find workflow, duplicate workflow steps, etc). So, we are afraid that deleting records from workflow table would make more orphanage records in WorkflowMessageTable.

If you have any idea or experience, kindly share as we are facing the same issue everyday with our AX09 clients.

thanks.

Regards,

Yuan

*This post is locked for comments

  • Suggested answer
    Riaz Ahmad Profile Picture
    104 on at
    RE: Workflow history cleanup

    Run batch job Administration > Periodic > Notification clean-up and include this job as a part of your maintenance plan.

  • krishna.rao@dax Profile Picture
    2,953 on at
    RE: Workflow history cleanup

    Test the below script with limited lines and proceed if it works.

    delete_from WorkflowTrackingStatusTable

    where WorkflowTrackingStatusTable.TrackingStatus ==    

                     WorkflowTrackingStatus::Completed &&

                        WorkflowTrackingStatusTable.WorkflowType ==

                                WorkflowTrackingStatusWorkflowType::Workflow &&

                       WorkflowTrackingStatusTable.modifiedDateTime <

                               DateTimeUtil::addMonths(DateTimeUtil::utcNow(),-3);

    delete_from WorkflowTrackingStatusTable

    where WorkflowTrackingStatusTable.TrackingStatus ==

                     WorkflowTrackingStatus::Cancelled &&

              WorkflowTrackingStatusTable.WorkflowType ==  

                     WorkflowTrackingStatusWorkflowType::Workflow &&

             WorkflowTrackingStatusTable.modifiedDateTime <

                    DateTimeUtil::addMonths(DateTimeUtil::utcNow(),-3);

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics AX (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 100 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 48

#3
shanawaz davood basha Profile Picture

shanawaz davood basha 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans