Transactions in Dynamo, struggling with operation timing

Seems like these nodes are hard to find good information on since everything with Transaction pulls up Revit Transaction info.

i have a script that uses a Clockwork node and simply traces area lines to room boundaries or vice versa, then using Archi-labs Delete.Elements to clean up whichever the person is switching from/to. (Long story, don’t knock the horrid technique, it’s to fix a ongoing problem they’ve been doing for months!)

I have a Transaction.Start and Stop in place, but every other time I open and run the script it will fail. I simply switch the locations of my Transaction.Start/Stop and run it again (After a Revit Undo) and it works perfect.
This tells me I’m not using transactions properly, so I’m pausing the operation every other time I execute it, but I’m struggling to figure out how and where to use the Transactions. Any help here how I can control the delete AFTER the lines have been created by the Clockworks node?

I would add a passthrough node (also from Clockwork) to connect the left side of your graph to the right side. Sounds like you’re running into a classic race condition. By adding the passthrough node, it will ensure that the left side of your graph finishes executing before the right side begins.

It failed too, same problem. Tried it. Here’s a better image of my transaction locations, I thought the built in screenshot tool allowed zoom.

I take that back! Again, I had it in the wrong place, seems reliable now! Thanks! I wouldn’t of looked at it again without mention.