---
schema_version: "1"
id: e0af90a28934c3fa496ee508a8e535c7eb7d66be4fbe009de002144176fd1549
title: Create a Flow to Activate Natural Language Processing Services
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/concept_survey_nlp_actvate_using_flow_builder.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.concept_survey_nlp_actvate_using_flow_builder.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 722efe12f00fd8189fc13aed2724c533d3fd531d75c64a564e1f9d721cfc8e6f
description: Create a flow in Flow Builder to activate Natural Language Processing Services and analyze text-based survey responses. This flow will invoke Natural Language Processing (NLP) actions when a survey is submitted.
products:
  - Feedback Management
  - Service Cloud
  - Cross Cloud
release: "264"
---
# Create a Flow to Activate Natural Language Processing Services

Create a flow in Flow Builder to activate Natural Language Processing Services and analyze text-based survey responses. This flow will invoke Natural Language Processing (NLP) actions when a survey is submitted.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-feedback_management-264-0-0-production-enus/a6ddb038-83cb-47d7-b4de-b2b573c479e7/images/icon_note.png)

Note Unauthenticated guest users can't run the flow to invoke natural-language processing (NLP) services.

1. From Setup, in the Quick Find box, enter Flows, and then select **Flows**.
2. Click **New Flow**, and select **Record-Triggered Flow**. Then click **Create**. Flow Builder launches.
3. Click **Edit**.
4. Select the object whose records trigger the flow when they’re created, updated, or deleted. Here, select the **SurveyQuestionResponse** object.
5. Select when to trigger the flow. Here, select **A record is created**.
6. Next, add the element.
    1. Click the Toggle Toolbox.
    2. Click **New Resource**.
    3. Select **Variable** as the Resource Type.
    4. Enter an API name and description for the entity extraction.
    5. Select **Apex-Defined** as the Data Type.
    6. Select **nlpservice\_ServiceDetail** as the Apex Class.
    7. Specify the availability outside the flow. Here, select **Available for Input** option.
    8. Click **Done**.
7. Similarly, create these variables:
    
    | Variables | Data Type | Apex Class |
    | --- | --- | --- |
    | Keyphrase Extraction | Apex-Defined | nlpservice\_ServiceDetail |
    | Targeted Sentiment | Apex-Defined | nlpservice\_ServiceDetail |
    | Service List | Apex-Defined | nlpservice\_ServiceDetailsList |
8. Next, add a new element.
    1. Select **Assignment**.
    2. Click **Edit Element**.
    3. Select the **Entity Extraction** and **configurationAPIName** as variables.
    4. Select the operator as **Equals**.
    5. Select the value as **AWS\_Enity\_Extraction**.
9. Similarly, create these assignments:
    
    | Variables | Operator | Value |
    | --- | --- | --- |
    | Entity Extraction and serviceName | Equals | Amazon\_Comprehend\_Entity\_Extraction |
    | ServiceList and serviceDetails | Add | EntityExtraction |
    | Keyphrase Extraction and configurationAPIName | Equals | AWS\_Keyphrase\_Extraction |
    | Keyphrase Extraction and serviceName | Equals | Amazon\_Comprehend\_Keyphrase\_Extraction |
    | ServiceList and serviceDetails | Add | KeyPhraseExtraction |
    | Targeted Sentiment and configurationAPIName | Equals | AWS\_Targeted\_Sentiment |
    | Targeted Sentiment and serviceName | Equals | Amazon\_Comprehend\_Targeted\_Sentiment |
    | ServiceList and serviceDetails | Add | TargetedSentiment |
10. In the flow, click **Action**.
    1. Click **Industries Generative AI**.
    2. Select **Initiate Natural Language Processing** as the action.
    3. Enter a label, API name and description.
    4. Select **{!$Record.Id}** as the Reference Record ID. (Reference Record ID> ID> SurveyQuestionResponse).
    5. Select **{!ServiceList}** as Service Details List.
    6. Select the Text Field value as **SurveyQuestionResponse.ResponseValue**.
    7. Click **Done**.
11. Save and activate the flow.

The flow uses the Initiate Natural Language Processing action to call the Amazon Comprehend API, which analyzes survey responses and creates or updates records with insights about the responses.