Customise Workflows

Overview

Defines how a complaint moves from creation to closure with states, actions, roles, and SLA. Configured in workflow service and linked to a businessService (e.g., PGR). Customise only when adding/removing states, changing roles, or altering SLA rules. Used by Workflow service to control and validate status transitions.

Workflow – Config vs Customisation

  • Config: Update workflow states, actions, roles, and businessService values in workflow (no code change, just configuration update).

  • Customisation: Needed only if workflow logic involves dynamic role assignment, conditional state changes, or integration with external systems.

  • When to change: Adding/removing states, new approval layers, SLA changes, or parallel approval paths.

Steps

1

View existing workflow

  • Use the Search API provided in the Postman collection to retrieve the current workflow configuration. This retrieves the entire JSON structure for the specific business service.

2

Prepare the update payload

  • Take the exact response from the Search API. Paste it into the Update API request body (available in the Postman collection). This ensures you modify only what's needed while keeping the rest intact.

3

Make your custom changes

  • Modify the workflow JSON to fit your needs. A few example customisations are given below for reference.

Add new state

{
  "state": "REJECTED",
  "applicationStatus": "REJECTED",
  "isTerminateState": true,
  "actions": [
    {
      "action": "REOPEN",
      "nextState": "PENDINGFORASSIGNMENT",
      "roles": ["CITIZEN", "CSR", "CFC"]
    },
    {
      "action": "RATE",
      "nextState": "CLOSEDAFTERREJECTION",
      "roles": ["CITIZEN", "CFC"]
    }
  ]
}

Note: For each new state, ensure to define:

  • state and applicationStatus

  • isTerminateState (true/false)

  • Required actions

  • Roles that can take each action

  • nextState for each action

Add new action to an existing state

To add a new workflow step within an existing state:

"actions": [
  {
    "action": "ESCALATE",
    "nextState": "ESCALATED",
    "roles": ["PGR_LME"]
  }
]

Make sure you:

  • Define a unique action name (action)

  • Set a valid nextState

  • Assign appropriate roles

Update roles for existing actions

Use the code below to update or remove specific role-based access.

"actions": [
  {
    "action": "REOPEN",
    "nextState": "PENDINGFORASSIGNMENT",
    "roles": ["CITIZEN", "CFC"] // Add or remove roles here
  }
]
4

Restart Workflow Services

  • DIGIT workflow engine caches configurations.

  • Restarting reloads the updated workflow JSON.

How to restart: If you're using Kubernetes:

kubectl rollout restart deployment workflow
  • Or use your DevOps team's process to restart the egov-workflow-v2 service.

📌 Final Note

Always validate:

  • The nextState exists or is being added in the same update

  • SLAs are provided if required (sla: 259200000 → 3 days)

  • New states include all relevant flags: isTerminateState, isStateUpdatable, docUploadRequired, etc.

Last updated

Was this helpful?