How to not allow a workflow from running if another workflow is running

Is there a way to check if a workflow is executing from another workflow? I don’t want workflow A to run if workflow B is running. I have multiple activities that are called from multiple workflows and I don’t want the same activity to run multiple times at the same time.

I’ve looked into workflow status. Is it possible to get the status of workflow B, lets say its COMPLETED and by the time workflow A runs, workflow B is actually running as well?

I would use the same WorkflowID for both workflows. This would guarantee that only one of them can run at a time.