Execute another app\script

Is it possible to execute another app or script from my flatpak app?

Normally, you can only access the files that come with the runtime or the app, due to the sandbox.

Now, the question is: What use-case of your application could require you to leave said sandbox?

If you have a program or script that is required for the application, just bundle it with the application as an module, and it will be available in the sandbox.

If you want to be able to allow extensions to your app (like plugins), Flatpak provides a extension system, allowing you to extend the files available in the sandbox.

If you need to talk to something outside of the sandbox, look if it has a DBus API, as there are permissions that allow communication over DBus.

Lastly, you could also use flatpak-spawn to run a process outside of the sandbox. That being said: This will likely result in the app being rejected by Flathub, unless you have a really, really, really good reason.

Thank you for the thorough answer @CodedOre!
In my case it is a bunch of Python scripts. Do you know any app that does something similar that I can check?

Don’t have an example at hand, but that seems like a basic case of “provide the scripts with your app”. So, basically just copying the scripts during the Flatpak build over to /app/lib/APP_NAME and calling them from there.