dfd28f5b4a
Bug: When creating a draft from an activated workflow version, the draft row was inserted into the database without steps and trigger, then updated with them in a separate operation. The SSE create-one event fired on the INSERT, causing the frontend to refetch the draft before the UPDATE — resulting in steps: null and trigger: null, which crashed the step editor. Fix: Reorder the operations so steps are duplicated first, then either insert a new draft or update an existing one with steps and trigger already populated. The row never exists in the database without complete data.