Do you want to move your flow code to
Prefect 2.0? This is easier to do in 2.0 because there's no DAG requirement.
your issue is because your Prefect 1.0 flow gets serialized at registration time and you can't serialize the S3 boto3 client as it's not cloud-pickle serializable, so you would need to move the s3 client object from Flow to your task that lists S3 objects