close block when workflow is completed

fixes #4975