You can also check out this workflow:
It uses the internal API to check if an instance of workflow is already running.