Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.
SOLVED

Tigger workflow on publish but not quick publish for all nodes using launcher

Avatar

Level 4

Hello everyone,
I have a requirement where I need to trigger a workflow upon publishing of some nodes like (page, assets, content fragments, experience fragments , tags , e.t.c) whatever resource a business user can see and publish.

I need to work only for quick publish or publish button but not for manage publication. 

Is there any way that launcher detects all node types? so I can trigger workflow for that path. I have tried nt:base and anynodetype option but it is not working.

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 8

The project has been implemented to support the OOTB Akamai CDN, but it can be easily extended to support other CDNs by following the instructions in the section Implementing a Custom CDN Provider:

  1. Create a class implementing the CdnInvalidationService interface. This defines the key methods to invalidate by tag, code and URL.

  2. Add logic in your class to call your CDN's API based on the provided parameters. Refer to the Akamai service class for sample code.

  3. Configure your service class via the OSGi config manager, providing any necessary credentials and settings. 

  4. Update the CDN Configuration ID on the EditorialAssetInvalidationJobConsumer to match your custom service.

 

View solution in original post

14 Replies

Avatar

Level 8

Is there a specific reason for choosing the launcher solution? If so, you should define a launcher with the event type set to "modified." Within your custom workflow, you will need to include logic to determine whether the item of interest has been truly activated or if some other change has occurred.

 

Instead, I would recommend setting up an event listener for the published event (https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/replication-event-listener.... This way, you can be certain that you will only process items after they have been activated. Once you have that in place, adding your custom logic should be quite straightforward.

 

Avatar

Level 4

I used events . but I want to use launcher. Is there a way to do so?

Avatar

Level 8

You can define a new WF launcher with a node type set to Modified. However, you will need to implement custom logic to determine whether the changes to the items were due to a replication action.

Screenshot 2025-03-14 at 12.49.34.png

 

 

Avatar

Level 4

Thank you I understood it but as I mentioned in above. How should i trigger it for all nodes and only for quick publish.Is it possible to check if it trigerred by quickpublish button. even if I used event listener Is it possible to check the publication is trigerred by quick publish not manage publication. I am using event handles with event topic com/day/cq/replication

Thank you.

Avatar

Level 8

To my knowledge, there is no way to determine which UI button triggered the item activation from an event listener.

 

Avatar

Level 4

Thanks. I try to know based on the property values that gets changed upon activation.
Thanks a lot for quick support.

Avatar

Level 8

AFAIK the properties updated on the activation items are the same regardless of the UI feature used.

Avatar

Level 5

Hi @AliSyed1 , If you really want this to work any way then you can try below approach.

 

1.Instead of using workflow launchers, you can implement a servlet.

2. When someone clicks on quick publish or publish button then in the .js file where you call your servlet with your page paths as params and for this you need to overlay OOTB js files to hit a new servlet.

3. When someone triggers from manage publication you need not to call any servlet. There should be a diff .js file for this manage publication and even if it is a same js file you can put some if conditions to not trigger servlet.

 

Thanks,

Ramesh.

 

Thanks,

Ramesh.

Avatar

Level 4

Hi @Uppari_Ramesh  , Thanks for reply. The approach you suggested is good. but I can see that there are many js files and servlets. That is we have separate js file for pages , xf , assets , tags and so on. I think using event listener is some what nice approach. please correct me if needed. 

Avatar

Level 4

If i used event listener . what is best approach to make the cdn purging configurable. so authors can easily enable/disable or provide restricted paths? I thought of using a dedicated page. I don't think it is a good idea. Please note we have multiple subsidaries with dedicated author and approvers.

 

Thanks for your support.

Avatar

Level 8

You may want to have a look at my repository: https://github.com/realgpp/aem-cdn-cache-invalidator.

This AEM library automates invalidating cached content in content delivery networks (CDN) when publishing updates in AEM.

Avatar

Level 4

Hi @giuseppebag  is aemaacs ootb cdn akamai or fastly? Please clear my doubt. my project lead told that it is fastly.

Avatar

Correct answer by
Level 8

The project has been implemented to support the OOTB Akamai CDN, but it can be easily extended to support other CDNs by following the instructions in the section Implementing a Custom CDN Provider:

  1. Create a class implementing the CdnInvalidationService interface. This defines the key methods to invalidate by tag, code and URL.

  2. Add logic in your class to call your CDN's API based on the provided parameters. Refer to the Akamai service class for sample code.

  3. Configure your service class via the OSGi config manager, providing any necessary credentials and settings. 

  4. Update the CDN Configuration ID on the EditorialAssetInvalidationJobConsumer to match your custom service.

 

Avatar

Level 4

Thanks