Expand my Community achievements bar.

SOLVED

Execute pending tasks now via script

Avatar

Level 3

Hi All,

 

Is there any script to execute pending tasks in a workflow that is in a scheduled state in Adobe campaign classic version 7?

 

I tried using xtk.workflow.Start, xtk.workflow.Restart. When a workflow is not scheduled, I'm able to start and restart it, but when it is scheduled, I'm unable to execute pending tasks. Can anyone help with the script to execute a pending task in Adobe campaign classic version 7?

 

Sujith_02kumar_0-1697649567382.png

 

 

 

Thanks in advance,

Sujith kumar.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Sujith_02kumar ,

You can use Wakeup method from one workflow to 'execute pending task' of the scheduler of another workflow.

WKF1: workflow with scheduler (workflow in started state)

WKF2: Create a JavaScript code activity, and paste the below script and run the workflow. 

 

xtk.workflow.Wakeup("internal_name_of_the_workflow");

 

 

Once you Ran the Workflow-2 script, it will execute the pending task of scheduler in Workflow-1.

ParthaSarathy_0-1697651941142.png

 

Hope you get a solution!

View solution in original post

3 Replies

Avatar

Community Advisor

Hello @Sujith_02kumar ,

why is this needed? If you succeed the scheduler will trigger at scheduled time and might cause e.g. delivery will trigger twice. But anyway here is how you can solve your problem:

You just add another start activity and with your command you can start workflow from where is needed.

Marcel_Szimonisz_0-1697650626211.png

 

 

 

//start workflow from another workflow
NLSW.xtkWorkflow.Start('WKF01');

 

 

 

 

 

 

Marcel Szimonisz

MarTech Consultant
for more tips visit my blog
https://www.martechnotes.com/

Avatar

Level 3

Thank you @Marcel_Szimonisz ,

 

Due to delivery sequence issue, my workflow is getting into failed state often, we are fixing this issue till then i need to trigger workflow manually which is in scheduled state. I have created a script that will check all the workflow which is failed state and i can restart but i was not able to trigger today's communication. Each and every time i need to execute pending tasks in my scheduler. So i thought if we have some script it would be easy. Thanks for your solution.

Avatar

Correct answer by
Community Advisor

Hi @Sujith_02kumar ,

You can use Wakeup method from one workflow to 'execute pending task' of the scheduler of another workflow.

WKF1: workflow with scheduler (workflow in started state)

WKF2: Create a JavaScript code activity, and paste the below script and run the workflow. 

 

xtk.workflow.Wakeup("internal_name_of_the_workflow");

 

 

Once you Ran the Workflow-2 script, it will execute the pending task of scheduler in Workflow-1.

ParthaSarathy_0-1697651941142.png

 

Hope you get a solution!