mirror of
https://github.com/n8n-io/n8n-docs.git
synced 2025-11-20 17:48:34 +00:00
✨Add documentation for the Google Cloud Natural Language Node
This commit is contained in:
parent
87d45bdd08
commit
f4eaf99439
@ -10,6 +10,7 @@ You can use these credentials to authenticate the following nodes with Google.
|
||||
- [Gmail](../../nodes-library/nodes/Gmail/README.md)
|
||||
- [Google Books](../../nodes-library/nodes/GoogleBooks/README.md)
|
||||
- [Google Calendar](../../nodes-library/nodes/GoogleCalendar/README.md)
|
||||
- [Google Cloud Natural Language](../../nodes-library/nodes/GoogleCloudNaturalLanguage/README.md)
|
||||
- [Google Drive](../../nodes-library/nodes/GoogleDrive/README.md)
|
||||
- [Google Sheets](../../nodes-library/nodes/GoogleSheets/README.md)
|
||||
- [Google Tasks](../../nodes-library/nodes/GoogleTasks/README.md)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 238 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 216 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 165 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 160 KiB |
@ -0,0 +1,101 @@
|
||||
---
|
||||
permalink: /nodes/n8n-nodes-base.googleCloudNaturalLanguage
|
||||
description: Learn how to use the Google Cloud Natural Language node in n8n
|
||||
---
|
||||
|
||||
# Google Cloud Natural Language
|
||||
|
||||
[Google Cloud Natural Language](https://www.google.com/Cloud Natural Language) is a web-based spreadsheet program that is part of Google's office software suite within its Google Drive service.
|
||||
|
||||
::: tip 🔑 Credentials
|
||||
You can find authentication information for this node [here](../../../credentials/Google/README.md).
|
||||
:::
|
||||
|
||||
## Basic Operations
|
||||
|
||||
::: details Document
|
||||
- Analyze Sentiment
|
||||
:::
|
||||
|
||||
## Example Usage
|
||||
|
||||
This workflow allows you to analyze the sentiment of feedback and send a message on Mattermost if that feedback is negative. You can also find the [workflow](https://n8n.io/workflows/786) on n8n.io. This example usage workflow uses the following nodes.
|
||||
- [Typeform Trigger](../../trigger-nodes/TypeformTrigger/README.md)
|
||||
- [Google Cloud Natural Language]()
|
||||
- [IF](../../core-nodes/If/README.md)
|
||||
- [Mattermost](../../nodes/Mattermost/README.md)
|
||||
- [No Operation, do nothing](../../core-nodes/NoOperationDoNothing/README.md)
|
||||
|
||||
The final workflow should look like the following image.
|
||||
|
||||

|
||||
|
||||
### 1. Typeform Trigger node
|
||||
|
||||
This node will trigger the workflow when a feedback form is submitted. Make sure to create a feedback form for your event.
|
||||
|
||||
1. Select 'Access Token' from the ***Authentication*** dropdown list.
|
||||
2. Enter the credentials for the Typeform Trigger node. You can find out how to do that [here](../../../credentials/Typeform/README.md).
|
||||
3. Select the event feedback form from the ***Form*** dropdown list.
|
||||
4. Click on ***Execute Node*** to run the node.
|
||||
|
||||
In the screenshot below, you will notice that the node triggers the workflow when feedback is submitted. We will pass this feedback to the next nodes in the workflow.
|
||||

|
||||
|
||||
### 2. Google Cloud Natural Language node (analyzeSentiment: document)
|
||||
|
||||
This node will analyze the sentiment of the feedback that we got from the previous node. We will pass the analysis score to the next node in the workflow.
|
||||
|
||||
1. First of all, you'll have to enter credentials for the Google Cloud Natural Language node. You can find out how to enter credentials for this node [here](../../../credentials/Google/README.md).
|
||||
2. Click on the gears icon next to the ***Content*** field and click on ***Add Expression***.
|
||||
::: v-pre
|
||||
3. Select the following in the ***Variable Selector*** section: Nodes > Typeform Trigger > Output Data > JSON > What did you think about the event? You can also add the following expression: `{{$node["Typeform Trigger"].json["What did you think about the event?"]}}`. If you want to analyze the sentiment for a different question, select that question instead.
|
||||
4. Click on ***Execute Node*** to run the node.
|
||||
:::
|
||||
In the screenshot below, you will notice that the node analyzes the sentiment of the feedback and gives a score.
|
||||
|
||||

|
||||
|
||||
|
||||
### 3. IF node
|
||||
|
||||
This node will check if the score we got from the previous node is smaller than `0` or not. If the score is smaller than `0`, it will return true otherwise false.
|
||||
::: v-pre
|
||||
1. Click on ***Add Condition*** and select 'Number'.
|
||||
2. Click on the gears icon next to the ***Value 1*** field and click on ***Add Expression***.
|
||||
3. Select the following in the ***Variable Selector*** section: Nodes > Google Cloud Natural Language > Output Data > JSON > documentSentiment > score. You can also add the following expression: `{{$node["Google Cloud Natural Language"].json["documentSentiment"]["score"]}}`.
|
||||
4. Select 'Smaller' from the ***Operation*** dropdown list.
|
||||
5. Click on ***Execute Node*** to run the node.
|
||||
:::
|
||||
In the screenshot below, you will notice that the node checks if the score we got from the previous node is smaller than `0` or not.
|
||||
|
||||

|
||||
|
||||
### 4. Mattermost node (post: message)
|
||||
|
||||
This node will send the feedback and the analysis score to the `Feedback` channel in Mattermost. If you have a different channel, use that instead.
|
||||
|
||||
1. Create a Mattermost node connected to the 'true' output of the IF node.
|
||||
2. You'll have to enter credentials for the Mattermost node. You can find out how to enter credentials for this node [here](../../../credentials/Mattermost/README.md).
|
||||
3. Select a channel from the ***Channel ID*** dropdown list.
|
||||
4. Click on the gears icon next to the ***Message*** field click on ***Add Expression***.
|
||||
::: v-pre
|
||||
5. Enter the following message in the ***Expression*** field: `You got a new feedback with a score of {{$node["Google Cloud Natural Language"].json["documentSentiment"]["score"]}}. Here is what it says:{{$node["Typeform Trigger"].json["What did you think about the event?"]}}`.
|
||||
6. Click on ***Execute Node*** to run the workflow.
|
||||
:::
|
||||
In the screenshot below, you will notice that the node sends the feedback and the analysis score to the `Feedback` channel in Mattermost.
|
||||
|
||||

|
||||
|
||||
### 5. NoOp node
|
||||
|
||||
Adding this node here is optional, as the absence of this node won't make a difference to the functioning of the workflow.
|
||||
|
||||
1. Create a ***NoOp*** node connected to the 'false' output of the IF node.
|
||||
2. Click on ***Execute Node*** to run the node.
|
||||
|
||||

|
||||
|
||||
::: tip 💡 Activate workflow for production
|
||||
This example workflow uses the Typeform Trigger node. 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 when a new form is submitted.
|
||||
:::
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 155 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 199 KiB |
Loading…
Reference in New Issue
Block a user