https://prefect.io logo
Title
a

Adam

07/27/2022, 3:13 PM
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

Vadym Dytyniak

07/27/2022, 3:16 PM
Here is what I have:
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
:thank-you: 1
k

Kevin Grismore

07/27/2022, 3:16 PM
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
:party-parrot: 1
a

Adam

07/27/2022, 3:19 PM
Thanks both!!