The docs suggest the following:
class TestWorkChain(WorkChain):
@classmethod
def define(cls, spec):
super().define(spec)
spec.input_namespace('workgraph', dynamic=True)
spec.outline(
cls.run_workgraph,
cls.results,
)
spec.output('sum')
spec.output('product')
def run_workgraph(self):
from aiida_workgraph.engine.workgraph import WorkGraphEngine
process = self.submit(WorkGraphEngine, **self.inputs.workgraph) # possible issue
self.to_context(workgraph_process=process)
def results(self):
self.out('sum', self.ctx.workgraph_process.outputs.sum)
self.out('product', self.ctx.workgraph_process.outputs.product)
But the possible issue I mark is that self.inputs.workgraph may (or does?) carry a process key, which appears to conflict with the one expected by the submit function, for which the example passes the WorkGraphEngine. We may need to assign directly to the workgraph_data key.
Still investigating. Pinging @superstar54 @GeigerJ2
The docs suggest the following:
But the possible issue I mark is that
self.inputs.workgraphmay (or does?) carry aprocesskey, which appears to conflict with the one expected by thesubmitfunction, for which the example passes theWorkGraphEngine. We may need to assign directly to theworkgraph_datakey.Still investigating. Pinging @superstar54 @GeigerJ2