#1183·PowerJob

Workflow API: `status` field not returned in JSON response (v5.1.2)

Author: a25001-TammyChangCreated Jul 6, 2026Updated Jul 6, 2026
Labelsquestion

Question

PowerJob Version: 5.1.2

The WorkflowInfoDTO Java class has both status (Integer) and enable (Boolean) fields, but the API response only returns enable. The status field is missing from JSON, causing it to be null after deserialization.


Details

Expected Behavior

The WorkflowInfoDTO class has both fields:

java
// PowerJob's WorkflowInfoDTO
private Integer status;   // Should be in JSON
private Boolean enable;   // Also in JSON

I expected the API /workflow/fetch?workflowId=XXX to return:

json
{
  "id": 422184,
  "wfName": "a7-pms-stats-workflow",
  "status": 1,      // ← Expected but missing
  "enable": true    // ← This is present
}

Actual Behavior

The API only returns:

json
{
  "id": 422184,
  "wfName": "a7-pms-stats-workflow",
  "enable": true    // Only enable, no status field
}

After Jackson deserialization:

  • workflow.getStatus()null
  • workflow.getEnable()true

Impact

Our code assumed status is always present:

java
// This caused NullPointerException
Integer status = workflow.getStatus();
if (status == 99) {  // NPE here!
    return true;  // Filter deleted workflows
}

We fixed it with defensive null checks, but the root cause is unclear.


Questions

  1. Why is the status field missing from the API response?

    • Is this due to permission changes in v5.x?
    • Is it a serialization configuration?
    • Or is this intentional?
  2. Should we use enable instead of status?

    • What's the correct way to check if a workflow is deleted?
    • Is there a migration guide?
  3. Is this documented?

    • Checked v5.1.2, v5.1.1, v5.1.0, v5.0.0-BETA release notes
    • Found no mention of this change

Environment

  • PowerJob Version: 5.1.2-jdk17
  • Dependencies:
    • powerjob-client:5.1.2
    • powerjob-worker-spring-boot-starter:5.1.2-jdk17
  • API Endpoints Tested:
    • /workflow/fetch?workflowId=XXX
    • /workflow/list

Test Code Used

bash
# PowerShell test with JWT authentication
$headers = @{
    "PowerJwt" = "your-jwt-token"
    "AppId" = "your-app-id"
}
$response = Invoke-WebRequest -Uri "http://powerjob.athena.com.tw/powerjob/workflow/fetch?workflowId=422184" -Headers $headers
$response.Content | ConvertFrom-Json | ConvertTo-Json -Depth 5

Result: enable field present, status field missing.


Suggestion

It would be helpful to clarify:

  1. Whether status is deprecated or just not serialized
  2. The recommended way to check workflow status (deleted/active)
  3. Document breaking API changes in release notes

Thank you!