web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Clean up Workflow History

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Community Member Profile Picture
    on at

    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

  • Community Member Profile Picture
    on at

    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.

  • Suggested answer
    Dick Wenning Profile Picture
    8,705 Moderator on at

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

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans