> For the complete documentation index, see [llms.txt](https://docs.struct.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.struct.com/tutorials/guides/how-to-use-workflows/how-to-use-transitions-in-a-workflow.md).

# How to use transitions in a workflow

A guide on how to transition between states in a workflow

## Adding transitions between states

Transitions control the flow between states and they are crucial for enabling state changes within a workflow. To add transitions between states in your workflow, press the “Add”-button to the far right while editing a state.&#x20;

<figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2FbiYWAGDnRxX5XDGQI12A%2Fimage.png?alt=media&amp;token=7a9ee8e5-43b7-49e9-bd77-8a5592aab02f" alt=""><figcaption><p>Edit workflow state page</p></figcaption></figure>

You will then be given the option to set up transitions from the state you are editing.

<figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2FiwF4b05cMqJdPa7kU6hZ%2Fimage.png?alt=media&amp;token=b69d1038-b65b-431c-89fe-0a7357dd251e" alt=""><figcaption><p>Edit workflow transition page</p></figcaption></figure>

Select the state you want to transition to from your list of created states. Provide a label and a description to help identify and clarify the purpose of the transition. You can also set up permissions to limit who can use the selected transition.&#x20;

## Transitions in workflow example

In the previous tutorial, "[How to Set Up and Edit a Workflow](/tutorials/guides/how-to-use-workflows/how-to-set-up-and-edit-a-workflow.md)", we established states to define the various stages in a workflow. Now we will create a transition from the state "Draft" to "Enrichment In Progress."

Below you can see an example of a workflow where we want to create a transition into the state "Enrichment In Progress".  This transition has been given the label "Begin Enrichment" in order to clearly indentify the transition. The description field is used to distinguish transitions in case there are multiple under a single state.&#x20;

<figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2FvMnnQaG3sbWim0fxouBk%2Fimage.png?alt=media&amp;token=e5a1946f-07b0-435c-8de6-7ef99ef2ab55" alt=""><figcaption><p>Edit workflow transition</p></figcaption></figure>

Below you can see an example of a state with a transition added to it.

<figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2FlYCFZjJsfjrmSIHzsu7N%2Fimage.png?alt=media&amp;token=13d02fc5-e801-40cf-b59c-6b4121d0de09" alt=""><figcaption><p>Transition added to state</p></figcaption></figure>

Now with the transitions created we continue setting up the rest, until we have the following example of a workflow. Below you can see all the states created with associated transitions between them.

<figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2FZaEFtdPYGNoc3Raf7aK1%2Fimage.png?alt=media&amp;token=f62d64d3-37f2-4dd9-8181-529689a07531" alt=""><figcaption><p>Workflow with states and transitions</p></figcaption></figure>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.struct.com/tutorials/guides/how-to-use-workflows/how-to-use-transitions-in-a-workflow.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
