New in 0.18.0

v0.18.3

Client

Get Workflow State

It is possible to retrieve the complete internal state of a workflow directly from storage as a JSON string ready for display. This provides access to all workflow execution details including running methods, workflow properties, buffered messages, and more.

This feature requires storage to be configured in the client. If storage is not configured, calling getWorkflowStateJsonById will throw an IllegalStateException.

Configuration

First, configure storage in your Infinitic client:

Retrieving Workflow State JSON

Once storage is configured, you can retrieve the state of any workflow by its ID as a pretty-printed JSON string:

The generated JSON is intended for inspection and display. It expands internal SerializedData values and renders metadata in a readable JSON form.

Workflow State Contents

The workflow state JSON contains comprehensive information about the workflow:

  • workflowId: Unique identifier for the workflow instance
  • workflowName: Name of the workflow
  • workflowVersion: Version of the workflow implementation
  • workflowTags: Tags associated with the workflow
  • workflowMeta: Metadata attached to the workflow
  • workflowMethods: List of running workflow methods with their execution state
  • runningWorkflowTaskId: ID of the currently executing workflow task (if any)
  • currentPropertiesNameHash: Current values of workflow properties
  • messagesBuffer: Messages buffered while a workflow task is running
  • receivingChannels: Channels currently receiving signals

Use Cases

Debugging

Inspect workflow state to understand why a workflow is stuck or behaving unexpectedly:

Monitoring

Check the execution progress of running workflows:

Storage Support

The method automatically handles:

  • Compression: Supports gzip, bzip2, and deflate compression algorithms
  • Deserialization: Converts Avro binary format to workflow state objects internally
  • JSON Rendering: Produces a readable JSON representation suitable for display
  • Multiple Databases: Works with Redis, PostgreSQL, MySQL, and in-memory storage

The getWorkflowStateJsonById method returns null for workflows that don't exist or have been completed and removed from storage.

Async Access

Infinitic proposes also an asynchronous version of the method:

Previous
Cancel Running Workflows