Using an environment variable
from prefect.run_configs import UniversalRun
flow.run_config = UniversalRun(env={"PREFECT__CLOUD__HEARTBEAT_MODE": "off"})
Using config.toml
[cloud]
heartbeat_mode = "off" # ['process', 'thread', 'off']
Using GraphQL
mutation {
disable_flow_heartbeat(input: { flow_id: "your-flow-id-here" }) {
success
}
}