> For the complete documentation index, see [llms.txt](https://docs.decisionrules.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decisionrules.io/doc/v1/other/rule-state.md).

# Rule State

\*Applies to all Rule types - Decision Rules, Scripting Rules and Rule Flows

## The two rule states

Every Rule (Decision Rule/Scripting Rules/Rule Flow) table has two control states: **`Published`** and **`Pending`**. The state can be set on every **version** of the rule separately.

Decision tables and scripting rules are in **`Published`** state when created, but Rule Flow are in **`Pending`** state as well as all newly created versions and all imported rules.

### Published state

Rule in **`Published`** state is ready for production and is available via [Solver API](/doc/v1/api/rule-solver-api.md).

#### Examples:

![](https://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/BjUTWwi7rlmO4mbgNUJ9/image%20\(15\).png)

![](https://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/Xd5rdDKfr2CkTmZygmmD/image.png)

### Pending state

Some rules or versions of rules are not yet ready for production. For example, because the rule is still in development. Such a rule has a "Pending" status and it cannot be accessed using [Solver API](/doc/v1/api/rule-solver-api.md). When trying to solve such a rule, [Solver API](/doc/v1/api/rule-solver-api.md) returns the following HTTP request error:

```javascript
400 Bad Request
{
  "error": {
    "message": "Rule state is not published"
  }
}
```

{% hint style="success" %}
For the purpose of testing your rules and their versions that are not yet in production, you can use the **Debug** in [Test Bench](/doc/v1/other/test-bench.md) to solve the rule even if it is in the "Pending" state.
{% endhint %}

#### Example:

![Rule in pending state](https://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/yHMY5MFs6VbGFvh6mP62/image.png)

### How to change the rule state

The state can be changed in rule detail by clicking on "State". The rule **must be saved** to apply the changes made on the state.

![](https://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/I3xUlAlYSsNxSrL9BzBR/image.png)


---

# 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.decisionrules.io/doc/v1/other/rule-state.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.
