I have a Flask app on one machine, and a second machine where some queries are required to be run from. The second machine doesn\'t render any pages, it will just be doing thin
You communicate with it like you would any other HTTP server: by making HTTP requests. Python has the built-in urllib, or you could consider the easy to use requests library.
If all the second machine is doing is running background tasks, there's no reason to set up another Flask app. You can use a task queue such as Celery instead, or an RPC library such as Pyro.