Create workflow activity using javaScript | Community
Skip to main content
CampaignerForLife
Level 5
October 9, 2023
Solved

Create workflow activity using javaScript

  • October 9, 2023
  • 1 reply
  • 1383 views

Hello, is there any way to create an Activity using Javascript? 

Basically, create it in execution 

 

Thanks; 

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 ParthaSarathy

Hi @campaignerforlife ,

Create a JS, and add below script

 

var frequency = 10 * 1000 // 10 seconds task.wait(frequency)

 

1 reply

LakshmiPravallika
Community Advisor
Community Advisor
October 9, 2023

Hi @campaignerforlife ,

 

Could you Please explain which activity needs to be created in runtime and also the use case for this issue ?

 

If it is a delivery activity, then yes, it can be created in runtime using JavaScript.

 

PFA the sample code

 

var delivery = nms.delivery.create();
delivery.Duplicate("nms:delivery|" + vars.ID);
delivery.save();
vars.deliveryId = delivery.id;
logInfo("vars.deliveryId: "+vars.deliveryId);

 

Regards,

Pravallika.

CampaignerForLife
Level 5
October 10, 2023

Lets say I want to create a "Wait" activity in a workflow using Javascript, how could I do it?

ParthaSarathy
Community Advisor
ParthaSarathyCommunity AdvisorAccepted solution
Community Advisor
October 10, 2023

Hi @campaignerforlife ,

Create a JS, and add below script

 

var frequency = 10 * 1000 // 10 seconds task.wait(frequency)

 

~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups