Activities with Closures? [JS]

I’m trying to convert an application that’s written in JS to use Temporal for some portion of it’s logic. A lot of what it does is passing the same parameters to a lot of activities. As an example, a URL that it gets while the workflow is executing. Contrived example below:

  • Workflow starts
  • Workflow calls out to API, response has a URL
  • Pass the URL as a parameter to every activity from there on out (along with other parameters)

How would I be able to create a closure for activities that don’t require me passing the URL (and possibly other parameters) to every one? I know there’s some examples on dependency injection, but that’s for activities at the time you pass them in to the workflow. Not during workflow execution.

Mainly looking to see how I could lower the amount of repeated parameters to activities that require them. I get they have to be serialized, so it has to be passed in, but if there’s a common way that’s worked well before I write something up, I’d love to know.