Expand my Community achievements bar.

Adobe Campaign User Groups are live now. Join our Adobe Campaign User Groups and connect with your local leaders!

Is it possible to control Scheduler activity with Javascript?


Level 2


Is it possible to control Scheduler activity with Javascript?


Example: Use Javascript to get the first Monday (Javascript is prepared) and reflect them in the scheduler.

Example: Use Javascript to get business or non-business days from your company's own calendar (Javascript is prepared) and reflect them in the scheduler.


If Javascript condition is met, the transition will be enabled, otherwise it will be disabled.

Thank you.

5 Replies


Community Advisor



Actually, you don't need a scheduler activity to do this.


Just use the Advanced javascript activity and enable the transition. If your condition met then run the workflow else divert the transition to the end activity.


The advanced javascript activity config will look like this.



and the workflow will look like this.



Let me know if that helps.


     Find me on LinkedIn


Level 2

@_Manoj_Kumar_, Thank you for reply.


I understood that Advanced JS can branch judgments.
Is usage of Advanced JS correct in the following?



//First call
if(Today is first Monday and business day){

//Next call
return 0;



And, Is there no choice but to start the scheduler every day and use JS to determine the business day?



Community Advisor

Hi @uz2020 

For the first case, just use the scheduler, by selecting monthly, you have first Monday option


For your second case: if your calendar is accessible through API, you can do some api call to it and parse the response if it's a business day or not.


other choice instead of running permanently a scheduler is to calculate the condition from an external system and trigger the workflow with a signal.



David Kangni


Level 2
Hello @DavidKangni, Thank you for your reply. In the first case, if the first Monday is a non-business day, it cannot be delivered on the next business day. Currently, Run the scheduler every day, run Workflow if the conditions are met in Javascript, and quit otherwise. It may correspond to the second case. Running the scheduler every day Waste seless, so I'm thinking about if I can control it. Thank you.



Hi @uz2020,

Were you able to resolve this query or do you still need more help here? Do let us know.


Sukrity Wadhwa