I have a spring boot micro service that we use to run Workflows with Temporal.
Currently, our workflow hardcode the following timeouts:
private static final Duration SCHEDULE_TO_CLOSE_TIMEOUT = Duration.ofHours(24); private static final Duration START_TO_CLOSE_TIMEOUT = Duration.ofMinutes(30); private static final Duration HEARTBEAT_TIMEOUT = Duration.ofSeconds(60);
My goal is to find a way to inject this configuration from config file as opposed to have it hardcoded within the Workflow. I have read a few topics on this forum where it is advised agains injecting configuration within a workflow as it might create non-determinism (Integration with Spring and self registration of workflows and activities and Temporal with springboot).
That said, we found an hack to actually inject this configuration by taking advantage of the
addWorkflowImplementationFactory method. However, this is discouraged even in the doc and as a solution for passing configuration it is recommended to use a LocalActivity. While this would work for common Workflow configuration, I don’t think this would work in my case as I am trying to bring in a configuration for the ActivityOption itself, which I would need before the Local Activity even starts.
Do you have any recommendation for this? Should I just stick to the hardcoded solution? Would there be any issue if we change timeouts while other workflows are running?