Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments

Workflow seems to execute multiple times on Node Created


Level 3


We have a case where one of our workflows seems to fail occasionally. The workflow is launched on Node Created with node type nt:file and path: /content/dam(/.*/)renditions/original. One of the tasks of the workflow is to notify users that an asset has been uploaded by sending notification to their inbox. This is the steps that seems to fail due to the fact that job has been done already and they indeed have notification for that asset already. The cause seems to be

Caused by: javax.jcr.ItemExistsException: node3_etc_workflow_instances_server0_2018-10-01_1_upload-asset_555 (Check full error below)

The step before the one described is a script that checks if the asset is not a sub-asset.

function check() {

  log.debug("---------- Executing: Sub-Asset Check ----------");

  var payload = workflowData.getPayload().toString();

  var retVal = false;


  log.debug("Payload: " + payload);

  if(payload.indexOf("/subassets/") > -1) {

  retVal = true;

    log.debug("\tIs a sub asset.");


  return retVal;

}//end function check

If we remove that step we don't see the occasional failures. The failures seem to be on different assets each time we upload the same group of assets. Is there a cause to think that the workflow can be executed more that once on node created or that this particular step that checks for sub-assets can cause the next step to be executed more than once?

Our model:

Screen Shot 2018-10-04 at 12.24.33 PM.png

04.10.2018 11:40:58.366 *ERROR* [JobHandler: /etc/workflow/instances/server0/2018-10-01_1/upload-asset_555:/content/dam/.../photography/room-scenes/entryway/Entryway 0012 Detail A Alt 02.tif/jcr:content/renditions/original] com.adobe.granite.workflow.core.job.JobHandler Error executing workflow step

com.adobe.granite.workflow.WorkflowException: Process execution resulted in an error

        at com.adobe.granite.workflow.core.job.HandlerBase.executeProcess(

        at com.adobe.granite.workflow.core.job.JobHandler.process(





        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

        at java.util.concurrent.ThreadPoolExecutor$ Source)

        at Source)

Caused by: com.adobe.granite.workflow.WorkflowException: Cannot add WorkItem to asset-taggers's inbox

        at com.adobe.granite.workflow.core.jcr.WorkItemManager.addWorkItem(

        at com.adobe.granite.workflow.core.jcr.WorkItemManager.addWorkItem(

        at com.adobe.granite.workflow.core.advance.ParticipantNodeHandler.doTransition(

        at com.adobe.granite.workflow.core.advance.ParticipantNodeHandler.doTransition(

        at com.adobe.granite.workflow.core.advance.AdvanceUtil.transitionFrom(

        at com.adobe.granite.workflow.core.WorkflowSessionImpl.completeInternal(

        at com.adobe.granite.workflow.core.WorkflowSessionImpl.complete(

        at com.adobe.granite.workflow.core.process.GotoProcess.execute(

        at com.adobe.granite.workflow.core.job.HandlerBase.executeProcess(

        ... 8 common frames omitted

Caused by: javax.jcr.ItemExistsException: node3_etc_workflow_instances_server0_2018-10-01_1_upload-asset_555

        at org.apache.jackrabbit.oak.jcr.session.NodeImpl$5.perform(

        at org.apache.jackrabbit.oak.jcr.session.NodeImpl$5.perform(

        at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(

        at org.apache.jackrabbit.oak.jcr.session.ItemImpl.perform(

        at org.apache.jackrabbit.oak.jcr.session.NodeImpl.addNode(

        at com.adobe.granite.workflow.core.jcr.WorkItemManager.addWorkItem(

        ... 16 common frames omitted

0 Replies


Level 2

Can you consider enabling audit.log entries to see what's the exact conflict? (note the change of log-level for audit.log to TRACE)