Sven Teresniak
07/17/2020, 8:47 AMrun.py
from the CLI code?
client = Client()
result = client.graphql(query)
I don't want to use prefect run server …
from a shell task. I like it pythonic
https://docs.prefect.io/api/latest/client/client.html seems perfect. But it states Client for communication with Prefect Cloud
On the other hand: prefect CLI uses the Client
class for non-cloud schedules as well… 🙂emre
07/17/2020, 9:12 AMClient
works with prefect server as well. It’s probably just the documentation that is not updated, since prefect server is a more recent addition than prefect cloud.
That being said, check this out: https://docs.prefect.io/api/latest/tasks/prefect.html#flowruntask
Implicitly uses the Client
of your flow to trigger a flow run via graphql.Sven Teresniak
07/17/2020, 9:15 AM