Closed coltmcnealy-lh closed 1 week ago
I started the implementation on this commit here: https://github.com/littlehorse-enterprises/littlehorse/commit/7517105b7c39d34d4cb254c8a385528a37fa226d
However, there are problems:
Workflow
We now have output type information on a TaskDef
and UserTaskDef
. We can add it for an ExternalEventDef
, which would mean that (with LH API access) we would be able to infer the output type of all nodes.
If the WfSpec builder SDK had access to a GRPC client, then we could simply fetch the required metadata from the server in order to compile it.
We plan to enable better stacktraces and error handling by validating in-line during the compilation rather than just letting the LH Server return an error message with only node names. The only way to do that is to make the SDK call the LH API during node definition time (eg. WorkflowThread#execute()
) and validate each step there. This would allow users to have a stacktrace from the specific line that caused a problem.
This means that we will have use-case for making the Workflow
object require a client as well.
Workflow
object take in a client would be a breaking change.WfSpec
without access to LH, save it to a file on disk, and deploy it from a pipeline. If the Workflow
object requires client access, then they will not be able to fit this development flow.In this solution:
Workflow
class that takes in an LHConfig
IllegalStateException
saying "you cannot directly pass a NodeOutput
into another task without providing a client as we cannot infer the types."
Right now, the following is illegal:
You have to:
We should be able to do the following:
Implementation
This can be implemented on the client side. It should:
This does not require changing the protobuf.
Rejected Alternative
A rejected alternative is to change the protobuf to allow referring to a
NodeRun
. The problem with this is:NodeRetentionPolicy
andThreadRetentionPolicy
, we may refer to aNodeRun
that has been garbage-collected.NodeRun
s for a single node.