AEM workflow : How to update payload value using API | Community
Skip to main content
Level 3
July 27, 2018
Question

AEM workflow : How to update payload value using API

  • July 27, 2018
  • 2 replies
  • 2729 views

I am wondering if anyone knows or used AEM api to dynamically update currently running workflow instance payload value.

We have a workflow which is started via workflow launcher with a payload "path A" and in next workflow step we modify path A value to path B (after applying some logic ) and now we want to set/update payload to path B which will be consumed by subsequent steps of same workflow instance.

I looked around but couldn't find a method like setPayload() or updatePayload() in WorkflowData like it has for getPayload().

Alternatively, I can walk through crx node of running workflow instance (var/workflow/instances/server0/xxxx/data/payload) and update payload property value but I would prefer any inbuilt method or API to do the same.

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

arunpatidar
Community Advisor
Community Advisor
July 28, 2018

Hi,

There is no dedicated API to update workflow payload.

You need to go with Node API to update payload node's path property.

Please check if you need to change currentPath property of a node of current workitems  as well.

Thanks

Arun

Arun Patidar
joerghoh
Adobe Employee
Adobe Employee
July 28, 2018

You should not change the payload of a workflow. While technically it's possible to do so via the JCR API, it's definitly not advised, because a lot of the workflow code is dependent on it.