There are use cases where a workflow shouldn't be run too frequently, e.g. "don't run this more than every 5 minutes". Assuming the user chooses a consistent workflow identifier across runs, Flux will handle SWF's WorkflowExecutionAlreadyStartedException cleanly.
However, if the previous execution of the workflow is already finished, SWF will start a new execution. This means if users want to enforce a minimum time between workflows, they have to:
store metadata somewhere about the most recent workflow start time
every time they want to start a new workflow, check that metadata to see if enough time has passed.
Conveniently, Flux already has this functionality internally, but it's only used for @Periodic workflows. We should add a property, probably to the @Workflow annotation, specifying the minimum workflow run time, and use that to set a _delayExit timer for non-@Periodic workflows.
There are use cases where a workflow shouldn't be run too frequently, e.g. "don't run this more than every 5 minutes". Assuming the user chooses a consistent workflow identifier across runs, Flux will handle SWF's
WorkflowExecutionAlreadyStartedException
cleanly.However, if the previous execution of the workflow is already finished, SWF will start a new execution. This means if users want to enforce a minimum time between workflows, they have to:
Conveniently, Flux already has this functionality internally, but it's only used for
@Periodic
workflows. We should add a property, probably to the@Workflow
annotation, specifying the minimum workflow run time, and use that to set a_delayExit
timer for non-@Periodic
workflows.