Skip to content

Stateless Workflows

Mark Abrams edited this page Apr 17, 2023 · 1 revision

The testing framework must have access to the workflow run history to be able to check (assert) the workflow execution. With stateless Logic Apps, the run history is not stored unless the Workflows.<workflow name>.OperationOptions setting is set to WithStatelessRunHistory in the settings file.

The testing framework will automatically check if this setting exists for a stateless workflow. If the setting does not exist, and the workflow.autoConfigureWithStatelessRunHistory configuration option is set to true in testConfiguration.json, the framework will automatically create the setting so that the run history is stored. You will then see this in the test execution log:

 Workflow is stateless, creating new setting: Workflows.<workflow name>.OperationOptions = WithStatelessRunHistory

If the workflow.autoConfigureWithStatelessRunHistory configuration option is set to false, the test will fail:

LogicAppUnit.TestException: The workflow is stateless and the 'Workflows.<workflow name>.OperationOptions' setting is not configured for 'WithStatelessRunHistory'.
This means that the workflow execution history will not be created and therefore the workflow cannot be tested.
Set the 'workflow.autoConfigureWithStatelessRunHistory` option to 'true' in 'testConfiguration.json' so that the testing framework creates this setting automatically when running the test.

The default value for the workflow.autoConfigureWithStatelessRunHistory configuration option is true.

Clone this wiki locally