I am trying to do a cloud function by adding a Schedule to change the status of a node inside firebase, which is {active: true} to {active: false}
const admin =
What you're trying to do isn't possible. You can't declare and export a function inside another function declaration. If you want something to run on a schedule, you will have to declare and export it at the top level of the file.
What you can do instead is have your function run on a schedule, but query Firestore to see how it should operate on each invocation.