Change status node if an existing file

Hello, I would like node to be active only if a file is present or not in a specific directory.
My problem is that I use another interface to run my robots and to identify the servers already running through this other interface, I have a queue directory with files’ so I would like the node on which there are files present in this JENKINS directory to pass the status of this slave occupied

Not a very simple to do, but you can shutdown the agent completely if there is nothing in your queue directory. When something comes in, the agent needs to be started again.

But I don’t know how do you want to schedule your jobs in Jenkins? If you do it manually (the file is deployed to the queue and then Jenkins job is triggered manually) you could also enable and disable nodes using Jenkins API - check http://your-jenkins/computer/<your-node-name>/api