Custom Workflow Best Practice | Community
Skip to main content
Level 2
February 9, 2024
Solved

Custom Workflow Best Practice

  • February 9, 2024
  • 5 replies
  • 1383 views

Hey, guys. I'm in the process of creating a custom workflow process / step that will list all assets within a folder and subfolders. I initially used the Query Builder API, but I don't know if this is the best way to go about it. How would you approach something like this? Are there alternatives?

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 Shashi_Mulugu

@mrvnaz if the target scope is folders and subfolders, always best practice is to go with iterative/traversal pattern than query pattern.. 

 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/operations/query-and-indexing-best-practices.html?lang=en

 

 

5 replies

Shashi_Mulugu
Community Advisor
Shashi_MuluguCommunity AdvisorAccepted solution
Community Advisor
February 9, 2024

@mrvnaz if the target scope is folders and subfolders, always best practice is to go with iterative/traversal pattern than query pattern.. 

 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/operations/query-and-indexing-best-practices.html?lang=en

 

 

Kamal_Kishor
Community Advisor
Community Advisor
February 10, 2024

@mrvnaz : Before suggesting alternatives, it would be important to know

  • How is your content structured.
  • Are you in process of defining the structure or it is already created and you have to implement a solution to access it now. If already created, you can judge if can be iterated based on paths or would require a query based approach to retrieve them better.
  • Every workflow trigger would give the same response OR are there any input parameters on workflow.

Based on the answers of these, we can decide what may be an ideal approach to this. As a general rule, it is not advisable to do lot of queries in AEM as it will overburden your instance etc.
thanks.

Imran Khan
Community Advisor
Community Advisor
February 11, 2024

Querying is most expexisve feature wothin AEM. In place of that you can overlay workflow process step dialog and add a path browser in place of writing lot of custom baked code. You can read it's metadata at the time of execution.

 

We can suggest more optimized soluion if you can elaborate your use case.

mahi1729
Level 4
February 12, 2024

I am curious to know what the exact use case is, in workflow do you intend to show the items some where?  Or do you want to find child items or filter child items of the payload based on some criteria, etc Based on the usecase, it makes sense to decide if u want to use a query or not like the experts suggested before me. Perhaps details of the exact usecase can help u get more directons.

Thanks !

Jagadeesh_Prakash
Community Advisor
Community Advisor
February 12, 2024

@mrvnaz  I am thinking it's just you need the list of assets inside a folder for a reporting purpose. Go through below article which gives you an OOTB feature to list down the assets as json structure. https://experienceleague.adobe.com/docs/experience-manager-64/assets/extending/mac-api-assets.html?lang=en#retrieve-a-folder-listing