I have a situation where my application can invoke Concurrent Workflows with the same ID. I would like to check which one is the most recent Workflow and keep it running, and terminate all the other Workflows with the same Workflow ID
Temporal doesn’t support running concurrent workflows with the same ID at all. Any attempt to start a duplicated workflow will be rejected. You can choose to connect to an already running workflow.
You can specify an option (see WorkflowIdReuseOption.TERMINATE) to start a new workflow terminating an already-running one atomically.