# 5 min QuickStart Guide

{% embed url="<https://www.youtube.com/watch?v=lQbfaHZleio>" %}
Product Walthrough of Nected's Rule Engine & Workflow Automation Platform
{% endembed %}

This page provides a checklist and quick links to configure various components of the Nected platform.

Use the following links, in any order, to quickly and easily setup the Nected platform and start your first project:

## Try our Interactive Demo

Go To our Demo Rule where Nected provides pre-established rules that you can utilize to evaluate the platform by yourself. You can see the demo on the [rules listing page](https://docs.nected.ai/nected-docs/rules) and try playing with the rule.<br>

<figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2FGiMWiQ68t90TICearFOG%2F6.png?alt=media" alt=""><figcaption></figcaption></figure>

Demo Rule is about calculating dynamic pricing & discounts based on certain attributes like `product_name`, `customer_location` & `inventory_left` and then show it back to the customer over UI.&#x20;

While customer location & product name are being sent directly from the frontend everything, inventory left needs to be fetched from the database to calculate dynamic discount and pricing for the product named `product_name`

In the Demo rule, you will find already attached Demo Dataset (**Demo-Product-DataSet)** built over demo mysql database via integration named  **Demo-Mysql-Connector.**

## **Create and publish your first rule**

Follow this procedure to create a decision table rule for one of your datasets:

1. Log into Nected with your Email ID and password.<br>

   <figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2FapwA4JlOSvDWhFUDJm5E%2F5.png?alt=media" alt=""><figcaption></figcaption></figure>
2. Click **Rules** in the left navigation to open the **Rules** page. On the **Rules** page, you can create new rules based on your business requirements and modify these rules when business requirements change.<br>

   <figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2FGiMWiQ68t90TICearFOG%2F6.png?alt=media" alt=""><figcaption></figcaption></figure>
3. Click **+ Create Rule** button on the Rules page and Select rules to be created - **SimpleRule** (if/else/then statement), **DecisionTable** (rules table with multiple conditional rows), and a **Ruleset** (group of rules working simultaneously).\
   \
   The decision table configuration form opens.

   <figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2FNUZdUteyYGPcquoqvWmf%2F7.png?alt=media" alt=""><figcaption></figcaption></figure>
4. Define the condition and configuration for your decision table.

   <figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2FPreFksh9UDgLtKLNydeb%2Fimage.png?alt=media&#x26;token=b30fb5e5-6c2c-4979-9f02-13f60d18b4be" alt=""><figcaption></figcaption></figure>

   ***Note:** This information is the same for both staging and production decision tables.*\
   Provide the following decision table condition information:

   1. Write **Name** the decision table. It must be unique throughout the Nected platform and must not contain any spaces.
   2. **Decision Table** **type** – Staging or Production.
   3. **Rule** **Description** – A meaningful description of the rule to understand its purpose.
   4. Click on **Add Source** to configure input parameters to the rule (custom or via dataset)
   5. Select a **Rule Policy** for executing the decision table from **First**, **Unique**, **Collect**, and **Order**.
   6. Create **conditions** in the no-code editor -  The rule condition based on which it will act. The condition is in the format of – *if -> attribute -> operator -> value*.
   7. Click **Test in Staging** to test the rule to see the condition results via our Test Console, where you can enter values for the input attributes used in the rule condition and see the rule output on your screen.
   8. &#x20;After a successful test, click on **Publish** to publish the rule.

## Create Rule Action to Update result / Trigger flow

Based on the rule result, you can add an action that this rule will take either to update the result or to trigger any flow in your internal as well as 3rd party systems via our Database & REST API connectors.

<figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2FnFIj627wUIyvxGIhkfDe%2F13.png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Note: The action is triggered asynchronously to the result. Rule will return the output first and then would fire all the associated actions asyncronously
{% endhint %}

On the [**Integrations**](https://docs.nected.ai/nected-docs/integrations) page, you can integrate any database to pull data from and push data to any data source as well as set up your own REST APIs.

\
Nected supports MongoDB, MySQL, and Postgres databases. Nected also provides a pre-configured ready-only connector for the production environment. Click the **Connected** button of the **Demo-Mysql-Connector** connector to check the configuration values of the demo connection.&#x20;

## **Trigger rule from your internal or 3rd party systems via API**

After you successfully publish the rule, you can [trigger the rule via API](https://docs.nected.ai/nected-docs/triggers-rule-workflow/trigger-rule-via-api) from any system. If you choose to trigger the rule privately/securely from an API server, then you will need an [API key.](https://docs.nected.ai/nected-docs/security/api-authentication#authentication-keys)

## **Connect your own data source with rule**

Nected comes with seamlessly integrable and data-driven rules wherein you can use your data present in the database directly to be used in any rule. This way, you wouldn't have to pass all the attributes using which rule has to be processed.

1. On the [**Datasets**](https://docs.nected.ai/nected-docs/datasets) page, you can create a dataset that provides a view of the data returned from the execution of the specified database query. Execute and publish the dataset.

2. Go back to the rule that you had created. Click on **Add Source** to select a dataset from the list to associate with this rule and click **Next**.

<figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2F6QDROSG0bXd89vpMYAfE%2Fadd_source_screenshot.png?alt=media&#x26;token=196102d6-5237-4234-a560-60711a759ac0" alt=""><figcaption></figcaption></figure>

3. In the input data screen, **Add a mapping data key** using which all the other data attributes can be directly fetched from the dataset. You can still keep/add the custom input attributes created earlier. which you want to pass directly to the rule via Frontend & don't want it to be fetched from the database.

<figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2F6sQGUHJOuynhVHn5gyCF%2Finput_data_config.png?alt=media&#x26;token=c607ffca-bdb5-4ab4-8138-b63cc7ffe05c" alt=""><figcaption></figcaption></figure>

4. Click on **Save** Button.

Your rule properties would have dataset attributes available to build in any rule conditions over our no-code editor now.

### Nected Workflow Automation

{% hint style="info" %}
Get the Quickstart Guide for Nected Workflow Automation from [**here**](https://docs.nected.ai/nected-docs/workflow).
{% endhint %}

{% embed url="<https://www.youtube.com/watch?v=2KunuruEzkQ>" %}
