Decorative double Helix

How to Do a Tree Activation on AEM as a Cloud Service

Sometimes it’s necessary to publish a whole tree of documents or assets, such as when a whole series of documents is ready to go live, or when you’ve just done an asset migration to AEM as a Cloud Service. The way that one does these bulk activations has changed over the last few years, and you no longer can do a tree replication in the old way on AEM Cloud Service. Here’s what’s changed:

Tree Replication on Previous Version of AEM

In previous versions of AEM (i.e. AEM 6.5 and earlier), when needing to do bulk activation (or “bulk publishing”) one would use the “Tree Replication” or “Tree Activation” functionality in AEM. This would queue up all of the pages or assets that you want to replicate, and would add each of these into AEM’s replication queue.
At this point, you’ve initiated one of the most time-honored and classic ways of setting AEM on fire, as multiple things can and do often happen:

Anyone who has run an AEM site for any length of time has very likely run into replication issues and site reliability issues associated with tree replication.

Tree Replication on AEM as a Cloud Service

When AEM as a Cloud Service first launched, tree replication was still available (with limits) and was done in a similar fashion to how it was done on AEM 6.5. (the Tree Replication UI was actually then removed at the end of 2021)

As a first note, you should be aware of the fact that “replication” as it’s known in AEM 6.5 and before is no longer how content gets from Author to Publish. This is now done with Sling Distribution. See this AdaptTo video for more on how that works:

The new mechanism for tree replication is the “Publish Content Tree” workflow.
What this workflow essentially does is:

Here’s what to do to put it to use: let’s say you’ve just done a migration of assets from your on-prem AEM 6.5 Assets instance to AEM as a Cloud Service. Let’s say you have the path of “/content/dam/arborydigital/images” which has a series of subtrees containing thousands of images that you want to activate. To activate/publish these:

  1. Go into your AEM Cloud Service Author instance

  2. Go to Tools -> Workflow -> Models

  3. Click “CREATE” and then “Create Model” in the top-right

  4. Give it a name

  5. Click on the workflow model and hit “EDIT”

  6. Search for “Process Step” and drag that in as a step in your workflow

  7. Click on the process step and hit the wrench icon to configure that step. Click on the “PROCESS” tab on the dialog that comes up.

  8. Select the “Publish Content Tree” process, and check the “Handler Advance” checkbox.

  9. Add “enableVersion=true,agentId=publish,includeChildren=true” in the arguments. By default, the Publish Content Tree workflow does NOT include children. Adding this argument makes the workflow iterate through the tree and publish all child nodes.
    Additionally, if you want to only target Preview with this workflow instead of your Publish tier, you can put “agentId=preview” as the argument instead. (Shout-out to Eric Van Geem for pointing this out!)

  10. Hit the “SYNC” button in the top right corner

  11. Select your new workflow in the Workflow Models list, and click “START WORKFLOW”. In the dialog that pops up, in the “Payload” you can either type or browse to the tree that you want to activate. For example, putting in “/content/dam/arborydigital/images” will then activate ALL nodes under that directory. Hit “RUN”.

  12. The workflow will then kick off, and will take anywhere from a few minutes to a few hours to complete, depending on how many assets you just told it to activate.

  13. Monitoring: you can then monitor status of your replication event by looking at the `aemerror` log either in Splunk or by tailing the AEM error logs with Adobe IO from the command line.

    You’ll see events like this, which indicate that the tree activation packages are rolling out to publish:

    20.08.2024 13:53:24.538 [cm-p107857-e1299068-aem-author-6d6b4bddf6-bnhwx] *INFO* [EventAdminAsyncThread #7] org.apache.sling.distribution.journal.impl.publisher.DistributionPublisher [publish] Successfully applied package with id dstrpck-1724161011143-d6d35a6a-d557-4f99-9906-e8eb55e7772c, type ADD, paths [/content/dam/arborydigital/images/smoothing-spline-jmp.jpg, /content/dam/arborydigital/images/screenshots/gallery/blorp.jpg…

Limits: I’ve not run into any limits yet on “how big is too big” for activating assets. While writing this blog post I kicked off a tree replication workflow on AEM Cloud Service for a content tree containing approximately 100GB of assets, and the tree finished before I finished writing the blog post.
Hopefully this works well for you!

About the Author

Tad Reeves

Principal Architect at Arbory Digital

Tad has been working with Adobe products since 2010 and has extensive experience in website infrastructure. Starting in 1996, he has worn nearly every hat in website delivery from solution architecture to product management, and has over two decades of experience. He loves that Arbory gives him the opportunity to provide honest and effective solutions, even if it means challenging prevailing sales perspectives. When Tad isn’t working, he enjoys mountain biking and exploring nature with his wife & 3 kids.

Contact Tad on Linkedin

Monolithic vs Composable vs Microservice CMS's - What's the right tool for the job?
Are monoliths all bad? What’s the difference between a monolith, composable and microservice based CMS?
Making AEM & Edge Delivery Go CRAZY FAST - Interview with StreamX Co-Founder
How do you solve the constant problem of cache freshness and backend system latency in any modern CMS (especially AEM or Edge Delivery?) In this episode we talk to Michał Cukierman, CTO of Dynamic Solutions and co-founder of StreamX - a digital experience mesh for dramatically and reliably accelerating complicated dynamic content requests from the many constituent systems that make up a modern CMS deployment.
Adobe Summit 2024: AEM Architecture Disruption
It’s not hyperbole that if you haven’t put considerable effort into rethinking your full site delivery stack in the last few months, you are going to want to. So please - stop reading this right now, pop in some headphones and take this podcast for a walk and consider how it might affect your environment!