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"

Once 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 for the connector to manage workflow lifecycles. There’s no guarantee that workflow states continue to persist when write operations are used to change the workflow states while such features are in use.

    For example, when the connector is configured in the active-standby mode, workflows will 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 would be running.

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