Share all details related to your problem, including any error messages you may have received.
We have the older long running Pending task in the Active task which is running from last more than 1 year.
We need to clean up those objects from the Active task as of now we are deleting those objects from debug or deleting the workflow case from debug.
I need to have one Custom rule created for same so that we can run that rule on ad hoc base to clear those. Can someone provide the idea how it can be implemented.
The easiest way is to just go to Debug page - find WorkflowCases associated with this tasks end remove them - if you just want to do the cleanup.
I would however recommend you to check why this tasks are pending so long - check on which step of the workflow they stuck because maybe there is some approval missing or some manual action which when done will close this task results.