Database Reader Dependency

Hi all,

I have created a workflow with several, separate pipelines within it.  What is the right way to make a Database Reader depend on the execution of a Database Writer, and run sequentially only after it has completed?

I'm using this design because the database table into which I want to write requires that it is able to auto-generate IDs.  In order to do this I first write into a temp table (with no ID column) and then use the Database Reader node to do an INSERT INTO Postgres SQL statement that allows for the IDs to be automatically created.

Thanks in advance for any help.




Hi Jeremy, You can add a dependency by connecting those two nodes via the variable ports. Those need to be enabled within the node context menu "Show/Hide Flow Variable Ports". Simply draw a connection from the right "Micky Mouse" ear of the Database Writer to the left ear of the Database Reader node.

Thanks for the super-speedy reply!  One more follow-up - what's the right way to make the Reader dependent on mulitple Writer nodes?  Looks like variable ports only allow 1:1.

You could use a merge variables node (or daisy-chain several if you need to) to merge the variable ports from all your writers, and then connect the final output to your reader.

Alternatively, connect the variable output of one writer to the input of the next, and so on, until they all are joined, and then the last one to the reader.  This way, the writers will only execute sequentially, which sometimes helps depending on your database setup.