Jinho Chung
11/26/2021, 4:46 PMAnna Geller
11/26/2021, 4:54 PMimport requests
create_mutation = """
mutation($input: createFlowRunInput!){
createFlowRun(input: $input){
flow_run{
id
}
}
}
"""
inputs = dict(
versionGroupId="339c86be-5c1c-48f0-b8d3-fe57654afe22", parameters=dict(x=6)
)
response = <http://requests.post|requests.post>(
url="<https://api.prefect.io>",
json=dict(query=create_mutation, variables=dict(input=inputs)),
headers=dict(authorization=f"Bearer {API_KEY}"),
)
print(response.status_code)
print(response.text)
For this, you would need either flow ID, or flow version group ID - I chose the latter here because this ID remains the same even when you later register new versions of the flow:
Additionally, you need an API key, which you can create through your Account settings in the UI (URL will be different on local machine):Jinho Chung
11/26/2021, 11:04 PM