cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Execute scheduled workflow only after the previous run has finished

jegron
DynaMight Champion
DynaMight Champion

Hi,

Is it possible to trigger a workflow only after the previous one has fully completed?

Right now, I’m facing an issue where a new run starts before the previous one finishes, causing it to reprocess the same data.

Julien

Observability Engineer at Phenisys - Dynatrace Professional
5 REPLIES 5

dania
Dynatrace Promoter
Dynatrace Promoter

Hi, each task within a workflow waits for the previous one to finish before continuing to the next. What might be happening is that the workflow is skipping tasks when an error occurs.
To avoid this, you can choose one of the available options to ensure that a task only proceeds after the previous one has completed successfully.

dania_0-1758635866343.png

 

Alternatively, you can configure settings such as increasing the wait time between tasks or enabling retries a certain number of times.

dania_1-1758635889342.png

 

These options help guarantee that a task only executes once the preceding one has run as expected.

jegron
DynaMight Champion
DynaMight Champion

Hi,

Thanks for help.

My issue isn’t related to individual task execution — tasks are running as expected.

The problem lies in the workflow execution itself: if the workflow doesn’t complete within a given interval (e.g., 1 minute), a new instance starts while the previous one is still running, leading to overlapping executions and chaotic behavior.

How can I ensure that only one workflow instance runs at a time and prevent this kind of overlap?

Observability Engineer at Phenisys - Dynatrace Professional

dania
Dynatrace Promoter
Dynatrace Promoter

Hi, what’s the event trigger for that workflow? You might need to define a more specific trigger to avoid overlapping with instances from other executions.

jegron
DynaMight Champion
DynaMight Champion

I tested using a scheduled event, but it turned out to be unreliable due to multiple parallel executions.

After that, I tried with an event trigger:

dt.automation_engine.workflow.id == "XXX" and
event.kind == "WORKFLOW_EVENT" and event.provider == "AUTOMATION_ENGINE" and event.type =="WORKFLOW_EXECUTION"
and dt.automation_engine.state.is_final == true
and dt.automation_engine.is_draft == false

What I was hoping for was to start the process manually once, and then let the loop continue running on its own. However, it doesn’t work that way. Is there some hidden limitation I’m missing?

Observability Engineer at Phenisys - Dynatrace Professional

dania
Dynatrace Promoter
Dynatrace Promoter

I’d recommend triggering the process on demand using the API. This way, you can set a wait time limit for example, one minute or more to help ensure that overlapping executions don’t happen again.

https://docs.dynatrace.com/docs/shortlink/workflows-trigger#on-demand-trigger

Featured Posts