How to Connect a MindStudio AI Agent to Zapier

This tutorial shows how to integrate MindStudio with Zapier. The use case is user sentiment analysis, where a user submits information into a Google Form, triggers a Zap in Zapier, then sends that data to a MindStudio AI agent for processing and response.

How to Connect a MindStudio AI Agent to Zapier

Introduction

This tutorial shows how to integrate MindStudio with Zapier. The use case is user sentiment analysis: a user submits information in a Google Form, triggers a Zap in Zapier, and then sends that data to a MindStudio AI agent for processing and response.

This tutorial has four sections in the order we will build this use case:

  1. Build the Google Form that users submit their name, email, and comment on a fictional product or service.
  2. Build the MindStudio AI agent that will analyze the sentiment of each user submission, then email a response appropriate to that user’s comment sentiment.
  3. Build the Zap in Zapier that will trigger whenever a Google Form submission occurs, then send each submitter’s name, email address, and comment.
  4. Test the project.

Build the Google Form

In this tutorial, let’s build a basic Google Form that lets the user provide a name, email address, and a comment.

1. Create a new Google Form.

Open Google Forms

2. Name the form “Comment Submission”.

3. Add a “Short answer” item for the form submitter’s name.

Add a Short answer item for the user's name

4. Add another “Short answer” item for the form submitter’s email address.

Add a Short answer for the email address

5. Add a “Paragraph” item for the form submitter to enter a comment.

Add a Paragraph item for the user's comment

6. Click “Publish”, then set “Responders” as “Anyone with the link”.

7. Click “Save” to publish your Google Form.

Save the Google Form

8. Copy the responder link, then open the form in a new browser tab to test it.

9. Fill out the form, then click “Submit”.

10. Return to the browser tab with the Google Form editor, then verify that a response has been recorded.

A response has been recorded in the Google Form

The Google Form is ready.

Build the MindStudio AI Agent

Let’s build the MindStudio AI agent that will analyze the sentiment of each user submission. This agent will include three workflows. Let’s begin by building the “Main” workflow.

Build the “Main” Workflow

Follow the steps below to build the “Main” workflow:

1. Create a MindStudio account.

2. Go to “Service Router > Balance” to add funds to your Service Router balance. Add $5 to get started.

MindStudio account displaying balance in Service Router

3. Create a new agent from My Drafts.

My Drafts in MindStudio

4. Click the “Start” block.

Click the Start block in MindStudio

5. Click “Add” to the right of “Launch Variables”. A launch variable is a variable that begins with data when that MindStudio workflow runs.

6. Add “name” as a launch variable. This will be the form submitter’s name as provided from the Google Form.

Add "name" as a launch variable in MindStudio

7. Click “Add” again, and then add “email”.  This will be the form submitter’s email address as provided from the Google Form.

Add "email" as a launch variable in MindStudio

8. Click “Add” a third time, and then add “comment”. This will be the form submitter’s comment as provided from the Google Form.

Add "comment" as a launch variable in MindStudio

9. Click the + button to add a new block and choose “View All Blocks”.

View all blocks in the MindStudio Automation Canvas

All the MindStudio blocks are displayed.

All MindStudio blocks are displayed

10. Search for “Logic” in the search field, and then select the Logic block. The Logic block automates a decision using AI, then transitions to another block based on conditions configured for that Logic block. We will use this Logic block to analyze the sentiment of a user’s comment.

Search for the "Logic" block in MindStudio

11. In “Context”, add the following prompt that guides the AI what it is to do in that Logic block.

“Analyze {{comment}} to determine if the comment is positive or negative.”

Add context in the Logic block in MindStudio

12. In “Condition #1”, add “{{comment}} is positive”. If the user’s comment is positive, this condition is met.

Specify condition 1 in the Logic block

13. In “Condition #2”, add “{{comment}} is negative”. If the user’s comment is negative, this condition is met.

Specify condition 2 in the Logic block

14. Right-click anywhere in the Automation Canvas, then choose “View All Blocks”.

View all blocks in the MindStudio Automation Canvas

15. Search for “Jump” in the search field, and then select the “Jump” block. The Jump block jumps to another workflow in the same MindStudio AI agent. We will use two “Jump” blocks from this agent: one to a workflow to process positive-sentiment comments, and another for negative-sentiment comments.

Search for the "Jump" block

16. Right-click anywhere in the Automation Canvas, then choose “View All Blocks”, so we can add the second “Jump” block.

View all blocks in the MindStudio Automation Canvas

17. Search again for “Jump” in the search field, and then select the “Jump” block.

Search for "Jump" block a second time

Now that we have two “Jump” blocks in our MindStudio workflow, we will add two additional workflows to our agent: one to process positive-sentiment comments and another for negative-sentiment comments.

Second Jump block is in the "Main" workflow

BUILD THE “POSITIVE SENTIMENT” WORKFLOW

Follow these steps to build the “positive sentiment” workflow.

1. Click the “+” icon beside “Workflows” in the “Explorer” panel to add another workflow.

Add a second workflow the MindStudio AI agent

2. Right-click on the new workflow, and then select “Rename” to rename this workflow.

Select to rename the second workflow

3. Rename this workflow to “positive”.

Second MindStudio workflow renamed to "positive"

4. Let’s build the “positive” workflow first, then duplicate it to make changes for the “negative” workflow. Click the + button to add a new block and choose “Generate Text”.

Add a "Generate Text" block to the second workflow

5. Add in “Prompt” the following prompt that will generate an upbeat response to the positive comment.

<comment>
{{comment}}
</comment>

<name>
{{name}}
</name>

Generate the email message to reply to <comment>. Use an upbeat, friendly tone within the context of the comment that has a postive sentiment. Address the commenter as <name>. Do not generate a long response. Generate short paragraphs that contain no more than two or three sentences each. If relevant to the comment, ask if the commenter would like to learn more about other products and/or services (as relevant).

6. In “Output Behavior” select “Save to Variable”.

Save the output for the "Generate Text" block to a variable

7. In the “Variable Name” setting, add “response”.

Save the variable output as "response"

8. Click the + button after the “Generate Text” block and choose “View All Blocks”.

View all blocks in the MindStudio Automation Canvas

9. Search for “Send Gmail” in the search field, and then select the “Send Gmail” block.

Search for the "Send Gmail" block in MindStudio

10. In the “Account” setting, select your email address that is connected to the Send Gmail block, then skip to step X. If this is the first time you are connecting the “Send Gmail” block to your email account, select “Connect a new account”.

Connect a new account for the "Send Gmail" block

11. Enter your email address to connect to the “Send Gmail” block, then click “Continue”. Complete the connection. When the connection procedure is complete, your email address displays in the “Account” setting.

12. After making the initial connection to the “Send Gmail” block, additional access is required upon first-time connection. Click “Connect” to grant the “Send Email” permission.

"Send Gmail" block requires "send email" access

13. Select your email address that you connected to the “Send Gmail” block.

Select your email account to grant access

14. Click “Continue”, then allow MindStudio to send emails with your Google account.

Click "Continue" to sign back in to MindStudio

15. Close the window after successfully connecting to Google.

Successfully connected to Google

16. Add “{{email}}” in the “To” setting. This is the variable that will store the commenter’s email address.

Add {{email}} to the "To" setting in the "Send Gmail" block

17. In the “Subject” setting, add an email subject that indicates gratitude and excitement for the user’s positive comment. For example, “Thank you for your positive feedback!”

Add a subject line to the "Send Gmail" block

18. Add “{{response}}” in the “Content” setting. This variable will contain the message from the “Generate Text” block to respond to the commenter’s positive comment.

Add {{response}} to the "Content" setting in the "Send Gmail" block

The “positive sentiment” workflow is complete. Let’s duplicate this workflow for the “negative sentiment” workflow to save us time building it. We will only make specific changes to that workflow.

BUILD THE “NEGATIVE SENTIMENT” WORKFLOW

Follow these steps to build the “negative sentiment” workflow:

1. Right-click on the “positive.flow” workflow in the “Explorer” panel, and then select “Duplicate”.

Duplicate the positive.flow workflow in MindStudio

2. Right-click on the “positive 1.flow” workflow, then select “Rename”. Rename this to “negative”.

Rename the duplicated workflow to negative in MindStudio

3. Select the “Generate Text” block, and then revise the prompt:

<comment>
{{comment}}
</comment>

<name>
{{name}}
</name>

Generate the email message to reply to <comment>. Use a sympathetic, conciliatory tone and tries to rectify the situation described as the topic of the negative comment. Address the commenter as <name>. Do not generate a long response. Generate short paragraphs that contain no more than two or three sentences each. If relevant to the comment, ask if the commenter would like to learn more about other products and/or services (as relevant). Do not preface or echo the prompt prior to generating the content.

Revise the prompt for the Generate Text block to respond to a negative comment

4. Select the “Send Gmail” block.

5. In the “Subject” setting, revise the email subject that indicates reconciliation for the user’s negative comment. For example, “I’m sorry for your negative experience. Thank you for reaching out.”

Revise the email subject in the Send Gmail block to respond to a negative comment

The workflow to process negative comments is ready.

CONFIGURE THE “JUMP” BLOCKS FROM “MAIN.FLOW”

Now that each workflow is built, let’s connect to them from the “Jump” blocks in “Main.flow”. Follow these steps:

1. Click “Main.flow” from the “Explorer” panel.

Select the Main.flow in the MindStudio AI agent

2. Click the topmost “Jump” block. Let’s connect this to the “positive.flow” workflow that processes positive comments.

3. Click “Workflow”, and then select “positive”.

Configure the topmost Jump block to jump to the positive workflow

4. Click the bottommost “Jump” block. Connect this to the “negative.flow” workflow that processes negative comments.

Configure the bottommost Jump block to jump to the negative workflow

5. Click the “Logic” block. In “Condition #1”, click the “Select Destination” link.

Click to Set Destination for Condition #1

6. Click the topmost “Jump” block, which jumps to the workflow that processes positive comments. This means that when the “Logic” block evaluates that the comment has a positive sentiment, then it transitions to the topmost “Jump” block. That “Jump” block then transitions to the “positive.flow” workflow.

Click the topmost Jump block

7. In “Condition #2”, click the “Select Destination” link.

Click to Set Destination for Condition #2

8. Click the bottommost “Jump” block, which jumps to the workflow that processes negative comments. This means that when the “Logic” block evaluates that the comment has a negative sentiment, then it transitions to the bottommost “Jump” block. That “Jump” block then transitions to the “negative.flow” workflow.

Click the bottomost Jump block

You can design MindStudio AI agents to process as many conditions as you need. For example, you can add a condition if the comment was neutral. For this use case, we’ll build a MindStudio AI agent that processes only positive or negative user comments.

PUBLISH THE MINDSTUDIO AI AGENT

The MindStudio AI agent is built. Let’s name the AI agent and publish it. Publishing the agents makes it visible to Zapier, which will send the data from the Google Form submission to the MindStudio AI agent.

Follow these steps:

1. Click “Untitled AI Agent” above the Automation Canvas.

Click Untitled AI Agent in MindStudio

2. In “Agent Name” add a name for the AI agent. For example: “Comment Sentiment Analyzer”.

3. Press “Publish” to publish your AI agent.

Publish the MindStudio AI agent

4. Scroll down to the bottom of the “Metadata” page to locate the “Agent ID” setting.

Locate the Agent ID in the MindStudio AI agent

5. Copy the Agent ID to your clipboard, then paste it into a temporary text file for use when we configure Zapier. The Agent ID is a unique identifier for your MindStudio AI agent. Note that the Agent ID is not secret and can be shared with other platforms and MindStudio support if necessary.

GENERATE AN API KEY IN MINDSTUDIO FOR THE ZAPIER CONNECTION

Zapier requires a secret API key to connect to your MindStudio workspace. This API key validates your MindStudio workspace, so that we can connect Zapier to the MindStudio AI agent in the next section.

Follow these steps to generate an API key in MindStudio:

1. Click the Left arrow beside the MindStudio logo.

Click the left-pointing arrow beside the MindStudio logo

2. Click “Developers”, and then click “API Keys”. (API keys are hidden in the image below, because they are secret.)

VIew generated API keys in MindStudio

3. Click “Create Key”.

4. Add a name for this API key. Since this API key is to connect Zapier to your MindStudio workspace, use a name “Zapier key”.

Name your API key in MindStudio for the Zapier connection

5. Click “Create”. Your API key displays at the top of the list by default. Note that this is a secret API key: do not share it with others.

MindStudio API key is generated for the Zapier connection

6. Click the “Copy” icon to the right of your API key into your clipboard. Optionally, paste the API key temporarily into a text file for use in the next section, where we build the Zap in Zapier.

Build the Zap in Zapier

Let’s build the Zap in Zapier now. When a user submits a Google Form, this Zap will trigger and send that data to MindStudio for sentiment analysis.

1. Log in or create your Zapier account at https://zapier.com/.

2. Click “Create”, and then click “Zaps” to create a new Zap.

Create a new Zap in Zapier

3. Click the “Trigger” step in your new Zap.

The Zap trigger and first action must be configured

4. Select “Google Forms”.

Select Google Forms

“Google Forms” now displays in the “App” setting of the Zap.

Google Forms displays in App setting for the Zap trigger

5. Click “Trigger event”, and then click “New Form Response”. When a user submits a Google Form response, this Zap triggers.

Select New Form Response from Google Forms to trigger the Zap

6. Click “Sign in” in the “Account” setting to sign into your Google account.

7. Select the email account that has the Google Form.

Select your email account

8. Click “Select all”. All scopes are selected.

Select all scopes to access your Google Forms account

9. Scroll down, and then click “Continue”.

Click Continue to trust Zapier

Your Google account is setup for use in Zapier.

10. Click “Configure”.

Click Configure to configure which Google Form triggers the Zap

11. In “Form”, select the Google Form you created by its name.

Select your Google Form to trigger the Zap

12. Click “Test”.

Click Test to test this step in the Zap

13. Click “Test trigger”.

Click Test trigger to test the Zap trigger

Zapier finds the Google Form record you submitted as a test.

Zapier finds the test Google Form submission

14. Click “Find new records”. Click on the new response.

15. Click “Continue with selected record”. The test is successful. Zapier moves to the next step in the Zap.

The modal screen displays to select the integration for the next step in the Zap. This will be the action to take after the Zap is triggered.

Zapier displays apps from which to select the action step in the Zap

16. Search for “MindStudio”, and then select MindStudio’s integration with Zapier.

Search for MindStudio as the next step in the Zap

17. Click “Action event”, then select “Run Workflow”.

Select Run Workflow as the action to do in MindStudio

18. Click “Sign in” in the “Account” setting to sign into your MindStudio account.

Click Sign in to sign into your MindStudio account

19. In the “API Key” setting, paste your secret API key from your MindStudio workspace, and then click “Yes, Continue to MindStudio”.

Allow Zapier to access your MindStudio account

20. Your MindStudio workspace is displayed in the “Account” setting. Click “Continue”.

Click Continue

21. In “App ID”, paste the App ID for your MindStudio AI agent that you temporarily kept in a text file. Zapier will access this MindStudio AI agent when this Zap runs.

Paste your MindStudio AI agent's App ID into App ID setting

22. Select the MindStudio AI agent by its name.

Select the MindStudio AI agent by its name

In the “Variables” setting, we will add the three data items we use for this use case. These three items are provided by the user when submitting the Google Form.

  1. name: Name of the comment submitter
  2. email: Email address
  3. comment: Comment by that user

23. In the “Variables” setting, add “name”. This must match the variable “name” we added to the MindStudio AI agent’s “Start” block, including case sensitivity. For example, “name” is different than “Name”.

Add name as a variable

24. Click “+” beside the “Enter text or insert data” helper text. We will specify in a previous step of this Zap (Google Forms) which data “name” represents. This data will be sent to MindStudio by this Zap.

25.Scroll to the bottom of the “New Form Response in Google Forms” dropdown, then select “What is your name?” This is the form item in the Google Form that asks the user for a name.

Select the data from the Google Form that stores name variable

26. Below the “Variables” setting, click “Add value set” to add another variable.

Data is configured for name variable

27. In the second “Variables” setting, add “email”. This must match identically to the variable “email” we added to the MindStudio AI agent’s “Start” block.

28. Click “+” beside the “Enter text or insert data” helper text. We will specify the data from the Google Form that “email” represents.

29. Scroll to the bottom of the “New Form Response in Google Forms” dropdown, then select “What is your email address?” This is the form item in the Google Form that asks the user for an email address.

Select the data from the Google Form that stores email variable

30. Below the “Variables” setting, click “Add value set” to add another variable.

Data is configured for email variable

31. In the third “Variables” setting, add “comment”. This must match identically to the variable “comment” we added to the MindStudio AI agent’s “Start” block.

32. Click “+” beside the “Enter text or insert data” helper text. We will specify the data from the Google Form that “comment” represents.

33. Scroll to the bottom of the “New Form Response in Google Forms” dropdown, then select “What is your comment?” This is the form item from the Google Form where we ask the user for a comment.

Select the data from the Google Form that stores comment variable

34. Do not change “Main.flow” from the “Workflow” setting, since this is the workflow in our MindStudio AI agent that we want to send data from Zapier.

Data is configured for comment variable

35. Click “Continue”.

36. Click “Test”. Zapier tests the step.

Click Test to test the Zap

37. Click “Publish” when the test is successful.

Click Publish to publish your Zap

38. Click on “Untitled Zap”, select “Rename”, then rename your Zap.

Rename your Zap

39. Click “Publish” again. In the “Publish new version” add a new version name. For example, add “Zap Renamed”.

40. Click “Publish” again.

We have completed building the Zap. Let’s test!

Test Your MindStudio AI Agent

Let’s test your MindStudio AI agent.

1. Open your Google Form, then fill it out. Let’s test for a positive comment.

Fill out the form with a positive comment

2. Submit the form, then look in your email inbox. It may take several seconds for the MindStudio AI agent to send the email.

3. Open the email.

Email with an autogenerated response for a positive comment

4. Now submit another instance of the Google Form, this time with a negative comment.

Fill out the form with a negative comment

5. Open the second email with the negative comment.

Email with an autogenerated response for a negative comment

Launch Your First Agent Today