Hi team, I donโ€™t really know GraphQL too well, cou...
# prefect-community
a
Hi team, I donโ€™t really know GraphQL too well, could someone give me an example of the GraphQL to write to trigger a specific flow?
v
Here is what I have:
Copy code
client = Client()

where = {
    'name': {'_like': 'example.%'},
    'state': {'_eq': 'Scheduled'},
}

flow_run_query = {
    'query': {
        with_args('flow_run', {'where': where}): {
            'id': True,
            'name': True,
        },
    },
}

result = client.graphql(flow_run_query)
flow_runs = result['data']['flow_run']

for flow_run in flow_runs:
    client.create_flow_run(flow_run.id)
๐Ÿ™Œ 1
marvin 1
๐Ÿ™ 1
k
I used this as a guide when I was trying to do the same a while ago: https://medium.com/the-prefect-blog/event-driven-workflows-with-aws-lambda-2ef9d8cc8f1a
๐Ÿ™Œ 1
๐Ÿ”ฅ 1
๐Ÿฆœ 1
a
Thanks both!!