Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Custom Delete Workflow for XFS and CFS

Avatar

Level 2

We have a requirement to implement a custom delete workflow to handle the deletion of multiple XFS and CFS instances. As part of this process, the workflow should generate a single, consolidated notification indicating whether each asset was either deleted or locked.

Additionally, in cases where an asset is locked, we would like to explore the possibility of automatically re-triggering the workflow once the asset becomes unlocked.

Has anyone implemented a similar solution, or are there any best practices you could share?

Topics

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

2 Replies

Avatar

Community Advisor

Hi @harshak11490245 ,

Custom Delete Workflow for XFS and CFS (with Lock Handling & Retry Logic):

Try below steps:

1. Custom Workflow Step

Create a Process Step that receives a payload list of XFS/CFS paths (could be passed via workflow metadata or fetched from a list node):

@Override
public void execute(WorkItem workItem, WorkflowSession session, MetaDataMap args) throws WorkflowException {
    WorkflowData data = workItem.getWorkflowData();
    List<String> assetPaths = getPathsFromPayload(data);
    
    Map<String, String> resultMap = new HashMap<>();
    
    for (String path : assetPaths) {
        Resource res = resourceResolver.getResource(path);
        if (res == null) {
            resultMap.put(path, "NOT FOUND");
            continue;
        }
        Node node = res.adaptTo(Node.class);
        if (node != null) {
            if (!node.isLocked()) {
                node.remove(); // or use assetManager.removeAsset() if in /content/dam
                resultMap.put(path, "DELETED");
            } else {
                resultMap.put(path, "LOCKED");
                addToRetryQueue(path); // Your retry mechanism
            }
        }
    }

    storeResult(workItem.getWorkflowData().getPayload().toString(), resultMap);
}

Avatar

Community Advisor

@harshak11490245 Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!


Aanchal Sikka