How can I get the e-mail of the user that started ...
# prefect-cloud
j
How can I get the e-mail of the user that started a custom run of a flow in the flow itself? I've tried using the
/users/{id}
and
/me
endpoints and I keep getting 404 errors.
c
One thought: your flow is running on a worker, right? Is the worker using a service account? Service accounts may not have the permissions to request user details (because users are an account-level API, not a workspace-level one)
j
I see! That's interesting. I ended up side-stepping the issue by using the
FlowRun
object's
CreatedBy.display_value
field. It's not exactly the e-mail but it's identifiable enough that it works for us.
Thanks for getting back to me. It would explain why doing this locally works but it doesn't when deployed to production.