Conditional actions in Transactions

Is it possible someone could explain or demo this idea using Codeless blocks?

Specifically, we would like to run a transaction where we 1) find objects with a where clause, then 2) if there are none found, create an object, and then finally 3) set a relation for the 1st object in the list of “find” results OR the newly created object from step 2.