Rec req: database calls from an Activity

I have an Activity that fetches data from S3 and processes it. I’m not sure what’s best to do to persist the results.

Is there published or community guidance on doing things like persisting back data? Is it fine to make a direct DB connection from an Activity and INSERT? Is it wiser to have an api on the server that Temporal workloads can call that will do the persistence?

Does this solely come down to whether Temporal workers are co-located with the DB?

I would very much appreciation any pointers or pitfalls for both approaches.

This depends on the use case. If the results are small, then the activity can return them as its result. Temporal persists activity results. If results are large they can be stored anywhere that fits your application. There is no any limit on what operation an activity can perform.