I am currently exploring temporal (using the java sdk) for a use case which will run an infinite loop periodically polling a database. I am implementing the loop in the activity which runs the operation, sends a heartbeat and sleeps for a few seconds and calling this activity method from the workflow (instead of polling from the workflow, to prevent growing history of events and RPC with temporal).
However, it looks like the workflows are configured with a finite execution timeout. How can I ensure the workflow never ends?
Also I see i can call continueAsNew, but it seems like that will start a new run which will end on execution timeout?
The default workflow execution timeout is 10 years. We have plans to make it really infinite by default in the future. Is 10 years is not enough for your use case?
Thanks for the response. In practice maybe 10 years is a long time and we will probably go with that. The activity will be responsible to polling for records of a certain type and notifying another system, unless explicitly turned off by a customer.
Its good to know that there are plans to make it truly infinite by default. Just out of curiosity, are there ways to work around the workflow execution timeout to have a never ending workflow?
Currently there is no such possibility. The workflow execution is a hard timeout. We’ll fix it before much sooner than in 10 years :).