Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Triggering a Prefect workflow externally

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.

like image 957
LifeAndHope Avatar asked Aug 04 '20 22:08

LifeAndHope


2 Answers

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.

like image 167
chriswhite Avatar answered Oct 10 '22 10:10

chriswhite


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

like image 3
Asfar Irshad Avatar answered Oct 10 '22 10:10

Asfar Irshad