How to properly use an access token within a long running background process?

Hi,
we are looking for some advice on how to use an access token within a long running background process that exceeds the token expiry. We are using Keycloak with OpenId Connect and we would like to stick to the standard. Maybe bend it a little bit, if necessary, but not overthrow it.

Use-Case:
User calls a service with his access token. The service starts a long running background process that calls other services. The access token is being sent to the other services in order to authorize the request and relate the action to the user (e.g. “changed by”). The background process may take days or even weeks.

Any ideas? Thanks in advance!

You shouldn’t use a users access token for this kind of workflows. You know who starts the process and that’s where it should end.
Like you mentioned, a background process that may take days or even weeks. This is an internal workflow probably queued when you’re planning to scale out.
Create a dedicated client for these kind of workflows.
You probably are re-using existing API’s that do the same thing for multiple workflows and that why you mentioned that ‘changed by’ action. I would suggest to not couple these things to closely together and maybe create separate end points for your workflows.