<@ULVA73B9P> I want to create an automation body. ...
# ask-marvin
m
@Marvin I want to create an automation body. Where can I read what I can output? e.g. flow_run.name, flow_run.state.message, etc. What else can I get and how do I get it? e.g. I want to output logging from the flow run
m
To access various attributes of a flow run in Prefect 3.x, you can use the
prefect.runtime
module. Here's a quick overview of what you can retrieve: ### Flow Run Attributes You can access the following attributes from `prefect.runtime.flow_run`: -
id
-
tags
-
scheduled_start_time
-
name
-
flow_name
-
flow_version
-
parameters
-
parent_flow_run_id
-
parent_deployment_id
-
root_flow_run_id
-
run_count
-
api_url
-
ui_url
-
job_variables
For more details, you can check the Prefect documentation. ### Logging Prefect allows you to log messages during a flow run using the standard Python logging module. You can configure and retrieve logs from your flow runs. The logs endpoint is rate-limited, so be mindful of the limits if you're using Prefect Cloud. For further exploration of flow run metadata and logging, you might want to look into the
prefect.runtime
module and refer to the source code on GitHub. If you have more specific questions about how to implement logging or access certain attributes, feel free to ask!