Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Clean up Workflow History

Posted on by 80

Hi,

I would like to know if there is a way to clean up the Workflow History, because the table WorkflowTrackingTable has 3 Gb and WorkflowTrackingCommentTable has 2 Gb in the DB.

Thank you

*This post is locked for comments

  • Suggested answer
    Dick Wenning Profile Picture
    Dick Wenning 8,705 on at
    RE: Clean up Workflow History

    use command like this

    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);

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Clean up Workflow History

    Hi,

    There is no standard process that meets this need but I think that you can delete WorkflowTrackingStatusTable table, but with conditions.

    You can not delete records with TrackingStatus 'Pending' or 'Cancelled'. This table has a type cascade DeleteAction with WorkflowTrackingTable table, and WorkflowTrackingTable too with WorkflowTrackingCommentTable table.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Clean up Workflow History

    Hello,

    Have you ever got an answer on this? We're facing a problem in our TEST and DEV environments where the workflow tables are bloated with rows of useless information. The workflow history form can not be opened because it freezes.

    Tried to do a delete directly on the WorkflowTrakingStatusTable and it hangs forever.

    Regards,

    Eric

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans