> For the complete documentation index, see [llms.txt](https://docs.rewst.help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rewst.help/rewst-documentation/documentation/automations/workflows-in-rewst/best-practices-for-designing-workflows.md).

# Best practices for designing workflows

{% hint style="info" %}
These recommendations align with the standards and guidelines that our internal support team and service partners follow when building workflows with Rewst. Leverage the same principles that guide our experts, enhancing the efficiency, reliability, and maintainability of your automation. Any workflow built by the Rewst Agent will automatically follow these best practices.
{% endhint %}

## Design principles

When designing workflows, keep these three guiding principles in mind.

1. Simplicity: Create workflows that are user-friendly and easy to understand.
2. Modularity: Break down workflows into smaller, reusable components.
3. Maintainability: Build workflows that are straightforward to update and maintain.

## Automation build standards

A good workflow should meet all of these requirements.

* Consistency: Standardized practices lead to a consistent experience across different workflows.
* Quality assurance: Adhering to standards makes quality checks more efficient.
* Reusability: Modular design enables the reuse of components, speeding up development.
* Scalability: Design your workflows to handle increased complexity as your needs grow.
* Efficiency: Avoid redundancy by following a standardized approach.
* Knowledge Transfer: Standards foster collaboration and knowledge sharing within your team.
* Flexibility: Rewst's standards allow easy integration of new features without major rework.

## Design, test, and document workflows

* Develop and test your workflows in a sandbox or development environment. Make necessary changes, test, and sync to your live environment. Always test a workflow before publishing.
  * Mock mode in Rewst executions is also a great, safe way to see what your workflow will do without the commitment.
* Document workflows manually or with the Rewst Agent to keep track of the intent of each action and called workflow.
* When publishing a workflow, document the changes made in that update to help with version control of your workflow.&#x20;

## Workflow naming and categorization

Properly naming and categorizing your workflows is essential for clarity and navigation, especially as the number of workflows you use in Rewst grows over time.

Adhering to a consistent naming convention helps in understanding the purpose and function of each automation.

{% hint style="success" %}
**Proper example**: `List Disabled User Accounts`

**Improper example:** `Steve's Workflow`
{% endhint %}

You can also use [tags](/rewst-documentation/documentation/settings.md#tags) within Rewst to organize your automations effectively.

## Manage variables and tasks

Stay consistent with your styling when naming [variables](/rewst-documentation/documentation/automations/workflows-in-rewst/data-input-and-output-input-variables-and-context-variables.md). Choose a naming convention, for example `snake_case` or `camelCase`, and apply it uniformly.

### Organization variables

* Employ descriptive and straightforward wording using `snake_case` for clarity.
* Prefix integration-specific variables appropriately, like `psa_` for PSA-related variables.

### Work with transitions

{% hint style="info" %}
For more on transitions, see our documentation [here](/rewst-documentation/documentation/automations/workflows-in-rewst/rewsts-workflow-builder-how-to-set-up-a-workflow.md#add-transitions-between-nodes).&#x20;
{% endhint %}

* Use conditions like `{{ SUCCEEDED and CTX.list_of_things|d }}` to control the flow based on a node's success or failure.
* Transitions are evaluated from left to right, so order them carefully.


---

# 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://docs.rewst.help/rewst-documentation/documentation/automations/workflows-in-rewst/best-practices-for-designing-workflows.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.
