Implementing a Zapier like workflow orchestrator represented by a DAG with Temporal

Hi, I am trying to build a Zapier like low-code drag and drop automation runner.
I am thinking on building that with Temporal.
One issue I have is that since temporal runs like code it is represented by a tree (function calls).
Meanwhile for a low-code service I would like to create nodes that accept input from several nodes, which is easier to represent as a DAG.
E.g node C gets inputs from both node A and node B and then does A+B.
In code the order would be reversed, I would do the following:
def C():
a=A()
b=B()
return a + b

but A and B can be in completely different paths of the DAG, so how would I represent a DAG created by a user drag and drop in Temporal? What if the call graph can have loops in it?

I understand that this question may be a bit detached, but that’s my use-case.

Would be happy for any help :slight_smile:

1 Like

You model your DAG as an object graph, not functions. Something like:

A a = new A();
B b = new B();
C c = new C(a, b)

DAG dag = new DAG(a, b, c);
dag.execute();

In the real workflow, you are not going to hardcode the instantiation of the DAG but rather parse it from the DSL document created through UI.

Here are examples of DSL workflows in Java, Go, Python, Typescript.

2 Likes