Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

How to trigger single workflow instance on asset folder or multiple assets ?

Avatar

Level 2

Even though the Multi Resource Support is activated for the workflow, once I select multiple assets from the dam and trigger the workflow it launches n instances OR it throws an alert if selected assets exceed 15.

 

How to enable multi resource support for DAM asset or entire asset folder ? Or is there any other workaround to trigger a single workflow instance for multiple resources.

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Another way to trigger a workflow on multiple assets is to set up your workflow to consume a folder path as a payload. When the workflow is initiated, one of the workflow steps will collect and find all the assets within the target folder path, and apply business logic to each of the assets.

I hope this helps, 

Brian

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @sachinn20956098 ,

 

OOTB Workflow initiation is on a per resource basis, via Workflow Packages or folders of limited size (15).

The ACS AEM Commons Bulk Workflow Manager provides bulk payload service. Please have a look at this:

https://adobe-consulting-services.github.io/acs-aem-commons/features/bulk-workflow-manager/index.htm...

 

Avatar

Employee

When Multi Resource Support is enabled, it creates only one instance for the full folder and the number of assets inside does not matter (the 15 asset limit doesn't apply here).

However, if we select individual assets and trigger the workflow on them, then irrespective of whether Multi Res Support is enabled or not, individual instances are created for each asset and the 15 max assets limit does apply here.

 

* When Multi Resource Support is enabled on Workflow, it doesn't consider the default limit. It performs operations on the entire folder which is selected. I was able to verify the same on my AEM 6.5.4 instance. 1) I enabled Multi Resource support on Request For Deletion w/o Deactivation workflow. 2) Then, I created that workflow on /content/dam/we-retail/en/products/activities. The Activities folder contained more than 20 assets. 3) I triggered the workflow on that activities folder, and verified that just one instance of workflow is created, and it deleted(after confirming the request in Inbox) the entire activities folder from that location.

1_MoreThan20Assets.JPG

2_MultiResourceEnabled_OneInstanceForMultipleAssets.JPG

 

 

3_MultipleAssetDeletionUsingSingleInstance_Completed.JPG

 

4_EntireEquipmentFolderDeleted.JPG

The limit is set to the number of payloads. That limit is 15. A payload can be a parent folder with 15 subfolders, each containing any number of assets. This way, the limit of 15 is still satisfied, as the payload count is 1(parent folder) on which the workflow is triggered. In case of assets, when you select multiple assets or folders directly from within a DAM folder, each of those selected assets/folders is a payload. The limit of 15 still has to be satisfied, however, in this case, the payload is not 1, as you have selected multiple assets/sub-folders individually.

 

Let's consider the following two scenarios: 1) 1 folder containing 15+ assets a) Whether the Multi Resource Support option is enabled or not, whenever you select those 15+ assets from within the assets folder, each asset selection is counted as 1 payload. Thus, there are 15+ payloads. So, the limit of 15 gets triggered. b) When you go to Workflow Model console, and trigger the workflow from there, on this parent folder containing more than 15 assets, the payload is 1, as the workflow is triggered on folder. This way, the limit of 15 is not shown, as the payload is still 1(i.e. the parent folder on which it's triggered). 2) 1 folder containing 14 assets + 1 subfolder containing a few more assets. In this scenario, when the MultiResource option is enabled, even when you select all the 14 assets + subfolder that contains more assets(taking the total count to more than 15) from within the folder that contains these assets, the payload count is still 15(14 assets + 1 subfolder). The limit of 15 is satisfied. When you trigger the same workflow(MultiResource option enabled) from Workflow Console, as you select the parent folder(that contains 14 assets + 1 subfolder containing more assets), the payload is 1, as you are running the workflow on the parent folder. This also allows you to run the workflow, as the limit is satisfied.

Hope it helps !!

Avatar

Correct answer by
Community Advisor

Another way to trigger a workflow on multiple assets is to set up your workflow to consume a folder path as a payload. When the workflow is initiated, one of the workflow steps will collect and find all the assets within the target folder path, and apply business logic to each of the assets.

I hope this helps, 

Brian