Krzysztof Nawara

    Krzysztof Nawara

    1 year ago
    Is it possible to check (from inside the task) if the flow is being executed locally, without agent or it it's being executed in Prefect Server/Cloud by an agent? E.g. by looking up some property in the context?
    Kevin Kho

    Kevin Kho

    1 year ago
    Hey @Krzysztof Nawara, you can do
    if prefect.config.backend != "cloud":
    Actually no that only distinguishes between cloud and server. Let me think for the agent.
    Krzysztof Nawara

    Krzysztof Nawara

    1 year ago
    👍
    Kevin Kho

    Kevin Kho

    1 year ago
    Use
    prefect.context.get("running_with_backend")
    . This does not exist for
    flow.run()
    calls.
    Krzysztof Nawara

    Krzysztof Nawara

    1 year ago
    Thanks!