Find all orphan nodes

That’s fine.

Change this mutation to this

upsert {
  query {
    v as q(func: uid(0x45e2a8)) 
  }

  mutation {
    delete {
      uid(v) * * .
    }
    set {
      uid(v) <deleted> "" .
    }
  }

So now you can “recycle” it in a new upsert block.