Workflow Management

Workflow Management Endpoint

A custom workflows management endpoint using Spring Actuator is provided to manage workflows.

To enable the workflows management endpoint:

management: 
  endpoints:
    web:
      exposure:
        include: "workflows"

After the workflows management endpoint is enabled, the following operations can be performed:

Endpoint Operation Payloads

/workflows

Read
(HTTP GET)

Request: None.

Response: Same payload as the /workflows/{workflowId} read operation, but as a list of all workflows.

/workflows/{workflowId}

Read
(HTTP GET)

Request: None.

Response:

{
  "id": "<workflowId>",
  "enabled": (true | false),
  "state": "(running | stopped | paused | unknown)",
  "inputBindings": [
    "<input-binding>"
  ],
  "outputBindings": [
    "<output-binding>"
  ]
}

/workflows/{workflowId}

Write
(HTTP POST)

Request:

{
"state": "STARTED | STOPPED | PAUSED | RESUMED"
}

Response: None.

  • Only workflows with Solace PubSub+ consumers (where the solace binder is defined in the input-#) support pause/resume.

  • Some features require the connector to manage the workflow lifecycle. If you use write operations to change the workflow state when these features are in use, the workflow state might not persist.

    For example, when the connector is configured in the active-standby mode, workflows automatically transition from running to stopped when the connector fails over from active to standby, and vice-versa for a failover in the opposite direction.

Workflow States

A workflow’s state is defined as the aggregate states of its bindings (see the bindings management endpoint) as follows:

Workflow State Condition

running

All bindings have state="running".

stopped

All bindings have state="stopped".

paused

All consumer bindings and all pausable producer bindings have state="paused".

unknown

None of the other states. Represents an inconsistent aggregate binding state.

When the producer or consumer binding is not implementing Spring’s Lifecycle interface, Spring always reports the bindings as state=N/A. The state=N/A is ignored when deciding the overall state of the workflow. For example, if the consumer's binding is state=running and the producer's binding is state=N/A (or vice versa), the workflow state is running.

For more information about binding states, see Spring Cloud Stream: Binding visualization and control.