https://dagster.io/ logo
#dagster-support
Title
# dagster-support
m

Matthias Queitsch

05/25/2022, 10:14 AM
Hi, is there a way how I can make to subgraphs dependent on each other? In the job i want to run graph1 before graph2. These are effectively the same graphs, just with different configurations.
dagster bot responded by community 2
🤖 1
i

Isaac Harris-Holt

05/25/2022, 10:35 AM
You could use the run_status_sensor (https://docs.dagster.io/concepts/partitions-schedules-sensors/sensors#run-status-sensors) to launch a new run via the GraphQL API (https://docs.dagster.io/concepts/dagit/graphql). This might be a slightly hacky workaround, but it should work
s

Stephen Bailey

05/25/2022, 11:29 AM
I thiiiiink you can have a dummy input to graph 2 that is supplied by Graph 1, like so:
Copy code
@graph
def g1():
   result = op1()
   return result

@graph
def g2(depends_on=None):
   op2()

@job
def two_graphs():
   result = g1()
   g2(result)
m

Matthias Queitsch

05/25/2022, 11:31 AM
ok, that might work. Currently, I want to reuse the same graph, just with different configs. AFAIK, there are not optional inputs for a graph. The first graph would not have an input at the start.
Btw: for this example I get the error of "unmapped input" . Dagster requires that I use the depends_on variable in an op or a graph....
@op
def launch():
# ...
@graph
def launch_graph():
launch()
@job(run_config=config)
def orchestrate():
launch_graph.alias("g1")()
launch_graph.alias("g2")()
In the run_config, I would configure the different launch commands. g1 need to run before g2 and not in parallel.
I got it to work somehow. I am just passing down that dummy value into the op and then don't use it. But still, I think there should be a more elegant way.
s

Stephen Bailey

05/25/2022, 1:46 PM
i think the only way to do order-based stuff is by passing in a dependency, so you might have to add the
depends_on
input to the op itself
oh, nice
starting to build an inception chain on this suggestion 🙂
m

Matthias Queitsch

05/25/2022, 1:48 PM
Hehe, thanks. I will keep an eye on that.
i

Isaac Harris-Holt

05/26/2022, 10:30 AM
Okay so I solved the problem like this:
Copy code
@op
def do_nothing(value):
    return

@graph(ins={'deps': In(Nothing)})
def my_graph(deps):
    do_nothing(deps)
    ...
2 Views