How do i assign a workflow dynamically to participants?

Answer, Resolution

In CQ5.3, this can be done by by creating your own workflow model using a custom ecma script that assign the next step dynamically. This is useful for situations where multiple users/groups need to use a same workflow model. In earlier versions, you will need to create multiple identical workflow models for the individual users/groups which makes it difficult to maintain. With this dynamic workflow model, one is only required for all the users/groups.

By developing your own ecma script, you can customize your own logic on how it will be assigned. The workflow model can call this ecma script during one of the steps.

Example of the ecma script for dynamic participants

function getParticipant() {
    var workflowData = workItem.getWorkflowData();
    if (workflowData.getPayloadType() == "JCR_PATH") { 
        var path = workflowData.getPayload().toString(); 
        if (path.indexOf("/content/geometrixx/en") == 0) {
            return "admin";
        } else {
            return "author";

The above shows how the workflow's next step gets assigned dynamically based on the payload's path.

Attached is a example package. Check the Dynamic user/group selection test workflow model for this example.

Applies to



이 작업에는 Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License의 라이센스가 부여되었습니다.  Twitter™ 및 Facebook 게시물은 Creative Commons 약관을 적용받지 않습니다.

법적 고지 사항   |   온라인 개인 정보 보호 정책