You can string together multiple functions to form a workflow.

g = Graph(start_node=my_function, name="my_workflow", description="My workflow")
g.add_edge(my_function, my_function1)
g.add_edge(my_function, my_function2)

In the above example, my_function is the start node of the workflow. The input to the workflow is passed to my_function.

Workflows are exposed as HTTP endpoints, the body of the request will be passed to the start node of the workflow, in this case my_function.

curl -X POST https://api.tensorlake.com/workflows/my_workflow \
  -H "Content-Type: application/json" \
  -d '{"data": "Hello, world!"}'

Invoking Graphs

Retrieving Output

Tensorlake workflows allow retrieving the outputs of any function in the workflow.

from tensorlake import RemoteGraph

g = RemoteGraph(name="my_workflow")

g.outputs(my_function1)