# How to: ensure actor is running on the same node only?

**URL:** <https://discuss.ray.io/t/how-to-ensure-actor-is-running-on-the-same-node-only/2083>\
**Category:** Ray Core\
**Created:** [May 7, 2021, 9:22am UTC](https://discuss.ray.io/t/how-to-ensure-actor-is-running-on-the-same-node-only/2083 "2021-05-07T09:22:48Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![johann-petrak](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/johann-petrak/32/951_2.png) [@johann-petrak](https://discuss.ray.io/u/johann-petrak)\
**Post date:** [May 9, 2021, 6:41am UTC](https://discuss.ray.io/t/how-to-ensure-actor-is-running-on-the-same-node-only/2083/5 "2021-05-09T06:41:48Z")

</div>

From looking at the source code, there is an even easier way to get the node restriction for the current node: `ray.state.current_node_id()`

Sadly nothing of this is to be found anywhere in the documentaiton. The API documentation seems to be restricted to a subset of modules and classes so even though this is in the PythonDoc of the respective function, it shows up nowhere in the API docs on the website.

---

_[View the full topic](https://discuss.ray.io/t/how-to-ensure-actor-is-running-on-the-same-node-only/2083)._
