Workflow Priority | Community
Skip to main content
Level 3
March 27, 2024
Solved

Workflow Priority

  • March 27, 2024
  • 2 replies
  • 1471 views

Hi

I currently have a Workflow that is set to launch automatically at 2PM everyday. I am using Scheduler to launch the Workflow. However, I will need that Workflow to have a High Priority. I was wondering how I could set that Workflow to have a High Priority so that the Workflow executes before others. I have tried to go to OSGi Configurations to "Queue: Granite Workflow Queue"  and it does not have an option for me to specifically choose only that specific Workflow to have a High Priority. Please help me navigate how I could resolve this. 

 

Best Regards.
Sching

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by anupampat

Hi @chanutejo ,

 

You should be able to configure it like this

{ "queue.name":"Workflow Queue Configuration", "queue.priority":"MIN", "queue.maxparallel": 15, "queue.topics":[ "com/adobe/granite/workflow/job/var/workflow/models/<yourworkflowname1>", "com/adobe/granite/workflow/job/var/workflow/models/<yourworkflowname2>", "com/adobe/granite/workflow/job/var/workflow/models/<yourworkflowname3>" ], "queue.retries": 0, "queue.preferRunOnCreationInstance":true, "queue.threadPoolSize":0, "queue.retrydelay":2000, "service.ranking":1000, "queue.type":"TOPIC_ROUND_ROBIN", "queue.keepJobs":false }

you can define your workflow at the top and then others .

2 replies

TarunKumar
Community Advisor
Community Advisor
March 27, 2024

HI @chanutejo ,

You can define service ranking and give it a higher value.

Service ranking is defined by the OSGi Core Specification as follows: If multiple qualifying service interfaces exist, a service with the highest service.ranking number, or when equal to the lowest service.id, determines which service object is returned by the Framework.
 Annotation use for it is :
@ServiceRanking(200)
For more details on it, you can refer:

https://sling.apache.org/documentation/the-sling-engine/authentication/authentication-authenticationhandler.html


Thanks
Tarun

ChanuteJoAuthor
Level 3
March 28, 2024

Thankyou for the suggestion

 
How do I know which of the OSGi Configuration I should Configure as there are so many AuthenticationHandler? I want to set a specific workflow to have the highest service.ranking. Could you maybe help me navigate that?

Best Regards 
Sching

anupampat
Community Advisor
anupampatCommunity AdvisorAccepted solution
Community Advisor
March 28, 2024

Hi @chanutejo ,

 

You should be able to configure it like this

{ "queue.name":"Workflow Queue Configuration", "queue.priority":"MIN", "queue.maxparallel": 15, "queue.topics":[ "com/adobe/granite/workflow/job/var/workflow/models/<yourworkflowname1>", "com/adobe/granite/workflow/job/var/workflow/models/<yourworkflowname2>", "com/adobe/granite/workflow/job/var/workflow/models/<yourworkflowname3>" ], "queue.retries": 0, "queue.preferRunOnCreationInstance":true, "queue.threadPoolSize":0, "queue.retrydelay":2000, "service.ranking":1000, "queue.type":"TOPIC_ROUND_ROBIN", "queue.keepJobs":false }

you can define your workflow at the top and then others .

ChanuteJoAuthor
Level 3
March 29, 2024

Thankyou for the suggestion. 


So I just have to create new OSGi configuration and use this a a code? Or how do I add this line of code into the OSGi configuration. Please help me navigate I am quite new to AEM.

Best

Sching