Yes, you can start a flow run through the Prefect Server REST API. You'll need to connect to Prefect's API first. If you're self-hosting, you'll need to start the Prefect webserver and related services yourself. If you'd rather use a hosted version of the API with additional features, you can sign up for a Prefect Cloud account.
As for retrieving the result of the run when it's done, it's not directly mentioned in the documents. However, there's a mention of pausing flow runs which might be useful. By default, pausing a flow run blocks the worker — the flow is still running inside the pause_flow_run function. You may pause any flow run in this fashion, including non-deployment local flow runs and subflows. Alternatively, flow runs can be paused without blocking the flow run process. This is particularly useful when running the flow via a worker and you want the worker to be able to pick up other flows while the paused flow is paused. Non-blocking pause can be accomplished by setting the reschedule flag to True.
For more detailed information, you might want to check out the following documents:
-
Quickstart Guide
-
Concepts: Flows