Force Order Of Operations



How do I force one function or command to execute before another?

I have a script where I create some elements based on some existing elements. Then I want to erase the existing elements. What is happening is that the way the graph is executed the elements get deleted before the new elements get created. Is there a way to tell Dynamo the order of operation?



for now, you can do this using using function.compose().

each function you pass into function.compose() will be called in order from top to bottom.

Are you interacting with revit? If so you’ll want to use transact.end() inside of your functions that you pass. You can make make a set of custom nodes for each operation you want to do, and put them all into function.compose in order you need them to execute.

The resultant value of the first function will be the input to the next one in the chain.


this thread might help you:



I appreciate your response. I have been using this, but my problem is that the three functions do not necessarily operate on the same objects. The last step is to delete that objects that I used as a basis of creating new objects.

I will look at it and see if I missed something.



Rafael, I haven’t tried this yet, so this is pure speculation but another approach may be to create a chain of functions by using list operations like so:



I know this post is over a year old but I am just starting to jump into Dynamo. I have created a new node and am struggling with executing them in order. Can someone please help me sort this out? Thanks!


Hello Christopher,

At present you’re probably running into recursion issues. You’re trying to simultaneously delete room tags and create new ones.

Generally with Dynamo it will pick the first graph it picks up (creators/openers) and run through the wires, node by node.

In this case the simplest option is to make 2x graphs, or alternately explore the methods outlined above.


Thank you for the fast response. I have saved as Custom Notes and thought I was passing correctly but I get the following…

Deleting and Adding Tags Error


Hi Christopher,

I have an extremely simple but very powerful node called “Input.Wait” and the only thing it does, is wait for a task to finish before continuing. It will not work for your case, because you’ll first need to add an empty input to your “Add Room Tags” node.





















You can chain multiple dummy nodes together to have a fine control of the flow of events. And if necessary, you can even add additional outputs that will be completed from top to bottom order. Try it out and tell me if it works:


Automatically Deleting 3D Views

But the Add Room Tags node doesn’t allow for an input…


That’s why I suggested you add a new dummy input just like I did with “WaitForMe” inside the “Input.Wait” CN :slight_smile:

It’s crude but so far, it’s been working great for me.


I think that will work. I’m having another issue because I don’t want to have to set the view to delete from or add to each time.


Hi @Christopher_Fernande

I am having a similar issue, did you find a way to solve this???

If you did could you share the result for the functions to perfom


My goto solution when showing this sort of stuff to people is to delay the second functions input until after the first function finishes. A code block like this will allow for this.


Only question is where it slots into your overall graph. Can you post your current graph?


Hi Dimitar

Could you please tell me the name of the package in which Input.Wait node is?



Clockwork has one. Works the same as the codeblock solution I noted above.