I have an activity that passes in a workflow fn in an object back to the workflow, and then the workflow is supposed to retrieve that workflow fn and use it as a child workflow.
workflow code looks smth like
const node = mainService.getNodeDetails()
await executeChild(node.workflow);
import { childWorkflow } from 'other-package';
const getNodeDefDetails = async() => {
const nodeDetails = {
name: 'testing'
workflow: childWorkflow
}
return nodeDetails;
}
So I put logging statement, and it seems that in the return statement of my activity, the object with the workflow is what’s returned by the activity.
{
name: 'testing',
workflow: [AsyncFunction: childWorkflow]
}
However, when I print out the variable node
in my workflow (the result of the activity), it is now missing the workflow property. I now get
{
name: 'testing',
}
Also verified in the Temporal webUI if this is what it thinks is being returned by the activity, and it matches that object without the workflow fn.
Is this expected behavior? Is there any constraints on what can’t be passed back to a workflow from an activity?