Bruno Centeno
07/26/2021, 7:46 PMKevin Kho
Bruno Centeno
07/26/2021, 7:49 PMKevin Kho
Bruno Centeno
07/26/2021, 9:07 PMKevin Kho
Bruno Centeno
07/26/2021, 9:52 PMIf you’re trying to restart a Flow from the point of failure, the easiest way would be to click the Restart button in the UIyes that’s what im doing, but i have several tasks (169) and i dont want to do them one by one. On the other hand I have other 130 that run correctly but my back end had a bug so they didnt do what they were suppose to do and i want to run them again now that i changed that part of my back end(or create new ones with those parameters) is there a way to do multiple tasks at the same time from the UI (of the same flow)
Kevin Kho
Kevin Kho
Bruno Centeno
07/26/2021, 10:22 PMBruno Centeno
07/26/2021, 10:23 PMKevin Kho
Bruno Centeno
07/26/2021, 10:33 PMKevin Kho
Kevin Kho
query{
flow_run(where: {state: {_eq: "Failed"}}) {
name
id
state
flow {
id
name
project {
name
}
}
}
}
Kevin Kho
mutation {
set_flow_run_states(input: {states: [{
flow_run_id: "d2d9e33f-ea92-4a91-8971-8e80d0549991",
state: "{\"type\": \"Scheduled\", \"message\": \"<<your message>>\"}"}]},) {
states {
id
status
}
}
}
Kevin Kho
prefect.client.client.Client
has the graphql
method so you can use that to run the queries. Here is example syntax . You’re gonna change the query inside. And then you can loop over the flow_run_ids
you want to restart and plug them into this mutation and run the graphQL call.Kevin Kho
Kevin Kho
Bruno Centeno
07/27/2021, 6:22 PMmutation {
createFlowRun(input: {
parameters {
id: ["143b0976-0261-4aa6-8082-af5051190610",
"8a597bd8-b98a-4cd6-8908-ddedf326550b",
"fc35c91f-49a3-40cc-b4fa-7c3e9c6531d1"]
}
}
}
I want to pass the list of ids to create multiple runs, the picture is like i do it manuallyKevin Kho
from prefect.client.client import Client
client = Client()
for id in ids:
client.create_flow_run(id)
Kevin Kho
Bruno Centeno
07/27/2021, 6:30 PMBruno Centeno
07/27/2021, 6:30 PM