Tigger workflow on publish but not quick publish for all nodes using launcher | Community
Skip to main content
Level 3
March 14, 2025
Solved

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

  • March 14, 2025
  • 2 replies
  • 1223 views

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.

Best answer by giuseppebaglio

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


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.

 

2 replies

giuseppebaglio
Level 10
March 14, 2025

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-stopped-working-on-aemaacs-publisher/m-p/720845/highlight/true#M177591). 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.

 
AliSyed1Author
Level 3
March 14, 2025

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

giuseppebaglio
Level 10
March 14, 2025

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.

 

 
Uppari_Ramesh
Level 5
March 16, 2025

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.

AliSyed1Author
Level 3
March 20, 2025

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.

AliSyed1Author
Level 3
March 20, 2025

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.

 


Thanks