This feels like it should be possible. But I've not managed to find out how just yet.
To achieve this via the desktop application it's simple;
I want to achieve this programmatically because the data that is entered as part of Step 1 will be created on the fly.
Not possible at time of writing - https://github.com/jgraph/drawio-desktop/issues/591
Update "this was recently fixed since v20.7.4 (github.com/jgraph/drawio-desktop/issues/…) – Exodus 4D"