> For the complete documentation index, see [llms.txt](https://stack.sylius.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stack.sylius.com/resource/index/index/state_machine.md).

# Configuring a state machine

{% hint style="warning" %}
This section is deprecated. However, as of now, the Sylius E-Commerce project is still resorting to this configuration so you might want to check it out.
{% endhint %}

You can either use [Symfony workflow](https://symfony.com/doc/current/components/workflow.html) or [Winzou state machine](https://github.com/winzou/StateMachineBundle). The recommended way is to use the `Symfony workflow component`.

If only Symfony workflow is on your requirements you have nothing to do.

But you can configure it explicitly:

## Configuring Symfony workflow as state machine\`

```yaml
sylius_resource:
    settings:
        state_machine_component: symfony
```

## Configuring Winzou as state machine\`

If Winzou state machine is on your requirements you have nothing to do even if Symfony workflow is on your requirements too.

But you can configure it explicitly:

```yaml
sylius_resource:
    settings:
        state_machine_component: winzou
```

## Applying a transition\`

You can create a route to apply any transition

```yaml
app_pull_request_apply_transition:
    path: /pull-requests/{id}/{transition}
    methods: [PUT]
    defaults:
        _controller: app.controller.pull_request:applyStateMachineTransitionAction
        _sylius:
            state_machine:
                #graph: pull_request # name of the graph for Winzou or workflow name for Symfony (optional)
                transition: $transition
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://stack.sylius.com/resource/index/index/state_machine.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
