Leiste mit Community-Erfolgen erweitern.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
GELÖST

How to limit a specific workflow to execute only one instance at a time?

Avatar

Level 2

I have a custom workflow that can be executed by a program.

However, I want to ensure that only one instance of it runs at a time.

Any additional instances should be queued for later execution.

I have tried configuring it using Apache Sling Job Queue Configuration, but it seems that I cannot achieve the desired effect.

Can anyone help me solve this problem?

Thank you all in advance.

 
 
 
Themen

Anhand von Themen werden Community-Inhalte kategorisiert und Sie können so relevanten Inhalt besser finden.

1 Akzeptierte Lösung

Avatar

Korrekte Antwort von
Community Advisor

Hi @charlie_yc,

I think that the root cause of your issue is the fact that OOTB there is already Apache Sling Job Queue that handles workflows.

workflow-queue.jpg

 

 

 

 

As you can see it is using wildcard in the Topic filed com/adobe/granite/workflow/transient/job*

That means your workflow could be either handheld by your custom queue or the default one.

As a solution you can try to increase Ranking value in configuration of your Apache Sling Job Queue. This should guarantee that only your queue will be used for your specific topic/workflow.

Please also double check if your workflow is handled by your custom queue - you can check that under /system/console/slingevent

Lösung in ursprünglichem Beitrag anzeigen

2 Antworten

Avatar

Korrekte Antwort von
Community Advisor

Hi @charlie_yc,

I think that the root cause of your issue is the fact that OOTB there is already Apache Sling Job Queue that handles workflows.

workflow-queue.jpg

 

 

 

 

As you can see it is using wildcard in the Topic filed com/adobe/granite/workflow/transient/job*

That means your workflow could be either handheld by your custom queue or the default one.

As a solution you can try to increase Ranking value in configuration of your Apache Sling Job Queue. This should guarantee that only your queue will be used for your specific topic/workflow.

Please also double check if your workflow is handled by your custom queue - you can check that under /system/console/slingevent

Avatar

Level 2

Hi @lukasz-m 

After increasing the ranking, it worked.

Thanks for the help!!