# ask-community

Madhu D

08/30/2023, 6:56 AM
Hi Team, I was trying to implement a specific use case that I have and have run into a blocker and would appreciate it if anyone can point me in the right direction with respective documentation links: The details of the use case are as follows: We have a sample project structure as below: Project_main_dir | |--ops | | | | | |--graphs | | | | | |--nestedgraphs | | | | | |--jobs | Setup: The and has the ops tied together as per the dependency that we need, to ensure the order of execution of the ops in a specific manner. These and are invoked inside the graph and each of them returns an output to variables say graph1_op and graph2_op. The in turn invokes graphs from the and wherein each of them returns outputs to variable say nestedgraph1_op and nestedgraph2_op. Expectation: I want to ensure that graph1_op and graph2_op to be returned together from to job1, and when the job1 runs, a dependency be created between nestedgraph invocations in such a way that only after the ops related to the generation of nestedgraph1_op(generating both graph1_op and graph2_op) are executed, the execution of ops related to nestedgraph2 should start. The pseudo code for the above scenario is something like below, please note that the nestedgraph and job files are generated programmatically on the basis of some input json: imports .... @op def op1(): ...op1 logic return op1_op imports .... @op def op2(): ...op2 logic return op2_op imports .... @graph def graph1(): op1_op = op1() return op1_op imports .... @graph def graph2(): op2_op = op2() return op2_op imports .... @graph def nestedgraph1(): graph1_op = graph1() graph2_op = graph2() return graph1_op, graph2_op imports ... @job def job1(): x, y = nestedgraph1() nestedgraph2([x, y]) Problem: I am facing an issue in establishing the dependency on both x, y for nestedgraph2 invocation, currently the dependency maps to either graph1_op or graph2_op when I explore the job through the dagit UI and I am assuming it is because that particular graph output was generated first and mapped by dagster automatically. Also, as per my use case the nestedgraph1 graph can return more than 2 outputs as well and in such a case, I want to ensure the dependency on all of the outputs of nestedgraph1 before invoking nestedgraph2 inside the job1. Thanks for the help in advance!