Horatiu Bota

    Horatiu Bota

    3 months ago
    hi community! is there a way to look-up a flow's id using the flow name/project name via the client? this suggests you can via the cli
    Anna Geller

    Anna Geller

    3 months ago
    what are you trying to do?
    Horatiu Bota

    Horatiu Bota

    3 months ago
    hi Anna! i'm trying to start multiple runs for a flow that's been previously registered
    (i.e., runs with different parameters)
    but to start multiple runs you don't necessarily have to know the flow ID
    usually, you only need to know the flow name and project name
    so while the above links answer your direct questions, I think this one will address your actual problem: https://discourse.prefect.io/t/how-to-map-over-flows-with-various-parameter-values/365
    Horatiu Bota

    Horatiu Bota

    3 months ago
    thank you! i'm using
    create_flow_run
    which seems to require a flow_id
    Anna Geller

    Anna Geller

    3 months ago
    create_flow_run.map(
            flow_name=unmapped("yourflow"),
            project_name=unmapped("yourproject"),
            parameters=your_list_of_dicts
        )
    Horatiu Bota

    Horatiu Bota

    3 months ago
    oh, nice, this is what i need! šŸ˜„
    thank you!
    is this for orion?
    Anna Geller

    Anna Geller

    3 months ago
    no, for Prefect 1.0
    for Orion, you could do a for loop with subflows
    Horatiu Bota

    Horatiu Bota

    3 months ago
    hm, the method signature in client.py seems different:
    def create_flow_run(
            self,
            flow_id: str = None,
            context: dict = None,
            parameters: dict = None,
            run_config: RunConfig = None,
            labels: List[str] = None,
            scheduled_start_time: datetime.datetime = None,
            idempotency_key: str = None,
            run_name: str = None,
            version_group_id: str = None,
        ) -> str:
    should i be importing it from somewhere else? i'm using prefect 1.1
    Anna Geller

    Anna Geller

    3 months ago
    prefect.tasks.prefect.flow_run.create_flow_run(flow_id=None, flow_name=None, project_name="", parameters=None, context=None, labels=None, run_name=None, run_config=None, scheduled_start_time=None, idempotency_key=None)
    both id and name are valid
    Horatiu Bota

    Horatiu Bota

    3 months ago
    ah, ok, i was calling the method on a prefect client
    thank you again!