I have a requirement to develop workflows that maintain Tree structure, which means Parent workflow can have any number of child workflows and child workflows also can have any number of child workflows and so on. The type of workflow is the same for both parent and childs. This what I have tried so far
In here, I’m trying to create a child workflow with signals in parent workflow. I don’t have an issue creating child workflow with different type of workflows. Issue comes when use the parent workflow function to create a child workflow(same workflow function) inside the parent
export async function jobFileWorkflow(
jobRefId: string,
): Promise<JobFileStatus> {
// all the code does not added here
setHandler(signals.startChildJobFileWorkflow, async (jobRefId: string) => {
const jobFIleChildWorkflowId = `wf-job-file-${jobRefId}`;
executeChild<typeof jobFileWorkflow>(jobFileWorkflow, {
args: [jobRefId],
taskQueue: 'job-file-1',
workflowId: jobFIleChildWorkflowId,
})
.then((i) => {
console.log(' some log');
})
.catch((err) => {
console.log('Error processing child wf: ', err);
});
});
}
When trigger the signal getting bellow error
WorkflowNotFoundError: current workflow not found
what could be the issue? any ideas