# Haravan Trigger

Haravan Trigger Node in n8n is a node used to trigger a process (workflow) every time a specific event occurs on the Haravan platform. Haravan is a popular e-commerce system, and this node allows you to automate tasks and processes based on events from Haravan. Haravan Trigger Node is a powerful tool for creating automated workflows, enhancing performance, and optimizing your business processes when you use n8n with Haravan.

{% hint style="info" %}
**Webhooks:** You can find webhooks information for this node [here](https://docs.haravan.com/docs/tutorials/webhooks/).
{% endhint %}

## Events&#x20;

* Customer Created
* Customer Updated
* Comment Created
* Comment Updated
* Collection Created
* Collection Updated
* Order Created
* Order Updated
* Order Changed

## Example Usage

This workflow allows you to receive updates when a new collection gets added in Haravan and use their information to find products in the newly created collection. You can also find the workflow on n8n.io. This example usage workflow would use the following node.

* Haravan Trigger
* Set
* Haravan

The final workflow should look like the following image.

<figure><img src="/files/s5ndSyAfLRlTWvdEtoNj" alt=""><figcaption></figcaption></figure>

### 1. Haravan Trigger

The Haravan Trigger node will trigger the workflow when a new collection gets added in Haravan.

1. First of all, you'll have to enter a path that you want to receive an event. Then you will copy Webhook URLs and enter this link into "Callback URL" field of your app or if you use a private app, you just add webhook and choose an event for which you want to receive data. Then fill your API path in the URL textbox. You can find out how to do that [here](https://docs.haravan.com/docs/tutorials/webhooks/).
2. Select 'Collection Created' from the ***Events*** dropdown list.
3. Click on ***Execute Node*** to run the node.

In the screenshot below, you will notice that the node returns the information of the new collection that was added to Haravan. This output gets passed on to the next node in the workflow.

<figure><img src="/files/CQIbuJcIDoFrT0CvYq5t" alt=""><figcaption></figcaption></figure>

### 2. Set node

We will use the Set node to ensure that only the data that we set in this node gets passed on to the next nodes in the workflow.

1. Click on ***Add Value*** and select 'Number' from the dropdown list.
2. Enter `Collection ID` in the ***Name*** field.
3. Click on the gears icon next to the ***Value*** field and click on ***Add Expression***.
4. Select the following in the ***Variable Selector*** section: Current Node > Input Data > JSON > id. You can also add the following expression: `{{ $json.id }}`.
5. Click on ***Add Value*** and select 'String' from the dropdown list.
6. Enter `Collection Name` in the ***Name*** field.
7. Click on the gears icon next to the ***Value*** field and click on ***Add Expression***.
8. Select the following in the ***Variable Selector*** section: Current Node > Input Data > JSON > title. You can also add the following expression: `{{ $json.title }}`.
9. Toggle ***Keep Only Set*** to `true`. We set this option to true to ensure that only the data that we have set in this node gets passed on to the next nodes in the workflow.
10. Click on ***Execute Node*** to run the node.

In the screenshot below, you will notice that the node uses the data from the previous node and returns the data that we set for the workflow.

<figure><img src="/files/UIw65S4jdszxRfCy2xJf" alt=""><figcaption></figcaption></figure>

### 3. Haravan node

This node will use the data coming from the previous node to find products in the newly created collection in Haravan.

1. Select 'Retrieve a List of Collects' from the ***Operation*** dropdown list.
2. Enter the Token in the Authentication Token field. You can find out how to get that [here](https://docs.haravan.com/docs/tutorials/authentication/authentication-and-authorization).
3. In n8n, paste the Token of your app in the **Authentication Token** field.
4. Enter the Collection ID in the ***Collection ID*** name field.
5. Click on ***Execute Node*** to run the node.

In the screenshot below, you will notice that the node finds all products belonging to the Collection ID value passed from the previous node.

<figure><img src="/files/PVIb2UfAYPs1MwnSvauh" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Activate workflow for production**

You'll need to save the workflow and then click on the Activate toggle on the top right of the screen to activate the workflow. Your workflow will then be triggered as specified by the settings in the Haravan Trigger node.
{% endhint %}


---

# Agent Instructions: 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-tech.n8n.vn/haravan-trigger.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.
