xtk.workflow.PostEvent in Delivery Template | Community
Skip to main content
New Participant
July 29, 2025
Question

xtk.workflow.PostEvent in Delivery Template

  • July 29, 2025
  • 1 reply
  • 407 views

Hello,

 

I have added the following javascript code to a copy of the notifySupervisor template in order to send workflow failure alerts to an ACC workflow for further processing:

 

<%

xtk.workflow.PostEvent("ccStageAlerts","signal","",<variables workflowLabel = {dataSource.workflowLabel} workflowName = {dataSource.workflowName} taskName = {dataSource.taskName} instanceName = {dataSource.instanceName}/>,false);

%>

 

This javascript is executed as expected and the data is sent to the 'ccStageAlerts', however, the HTML compiler fails because it does not recognize the "xtk" classification, so the delivery does not get sent.

 

Is there another way to post an event to a workflow from within a delivery?

 

Thanks,

Skyler

1 reply

ParthaSarathy
New Participant
July 30, 2025

Hi @skylerqu2 ,

Store the variable in your 'ccStageAlerts' workflow and to call these variables in delivery refer this section - Calling a Variable in the Content of the Delivery

 ~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups
SkylerQu2Author
New Participant
July 30, 2025

Hi @parthasarathy,

 

I'd like to send delivery variables to the 'ccStageAlerts' workflow, not the other way around.

 

Thanks,

Skyler

Rch_
New Participant
August 26, 2025

Hi @skylerqu2,

 

Since you want to send variables from the delivery to the ‘ccStageAlerts’ workflow, here’s what I’d suggest:

 

- Use a JavaScript activity inside the workflow itself to handle and process those variables when the workflow runs.

- From the delivery side, it’s not really possible to call xtk.workflow.PostEvent directly in the delivery content (that environment doesn’t support it). Instead, you could trigger the workflow externally—like via an API call or some other process that has the right permissions and context.

- If your delivery is actually triggered by a workflow, another option is to pass those variables through the workflow context before sending the delivery, so the workflow already has everything it needs when it runs.

Thanks,