Hi, I am trying to run a flow given its name and project. Since the client can only do this given an ID I was trying to find the ID via graphql. However I fail to construct a proper query to only find the active version of the flow.
Copy code
{
flow_group(
where: {flows: {name: {_ilike: "%name%"}, archived: {_eq:false}}} ) {
id
name
flows{
name
id
archived
}
}
}
Will not actually filter for not archived versions. What am I doing wrong?
a
Anna Geller
02/15/2022, 1:44 PM
Have you tried just using the
create_flow_run
Prefect task?
Copy code
from prefect.tasks.prefect import create_flow_run
with Flow() as flow:
create_flow_run(flow_name="xx", project_name="yy")
f
Florian Kühnlenz
02/15/2022, 2:39 PM
We have tried this in other places and it works great, but we were looking add a trigger to an internal dashboard for certain flows and it did not seem appropriate to create a flow in that case. But I guess I could just use the run() mehthod of the task instead.
a
Anna Geller
02/15/2022, 2:43 PM
in that case you can grab the version group ID from the UI and use it e.g. with requests as shown here
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.