I have a script that I would like to run when something happen from outside of the gateway.
For example I have a script that import tags from json file and I have an external system that produce those json files, I would like to have the possibility to deploy automatically the changes without any human action.
So for example is it possible to trigger a script every time there is a new file in a folder on the gateway?
Or maybe it is possible to send a message to the gateway with an external API and use the message handler of the gateway event script?
Java can monitor a folder for changes, though you need a long-lived thread. That has serious memory leak hazards if not cleaned up at the correct times (project restarts in particular).
The WebDev module is specifically designed to expose an API to external callers. You have total control via scripting how Ignition responds. Consider having the external system simply POST the new JSON file to Ignition this way.