Thread
#prefect-community
    Constantino Schillebeeckx

    Constantino Schillebeeckx

    8 months ago
    Happy New Year everyone! Is there a way, from within an active Flow, to know whether the flow was triggered by cron vs Quick run vs Run?
    Kevin Kho

    Kevin Kho

    8 months ago
    Not really unless you know the interval you scheduled at because the Quick Run just creates a schedule with “scheduled_start_time” = “now”
    Actually one sec let me look
    Anna Geller

    Anna Geller

    8 months ago
    there is an
    auto_scheduled
    flag set to True when the flow runs on schedule:
    query = """ 
    query($id: uuid!) {
      flow_run(where: {id: {_eq: $id} }) {
        id
        auto_scheduled
      }
    }
    """
    client.graphql(query=query, variables=dict(id=prefect.context["flow_run_id"]))
    Constantino Schillebeeckx

    Constantino Schillebeeckx

    8 months ago
    is this available within the flow context?
    Kevin Kho

    Kevin Kho

    8 months ago
    It’s not so I think you would have to query it
    Constantino Schillebeeckx

    Constantino Schillebeeckx

    8 months ago
    😞 ok - thanks for the info