Support `WorkflowIdConflictPolicy` for child workflow
Is your feature request related to a problem? Please describe.
WorkflowIdReusePolicy's Terminate-if-Running is being deprecated and replaced with WorkflowIdConflictPolicy's Terminate-Existing.
To complete this effort, support for child workflows is needed.
Describe the solution you'd like TBD
Describe alternatives you've considered TBD
Additional context
This is blocking https://github.com/temporalio/features/issues/558
bump
Just ran in to this limitation - not great. This, combined with the fact that "external workflow handles" don't allow you to wait on the result of another workflow, is causing quite a friction for my usecase right now. Going to have to re-think my workflow design because of this now.
@lukeramsden You can wait for external workflow completion using an activity, that's what we did. You can rely on retries to keep activity running indefinitely or implement more complex logic involving heartbeats.
import { cancelled } from '@temporalio/activity';
async function waitForExternalWorkflowCompletion(workflowId: string): Promise<void> {
await Promise.race([
workflowClient.getHandle(workflowId).result(),
cancelled(),
]);
}
If you implement long-polling based on retry behavior, just make sure the promise completes when the activity is cancelled. Otherwise, the activity slots won't be freed.
Ran into a use case today
We also have a use-case for this, and getting it through local activity and signal is ugly.
See comment at https://github.com/temporalio/features/issues/558#issuecomment-3176176866 on why use-existing may not make sense from a technical perspective.