Expand my Community achievements bar.

We require Execution schedule of all the workflows running on Scheduled basis in the String format. How to get it using Javascript in Adobe classic campaign.

Avatar

Community Advisor

Hi,

 

How do we get the execution schedule of the scheduler used in all the workflows using Javascript in adobe Classic campaign in a string format specified in the below example screenshot highlighted below "Triggering at 09:00:00 AM, Daily".

 

LakshmiPravallika_0-1738222261990.png

 

Regards,

Pravallika.

2 Replies

Avatar

Level 8

Hi @LakshmiPravallika,

I would try with the following code:

 

var query = xtk.queryDef.create(  
    <queryDef schema="xtk:workflow" operation="select">  
        <select>  
            <node expr="@id"/>  
            <node expr="@internalName"/>  
            <node expr="activities/scheduler/@label"/>  
            <node expr="activities/scheduler/@executionPattern"/>  
        </select>  
    </queryDef>  
);  

var result = query.ExecuteQuery();  

for each (var wf in result.workflow) {  
    var workflowName = wf.@internalName;  
    var schedulerLabel = wf.@label;  
    var executionPattern = wf.@executionPattern;  

    if (executionPattern) {  
        logInfo("Workflow: " + workflowName + " | Scheduler: " + schedulerLabel +  
                " | Execution Schedule: " + executionPattern);  
    }  
}  

 

This script goes through each workflow an  retrieves  the execution schedule. The result will be logged in the workflow logs.

 

Here I leave you with some useful links:

API documentation 

JSAPI documentation 

 

Hope it helps.

 

Kind regards, 

Celia

 

Avatar

Administrator

Hi @LakshmiPravallika,

Was the given solution helpful to resolve your query or were you able to resolve it on your own? Do let us know. 

Thanks!



Sukrity Wadhwa