> For the complete documentation index, see [llms.txt](https://docs.nected.ai/nected-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nected.ai/nected-docs/rules/concepts/test-and-publish-rules.md).

# Test & Publish Rules

Nected allows you to test rules in a staging environment before deploying them to production. This helps to ensure that your rules are working as expected. To test a rule, click the **Test** button.

**Testing scenarios**

Nected supports a variety of testing scenarios, including:

* Testing with different values for the input parameters.
* Testing with null values for the input parameters.
* Testing with optional input parameters.

![](/files/CAFPYX9xS7kodfrR7VKb)

{% hint style="info" %}
Now, If a rule has nullable input parameters, you can test the rule with `null` values for those parameters. If a rule has optional input parameters, you can test the rule with and without those parameters.
{% endhint %}

**Testing example**

To test a rule with different values for the input parameters:

1. Click the **Test in Staging** button.
2. In the **Test Rule** dialog box, enter different values for the input parameters.
3. Click the **Test Now** button.
4. After the test is completed, it generates a JSON code as the output.
5. If you see the success message (which you've given while adding data) in the code, that means your rule is ready to publish. If you see the failure message, that means your rule is not ready to publish.&#x20;

**Significance of testing**

Testing is important to ensure that your rules are working as expected. By testing your rules in a staging environment before deploying them to production, you can prevent errors and ensure that your rules are not causing any unintended consequences.

{% hint style="info" %}
Testing is mandatory to do on each edit before publishing to make sure that rule is behaving as expected and without errors.
{% endhint %}

**Final Step: Publish the Rule**

Once you are confident in the rule's functionality, publish it. This action makes the rule available for use within your Nected environment.


---

# 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:

```
GET https://docs.nected.ai/nected-docs/rules/concepts/test-and-publish-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
