https://prefect.io logo
Title
p

Paco Ibañez

05/10/2022, 8:31 PM
Hello! V2.0 question: I am creating flow runs without a deployment from the API. I can see the flow run being created in the database but my agent will not pick it up. The moment I add a deployment id to the flow run in the db, the agent starts working on it. Is this expected behavior? Thanks!
this is the code I am using to create the flow run
def create_flow_run(flow: dict):
    payload = dict(
        name = 'my_run',
        flow_id = flow['id'],
        flow_runner = dict(
            type = 'docker',
            config = dict(
                image = 'my-prefect-orion',
                image_pull_policy = 'IF_NOT_PRESENT',
                networks = ['prefect'],
                env = {
                    "USE_SSL": False,
                    "AWS_ACCESS_KEY_ID": "*****",
                    "AWS_SECRET_ACCESS_KEY": "******",
                    "ENDPOINT_URL": '<http://minio:9000>',
                }
            )
        ),
        state = dict(type='SCHEDULED'),
        parameters = dict(),
    )
    resp = <http://session.post|session.post>(f'{ORION_SERVER_URL}/api/flow_runs', json=payload)
k

Kevin Kho

05/10/2022, 8:41 PM
I think this is expected. Quick Runs are attached to deployments and agents pick up deployments
p

Paco Ibañez

05/10/2022, 8:44 PM
thanks!