问题
I currently have a Prefect workflow running locally on an EC2 instance. I can trigger my workflow on localhost:8080 through the UI. Is there a way to trigger a Prefect workflow externally (say AWS Lambda) via REST API or some other way?
I know that Airflow supports an experimental REST API.
回答1:
Yes through REST API you can trigger it using AWS Lambda, and can schedule AWS Lambda trigger using CloudWatch Events Rule, it supports both fixed rate or crown expression scheduler
回答2:
Yes, Prefect exposes a full GraphQL API that you can use to perform all types of actions, including the scheduling / triggering of a workflow. This blog post goes into more detail, and here is some code for setting up an AWS Lambda function to trigger Prefect flow runs.
来源:https://stackoverflow.com/questions/63256062/triggering-a-prefect-workflow-externally