How to get exact corresponding http Jenkins workspace path?

I need to email following path after Jenkins build is completed -

http://<ip>:8080/job/Nightly_Build/51/execution/node/64/ws/

Using BUILD_URL environment variable, I can get path till http://<ip>:8080/job/Nightly_Build/51. Remaining path we can hardcode except value 64 in above path which keep changes when I make changes in pipeline code.

I am unable to get that value on the fly.

Can someone explain what is that 64 number in the path and how can it be retrieved using Jenkins environment variable or APIs?