Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import os
import requests
API_KEY = os.environ["API_KEY"]
FLOW_VERSION_GROUP_ID = os.environ["FLOW_VERSION_GROUP_ID"]
create_mutation = """
mutation($input: createFlowRunInput!){
createFlowRun(input: $input){
flow_run{
id
}
}
}
"""
inputs = dict(versionGroupId=FLOW_VERSION_GROUP_ID, parameters=dict(x=6))
response = 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment