REST API - listing and releasing job stream dependencies in the plan

Use REST APIs to list the dependencies of a job stream and then release or remove them.

About this task

This process involves retrieving a job stream current data and list of dependencies through a GET REST API, and then managing those dependencies using a PUT REST API.

Procedure

  1. First, get the current data and dependencies for the job stream you want to modify. Use the GET/twsd/api/v2/plan/jobstream endpoint to find the job stream.
    1. In the Swagger UI, expand the endpoint. Use the query filters or the oql string parameter to locate your job stream.
    2. Click Execute.
    3. From the API response, copy the job stream id and examine the dependencies array in the response body to identify the dependencies you want to manage.

      Example of a response payload showing various dependency types:

      {
        "flowNodeType": "JOBSTREAM",
        "id": "64ac512a-c2be-3537-9ca8-cfff3d1e9ded",
        "planId": "57c9a3d5-e6a0-3f0d-96c4-c65602a069b2",
        "folderId": "742ba6a6-31aa-3051-b810-3ced4fc624b4",
        "folder": "/",
        "name": "TESTJS3",
        "workstationId": "da0d42a6-d0a4-32de-b106-aa35a87f1a8e",
        "workstation": "/RMMYCLDTL42671_1",
        "dependencies": [
          {
            "dependencyType": "JOIN",
            "satisfied": false,
            "joinName": "JOIN",
            "joinQuantity": 0,
            "members": [
              {
                "dependencyType": "EXTERNAL_JOBSTREAM",
                "id": "9daec769-39e0-3283-9006-2933c84d3c78",
                "dependencyStatus": "UNDECIDED",
                "satisfied": false,
                "depSequence": 1000,
                "conditional": true,
                "jobStreamId": "9daec769-39e0-3283-9006-2933c84d3c78",
                "jobStreamName": "FINALPOSTREPORTS",
                "jobStreamWorkstation": "/RMMYCLDTL4267_XA",
                "jobStreamSchedTime": "2025-10-13T21:59:00Z",
                "jobStreamFolder": "/",
                "predecessorStatus": {
                  "cancelPending": false,
                  "canceled": false,
                  "started": false,
                  "error": false,
                  "dontRun": false,
                  "status": "HOLD"
                },
                "folderOriginalName": "RMMYCLDTL4267_XA",
                "jobStreamSuccId": "64ac512a-c2be-3537-9ca8-cfff3d1e9ded",
                "statusConditions": [],
                "outputConditions": [],
                "pending": false,
                "zombie": false
              }
            ],
            "criteria": "ALL"
          },
          {
            "dependencyType": "RESOURCE",
            "id": "69b358f5-cc55-36cf-974e-51650820b292",
            "dependencyStatus": "UNDECIDED",
            "satisfied": false,
            "folderId": "742ba6a6-31aa-3051-b810-3ced4fc624b4",
            "folder": "/",
            "name": "TESTR",
            "originalName": "TESTR",
            "workstation": "/RMMYCLDTL426711",
            "workstationId": "c598409a-a2de-3863-8e8f-8b36180c2dc3",
            "workstationOriginalName": "RMMYCLDTL426711",
            "quantity": 1,
            "available": 1,
            "actionOnComplete": "DEFAULT",
            "loadedFromDb": false
          },
          {
            "dependencyType": "PROMPT",
            "id": "3e5c3918-af8c-3d32-a733-b009492ee5a9",
            "dependencyStatus": "SATISFIED",
            "satisfied": true,
            "depSequence": 1,
            "folderId": "742ba6a6-31aa-3051-b810-3ced4fc624b4",
            "folder": "/",
            "promptName": "TESTPRO",
            "promptOriginalName": "TESTPRO",
            "text": "test",
            "promptStatus": "ANSWERED_YES",
            "promptType": "Predefined Prompt",
            "number": 2,
            "loadedFromDb": false,
            "actions": [
              {
                "key": "REPLY_PROMPT",
                "id": "3e5c3918-af8c-3d32-a733-b009492ee5a9"
              }
            ]
          }
        ],
        "dependenciesStats": {
          "numberOfDependencies": 2,
          "numberOfJobDependencies": 0,
          "numberOfJobStreamDependencies": 1,
          "numberOfInternetworkDependencies": 0,
          "numberOfPromptDependencies": 0,
          "numberOfResourceDependencies": 1,
          "numberOfFileDependencies": 0,
          "numberOfUnresolvedDependencies": 2,
          "numberOfNonResourceUnresolvedDependencies": 1,
          "numberOfCompletedDependencies": 0,
          "numberOfSuccessors": 0
        },
        "timeRestrictions": {
          "startTime": "2025-10-14T12:30:00Z",
          "lateStartAction": "doNotRun",
          "timeDependent": true
        }
      }
  2. Now, use the job stream ID to update the dependencies by choosing one of the following actions.
    1. To release all dependencies, use the PUT/twsd/api/v2/plan/jobstream/{jobStream_id}/action/release-all-dependencies endpoint. In the Swagger UI, paste the job stream ID into the ID parameter. No request body is required.
    2. To release specific dependencies, including time dependencies, use the PUT/twsd/api/v2/plan/jobstream/{jobStream_id}/action/release-dependencies endpoint. Provide a request body containing a dependencies array with only the dependencies you want to release.
    3. To remove specific dependencies, use the PUT/twsd/api/v2/plan/jobstream/{jobStream_id}/action/remove-dependencies endpoint. Provide a request body containing a dependencies array with only the dependencies you want to remove.

    Example of a request body for releasing or removing specific dependencies:

    {
      "dependencies": [
        {
          "dependencyType": "JOIN",
          "satisfied": false,
          "joinName": "JOIN",
          "joinQuantity": 0,
          "members": [
            {
              "dependencyType": "EXTERNAL_JOBSTREAM",
              "id": "9daec769-39e0-3283-9006-2933c84d3c78",
              "dependencyStatus": "UNDECIDED",
              "satisfied": false,
              "depSequence": 1000,
              "conditional": true,
              "jobStreamId": "9daec769-39e0-3283-9006-2933c84d3c78",
              "jobStreamName": "FINALPOSTREPORTS",
              "jobStreamWorkstation": "/RMMYCLDTL4267_XA",
              "jobStreamSchedTime": "2025-10-13T21:59:00Z",
              "jobStreamFolder": "/",
              "predecessorStatus": {
                "cancelPending": false,
                "canceled": false,
                "started": false,
                "error": false,
                "dontRun": false,
                "status": "HOLD"
              },
              "folderOriginalName": "RMMYCLDTL4267_XA",
              "jobStreamSuccId": "64ac512a-c2be-3537-9ca8-cfff3d1e9ded",
              "statusConditions": [],
              "outputConditions": [],
              "pending": false,
              "zombie": false
            }
          ],
          "criteria": "ALL"
        },
        {
          "dependencyType": "RESOURCE",
          "id": "69b358f5-cc55-36cf-974e-51650820b292",
          "dependencyStatus": "UNDECIDED",
          "satisfied": false,
          "folderId": "742ba6a6-31aa-3051-b810-3ced4fc624b4",
          "folder": "/",
          "name": "TESTR",
          "originalName": "TESTR",
          "workstation": "/RMMYCLDTL426711",
          "workstationId": "c598409a-a2de-3863-8e8f-8b36180c2dc3",
          "workstationOriginalName": "RMMYCLDTL426711",
          "quantity": 1,
          "available": 1,
          "actionOnComplete": "DEFAULT",
          "loadedFromDb": false
        },
        {
          "dependencyType": "PROMPT",
          "id": "3e5c3918-af8c-3d32-a733-b009492ee5a9",
          "dependencyStatus": "SATISFIED",
          "satisfied": true,
          "depSequence": 1,
          "folderId": "742ba6a6-31aa-3051-b810-3ced4fc624b4",
          "folder": "/",
          "promptName": "TESTPRO",
          "promptOriginalName": "TESTPRO",
          "text": "test",
          "promptStatus": "ANSWERED_YES",
          "promptType": "Predefined Prompt",
          "number": 2,
          "loadedFromDb": false,
          "actions": [
            {
              "key": "REPLY_PROMPT",
              "id": "3e5c3918-af8c-3d32-a733-b009492ee5a9"
            }
          ]
        }
      ]
    }
  3. After choosing an endpoint and providing the required parameters, click Execute.
    The API returns a success message, and the job stream dependencies are updated.
  4. To verify the update, run the GET/twsd/api/v2/plan/jobstream API call again for the same job stream. Check that the dependencies array in the response reflects the changes you made.