[CDF-25101] 🪲 Fix/workflow version dependency ordering (#1730)

# Description

FYI: Tried to solve this task with an agent #1728, but failed, thus
going for this manual approach instead.

## Changelog

- [x] Patch
- [ ] Minor
- [ ] Skip

## cdf

### Fixed

- When running `cdf deploy`, Toolkit now accounts for the dependencies
between workflow versions.

## templates

No changes.
