> For the complete documentation index, see [llms.txt](https://manual.selarti.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual.selarti.com/manual-en/external-integrations/integration-using-the-n8n-service.md).

# Integration using the n8n service

[*n8n*](https://n8n.io/) *is a platform for visual workflow automation and integration of various web services and applications without writing complex code or involving developers.*

In Selarti, you can set up an integration with any external service using webhooks.

### Setting up the integration in the n8n dashboard

Sign up for [the n8n service](https://app.n8n.cloud/login). To create a new workflow, click the *«+»* icon on the left side of the screen and select *«New workflow»*.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2FpTkFxSBVJY33vhBs9mj1%2Fn8n_09.26_1.1.png?alt=media&amp;token=84a49f03-b02b-44f1-b095-7de21758f52b" alt=""><figcaption></figcaption></figure>

In the center of the screen, click *«Add first step...»*. In the window that opens on the right, enter *«Webhook»* in the search field. Select *«Webhook»*.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2Fs1oDswK7AiFUHLwHbGev%2Fn8n_09.26_5.png?alt=media&amp;token=3cdab2e3-02e3-4624-9dea-6cf77cd97dc2" alt=""><figcaption></figcaption></figure>

A webhook settings window will open. In the *«HTTP Method»* field, select *«POST»*. Click the *«Test URL»* link above to copy the address — you will need it in the next step. Then click *«Listen for test event»* so that n8n starts waiting for a test webhook from Selarti.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2F7Pbbb5QBlLop1zetWxAx%2Fn8n_09.26_6.1.png?alt=media&amp;token=2fc4051a-ad41-4d4a-ab13-5b31a1a19396" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Please note that after clicking «Listen for test event», you have 120 seconds to send a test webhook from Selarti. If the webhook is not sent within this time, click «Listen for test event» again before sending the test event.
{% endhint %}

### Setting up the integration in the Selarti dashboard

Go to the Selarti dashboard. In the left sidebar, open [*«Integration»*](https://selarti.com/panel?menu=integration), then click *«Create integration»* in the upper-right corner. Select *«n8n»* as the integration type.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2F05ZttQNETC1Gp3JhP0mg%2Fn8n_09.26_1en.png?alt=media&amp;token=c5abef82-3a60-4aa2-a94f-f9ccda227572" alt=""><figcaption></figcaption></figure>

Enter any name, then paste the link copied from the n8n dashboard. Click *«Send test webhook»*.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2Fwj2SrjV53dNxm1Ti2RGB%2Fn8n_09.26_2en.png?alt=media&amp;token=e83c376c-6d18-41f3-9d02-7aabc0e10af2" alt="" width="393"><figcaption></figcaption></figure>

If everything is set up correctly, the link entered in Selarti will be highlighted in green.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2FDUhmaUq1H3cM7xCiJDTM%2Fn8n_09.26_3en.png?alt=media&amp;token=103a0b35-0180-446a-bdf9-7651d92ae67c" alt="" width="393"><figcaption></figcaption></figure>

Select the required trigger types from the *«webhook type»* dropdown list and click *«Create integration»*.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2FPicgjzReG9jnnjIITdl8%2Fn8n_09.26_9en.png?alt=media&amp;token=a99b637a-d18c-44a1-abc9-56747cc0ef51" alt="" width="399"><figcaption></figcaption></figure>

For more information about the parameters sent by webhooks and custom API with custom fields, see the article [«Integration with an external messenger»](/manual-en/external-integrations/integration-with-an-external-messenger.md).

### Checking the webhook and switching to production mode in n8n

Go back to n8n and check the webhook settings window. Information about sending data to the test URL will appear in the field on the right. After a successful test, switch to the *«Production URL»* tab and click the link to copy it.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2F9WINRA4kS2T0ueCwddTk%2Fn8n_09.26_10.2.png?alt=media&amp;token=4c39c675-87bf-481a-a124-6dccf40665b5" alt=""><figcaption></figcaption></figure>

Then go back to Selarti, open the *«Integration»* section and select the integration you created. Replace the URL with the production URL and click *«Save»*.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2FGd1p6Ap1onwMrxmBw1Cx%2Fn8n_09.26_21en.png?alt=media&amp;token=b672177a-bb0d-46de-bd59-882671c350b9" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
The test URL is intended for testing the setup only. For actual operation, use the «Production URL».
{% endhint %}

### Creating an action in n8n

Close the webhook settings window in n8n and add the required action to the workflow. There are many options available, as n8n supports a large number of actions.

The integration is ready!

### Example: setting up data transfer to Google Sheets

For this setup, you will need a Google account and a Google spreadsheet with headers created in advance.

Click the *«+»* icon next to the *«Webhook»* node.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2FnPhpH4NvfS7E1K4ETcGc%2Fn8n_09.26_11.png?alt=media&amp;token=ded62b79-7e5b-4026-8d80-20ad55574602" alt=""><figcaption></figcaption></figure>

In the window that opens on the right, select *«Action in an app»*.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2FhXUcfaYpbFQLO43f4Y7N%2Fn8n_09.26_12.png?alt=media&amp;token=1afd9c42-049a-4805-ba4e-e92c31e08f6b" alt="" width="429"><figcaption></figcaption></figure>

In the next window, enter *«Google Sheets»* in the search field and click the *«Google Sheets»* result.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2FJzZcLEutnLU7fLSiz1K5%2Fn8n_09.26_13.png?alt=media&amp;token=fa13b352-ed09-45f6-8474-1bcd419c0aaa" alt="" width="429"><figcaption></figcaption></figure>

Select the *«Create spreadsheet»* action.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2FlxCRlqGrmwm8jpkQvjuX%2Fn8n_09.26_14.png?alt=media&amp;token=0f844e7c-5126-495c-aa47-5d559b76d290" alt="" width="429"><figcaption></figcaption></figure>

A window will open. Click *«Sign in with Google»*.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2FzzFWVmesfTMDMsOCSzBR%2Fn8n_09.26_15.png?alt=media&amp;token=d43e88b8-72d2-4382-9592-99feb42040d7" alt=""><figcaption></figcaption></figure>

Select your Google account and specify the following parameters:

* *Resource* — *Sheet Within Document*.
* *Operation* — *Append Row*.
* Document — select the required spreadsheet.
* *Sheet* — select the sheet.
* *Values to Send* — map the event values you want to transfer to the spreadsheet columns. To do this, drag a value from the list on the left side of the settings to the required row with the column header.

Click *«Execute step»* at the top.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2FwoFZIUy9olDRFs8FNRaE%2Fn8n_09.26_24.png?alt=media&amp;token=9f4f950f-f2df-4ec2-98bd-6c3e615ac1f0" alt=""><figcaption></figcaption></figure>

The data available for configuration will appear on the right. Close the settings window.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2FAd851y3Xnm9g0VSPOanZ%2Fn8n_09.26_25.png?alt=media&amp;token=f2d154c1-708d-4512-8081-b2edbb1a30cf" alt=""><figcaption></figcaption></figure>

After configuring all actions, *click «Publish»*.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2FoEa2zpDdQFRUbvCPHu8p%2Fn8n_09.26_22.png?alt=media&amp;token=dde41a8d-a980-4b43-9642-2d92fcb438c7" alt=""><figcaption></figcaption></figure>

In the window that opens, enter any name and click *«Publish»*.

<figure><img src="https://271796707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsBua8zDbkZPvmgjidnwA%2Fuploads%2F0QNP8qbeRTGtqJHCqDx5%2Fn8n_09.26_23.png?alt=media&amp;token=c88f5b10-8e44-4bd2-a6fe-9d2b85ee6256" alt="" width="491"><figcaption></figcaption></figure>
