The workflow now deletes branches from both merged and closed pull requests older than 7 days, not just merged ones. This helps keep the repository cleaner by removing stale branches associated with closed PRs as well.