Stateful workflows

Test what happens after the action.

Move beyond isolated responses. Give your application a configured API lifecycle and follow the same order from creation to cancellation.

Stateful workflows: an illustrative interactionIllustrative configured episode: create an order, read it, cancel it, then read the changed state.CONFIGURED EPISODECreate orderOrder ApendingReadpendingCancelchart ruleReadcancelledSame resource. Changed state.

What this makes testable

Connect the steps

Exercise an action and its later read together, instead of accepting the action response alone.

Keep identity visible

Check that subsequent requests refer to the same resource and return the state your scenario requires.

Make rules explicit

Configure the allowed lifecycle so your team can understand which action should lead to which result.

A workflow you can inspect

A cancellation should change the next read.

An accepted cancellation is only half the story. The next read should return the same order in its new state. Configured lifecycles let you exercise both sides of that interaction.

Put the whole sequence in your application test, from the first request to the later read.

  • Starting readOrder A is pending
  • Configured actionCancel Order A
  • Later readSame order, cancelled

FAQ

Does Gostly infer my business logic?

No. Statecharts express rules you configure. Model the dependency behavior your test needs; your application and its own database remain responsible for real business effects.

Does every create request produce state?

No. Start with a prepared resource or explicitly configured episode creation. An ordinary recorded POST response does not automatically create an arbitrary resource for later requests.

Can I start with an existing lifecycle?

Bundled lifecycles use an opt-in setting, and authored charts can bind separately. Recorded matches can answer before mutable state; check the returned identity and state with your application.

Resources

Go deeper on stateful workflows

Inspect a stateful test

Plan a create, read and cancel sequence with assertions that expose a static response.

Explore the worked case

Understand stateful serving

Read how configured resource state and chart transitions supply responses to your caller.

Read the technical guide

Configure your lifecycle

Use the editor and supported chart configuration when you are ready to build your scenario.

Open configuration details

Put the next step in your test.

Start with one dependency and one meaningful state change. Keep your application assertions in the test runner you already use.