Documentation > Language
A MoleTask encapsulates a whole workflow in a single task. It may be useful to delegate entire workflow executions to a remote node. Another typical use case is to make your workflows more modular. To encapsulate a workflow in a MoleTask, simply wrap it in the MoleTask builder:
In that case, the MoleTask's inputs are the same as t1's and its outputs are the same as t2's.
// Define tasks t1 and t2 val moleTask = MoleTask(t1 -- t2) // Delegate the whole workflow execution to an execution environment moleTask on env