Workflow

Overview

The content on this page helps you set up and verify the workflow for the complaints module using Postman APIs. Workflows define how a complaint moves from one stage to another (e.g., from "Apply" to "Resolved").

A workflow defines:

  • All states a complaint goes through (e.g., Pending, Resolved)

  • Transitions between states (what happens when a user clicks Assign, Resolve, etc.)

  • Roles allowed to take each action

  • SLA (Service Level Agreement) durations for each state


Configure Workflows

1

Import Postman Collection

  • Use the provided Postman collection for workflow setup.

  • Make sure your Postman environment contains the following values:

    • baseUrl (e.g., https://dev.digit.org)

    • authToken (Superuser token)

    • tenantId (e.g., pb, uk)

2

Setup Before API Calls

Field
What to use

authToken

A Superuser token with workflow permissions

tenantId

Must be state-level (e.g., pb, not pb.amritsar)

3

Create Workflow

  • Use POST /businessservice/_create

  • Paste the sample payload (see below)

  • Hit "Send" in Postman

  • If successful, you’ll receive a confirmation response

4

Verify the Workflow

  • Use POST /businessservice/_search

  • Search with:

    • tenantId: pb

    • businessService: PGR

  • Confirm:

    • All states and transitions are listed

    • Roles and actions are mapped correctly

5

Update Workflow (if required)

If something is missing or incorrect:

  • Use POST /businessservice/_update

  • Update only the affected parts (state, action, etc.)

  • Re-verify using the /search API

Sample Workflow Payload

Below is an example workflow for the complaints module:

{
  "tenantId": "pb",
  "businessService": "PGR",
  "business": "pgr-services",
  "businessServiceSla": 432000000, // 5 days
  "states": [
    {
      "isStartState": true,
      "isTerminateState": false,
      "isStateUpdatable": true,
      "docUploadRequired": false,
      "actions": [
        {
          "action": "APPLY",
          "nextState": "PENDINGFORASSIGNMENT",
          "roles": ["CITIZEN", "CSR"]
        }
      ]
    },
    {
      "state": "PENDINGFORASSIGNMENT",
      "applicationStatus": "PENDINGFORASSIGNMENT",
      "isStateUpdatable": false,
      "actions": [
        {
          "action": "ASSIGN",
          "nextState": "PENDINGATLME",
          "roles": ["GRO", "DGRO"]
        },
        {
          "action": "REJECT",
          "nextState": "REJECTED",
          "roles": ["GRO", "DGRO"]
        }
      ]
    },
    {
      "state": "PENDINGFORREASSIGNMENT",
      "applicationStatus": "PENDINGFORREASSIGNMENT",
      "isStateUpdatable": false,
      "actions": [
        {
          "action": "REASSIGN",
          "nextState": "PENDINGATLME",
          "roles": ["GRO", "DGRO"]
        },
        {
          "action": "REJECT",
          "nextState": "REJECTED",
          "roles": ["GRO", "DGRO"]
        }
      ]
    },
    {
      "state": "PENDINGATLME",
      "applicationStatus": "PENDINGATLME",
      "sla": 259200000,  // 3 days
      "actions": [
        {
          "action": "RESOLVE",
          "nextState": "RESOLVED",
          "roles": ["PGR_LME"]
        },
        {
          "action": "REASSIGN",
          "nextState": "PENDINGFORREASSIGNMENT",
          "roles": ["PGR_LME"]
        }
      ]
    },
    {
      "state": "REJECTED",
      "applicationStatus": "REJECTED",
      "isTerminateState": true,
      "actions": [
        {
          "action": "REOPEN",
          "nextState": "PENDINGFORASSIGNMENT",
          "roles": ["CITIZEN", "CSR", "CFC"]
        },
        {
          "action": "RATE",
          "nextState": "CLOSEDAFTERREJECTION",
          "roles": ["CITIZEN", "CFC"]
        }
      ]
    },
    {
      "state": "RESOLVED",
      "applicationStatus": "RESOLVED",
      "isTerminateState": true,
      "actions": [
        {
          "action": "REOPEN",
          "nextState": "PENDINGFORASSIGNMENT",
          "roles": ["CITIZEN", "CSR", "CFC"]
        },
        {
          "action": "RATE",
          "nextState": "CLOSEDAFTERRESOLUTION",
          "roles": ["CITIZEN", "CFC"]
        }
      ]
    },
    {
      "state": "CLOSEDAFTERREJECTION",
      "applicationStatus": "CLOSEDAFTERREJECTION",
      "isTerminateState": true
    },
    {
      "state": "CLOSEDAFTERRESOLUTION",
      "applicationStatus": "CLOSEDAFTERRESOLUTION",
      "isTerminateState": true
    }
  ]
}

Developer Notes

Item
Notes

SLA Values

In milliseconds (e.g., 5 days = 432000000)

businessService

Must match what’s used in PGR module backend

Roles

Must exist in MDMS role-action mapping and Keycloak

Workflow Transitions

Each action should correctly link one state to another


Summary

Step
Action

1️⃣

Import Postman Collection

2️⃣

Set authToken, tenantId

3️⃣

Create workflow via /businessservice/_create

4️⃣

Verify with /businessservice/_search

5️⃣

Update using /businessservice/_update if needed


Last updated

Was this helpful?