<@ULVA73B9P> How to use the REST API for Prefect S...
# ask-marvin
h
@Marvin How to use the REST API for Prefect Server to trigger a flow directly
m
To use the REST API for Prefect Server to trigger a flow directly, you would need to communicate data from Prefect clients to Prefect Cloud or a local Prefect server so that orchestration can be performed. This API is mainly consumed by Prefect clients like the Prefect Python Client or the Prefect UI. The Prefect Cloud REST API documentation is available at https://app.prefect.cloud/api/docs. In terms of triggering a flow, the Automations API enables further programmatic customization of trigger and action policies based on arbitrary events. Triggers can be configured not only in reaction to events, but also proactively: to trigger in the absence of an event you expect to see. For example, in the case of flow run state change triggers, you might expect production flows to finish in no longer than thirty minutes. But transient infrastructure or network issues could cause your flow to get “stuck” in a running state. A trigger could kick off an action if the flow stays in a running state for more than 30 minutes. This action could be on the flow itself, such as canceling or restarting. For more specific details on how to use the REST API to trigger a flow directly, you may want to refer to the Prefect Cloud REST API documentation or the Prefect Python Client documentation.