Aaron Ash

    Aaron Ash

    9 months ago
    is it possible to retrieve the
    project
    name of the currently executing flow from the context or somewhere else?
    j

    Jake Kaplan

    9 months ago
    Hi Aaron, I don't believe this information is available in the context. I know you are able to query this information via the graphql api. For example to get all flow's and their projects:
    query {
      flow
      {
        id
        name
        project {
          id
          name
        }
      }
    }
    If you don't mind would you be able to explain your use case a little more?
    Aaron Ash

    Aaron Ash

    9 months ago
    Just kicking off a dependent flow from a parent flow, the
    project
    would be required to kick off in the same environment/client-tenancy
    j

    Jake Kaplan

    9 months ago
    I see. Then one way to do this would be to use the prefect client as I described above. You'll be able to get back the flow you want's project using something like the
    flow_id
    (which is available in the prefect context)
    Aaron Ash

    Aaron Ash

    9 months ago
    Ok thanks, that should work fine for our use case
    Aram Panasenco

    Aram Panasenco

    7 months ago
    There now seems to be a FlowView class that returns flow information (including project name) based on
    flow_id
    , but I can't figure out where to get the current
    flow_id
    from. @Jake Kaplan, how do you get the value in your code?