AEM ootb unarchiver workflow step | Community
Skip to main content
Level 1
July 25, 2026
Question

AEM ootb unarchiver workflow step

  • July 25, 2026
  • 4 replies
  • 62 views

I am using unarvhiver step to extract zips, but thers is not trace of extracted folder , so how can I find the name.

4 replies

lukasz-m
Community Advisor
Community Advisor
July 26, 2026

Hi ​@RinkiShahi28,

In general, it depends on option that is selected on step level. By default below option is selected:

In practice it means, that the archive will be exctracted in the location where it has been uploaded. So assuming you uploaded images.zip into DAM, unarchive step will exctract it into images folder.

However in case images folder would already exists, archive will be exctracted to images0 folder.

Last but not least, if you are not able to find exctracted files please check following aspects:

  • verify if Handler Advance optinos is enbale on the step level
  • verify if Disable Extraction is not checked
  • verify if workflow completed sucersfully, and also look into error.log
chaudharynick
Level 4
July 27, 2026

​​​​@RinkiShahi28 

The OOTB Unarchiver workflow step doesn’t store or expose the extracted folder name in the workflow metadata. The extracted structure depends on the ZIP itself:

  • If the ZIP contains a single top-level folder, that folder is created under the destination.
  • If the ZIP contains files at the root level, they’re extracted directly into the destination, so no new folder is created.
Level 1
July 27, 2026

Yes, that’s my issue I was looking for extracted folder reference in metadata because I have large pool of assets with complex names. So guessing extracted folder names worked 95% of time but fails for few.

Level 4
July 28, 2026

Hi ​@RinkiShahi28,

Good answers above on the folder naming convention. To solve your specific problem, reliably finding the extracted folder name in a downstream workflow step regardless of the numbered suffix, here’s the pattern:

The root cause of your 5% failures is the OOTB step’s conflict resolution: if images already exists it creates images0, then images1, etc. There’s no metadata written back with the actual resolved folder name, so you can’t safely assume the name.

Reliable approach, resolve the folder at runtime in a custom workflow step:

// Run immediately after the Unarchiver step

String zipPath = workItem.getWorkflowData().getPayload().toString();

String parentPath = zipPath.substring(0, zipPath.lastIndexOf('/'));

String baseName = zipPath.substring(zipPath.lastIndexOf('/') + 1, zipPath.lastIndexOf('.'));

 

Resource parent = resolver.getResource(parentPath);

// Find the actual extracted folder by matching base name prefix

for (Resource child : parent.getChildren()) {

    if (child.getName().startsWith(baseName) &&

        child.isResourceType("sling:Folder")) {

        // This is your extracted folder

        workflowSession.getWorkflow(workItem.getWorkflow().getId())

            .getWorkflowData().getMetaDataMap()

            .put("extractedFolderPath", child.getPath());

        break;

    }

}

This handles images, images0, images1 reliably by scanning siblings with the base name prefix rather than guessing.

Then read it in any downstream step:

String extractedPath = workItem.getWorkflow()

    .getWorkflowData().getMetaDataMap()

    .get("extractedFolderPath", String.class);

This gives you a deterministic reference regardless of how many numbered variants exist.