Hi. 1. Is it possible to specify timeout for wait_...
# prefect-community
v
Hi. 1. Is it possible to specify timeout for wait_for_flow_run task? 2. Is it possible to use prefect.Client to cancel Prefect flows by name?
a
#1 Try:
Copy code
wait_for_flow_run(task_args=dict(timeout=3600))
# 2 Not directly, but you can retrieve the flow run ID from the prefect context and use it to cancel the flow run. Also: you can't cancel flows, only flow runs, and for that, you need the flow run ID Can you describe your use case more?
v
We use ECS and sometime using create_flow_run tasks just hangs in submitted state, we would like to have some cleaning at the start of next run.
a
So your flow runs are stuck in a submitted state? This would indicate issue with the execution layer
v
yes
k
You can also try
Copy code
wait_for_flow_run.timeout = ...
v
Is it possible to filter by jsonb field when using graphql?
Flow run has field serialized_state
I would like to filter by type field in this jsonb
k
What query/mutation are you looking at?
v
I have already found, thanks
k
Nice!
v
Copy code
query {
            flow_run(where: 
              { 
                name: { _like: "pattern.%" }, 
                state: { _eq: "Submitted"}
              }
            ) {
                id,
    						name,
    						state,
    						created
        }
    }
I wanted to list submitted runs and when they started
I was trying to filter by jsonb field, but then found state field
k
Ahh I see
v
but would be great to understand - is it possible to filter by jsonb field?
k
Maybe with _contains but I don’t think so. I may be wrong though
119 Views