Skip to main content
MindStudio
Pricing
Blog About
My Workspace
TutorialWorkflow ScriptsBusiness & Productivity

Lead Enrichment Tool: A Workflow Script Tutorial

Learn how to build a Workflow Script that researches a prospect and their company on Google, then generates an enriched profile summary ready for sales outreach.

MindStudio Team
Lead Enrichment Tool: A Workflow Script Tutorial

User provides a person’s name and company. The script searches Google and generates an enriched profile summary — role, background, company overview, and outreach context.

Why build this

This tutorial shows how to build a people-research workflow using two inputs and a single Search Google action. You’ll see how the script combines information about both the person and their company into a single Generate Text call — synthesizing public data into a sales-ready profile. It’s a practical pattern for any workflow that needs to enrich inbound leads or prep for outreach.

Blocks you’ll use

  • User Input — Collects the prospect’s name and company in a single block, with two user inputs configured inside it.
  • Run Script — Houses the Workflow Script. Inside the script, a Search Google action researches the person and company, and a Generate Text action writes the enriched profile summary.
  • Display Content — Shows the enriched profile to the user.

Canvas flow

Start → User Input → Run Script → Display Content → End

The Run Script block is where your Workflow Script lives. It uses a Search Google action to research both the person and their company, then feeds that information into a Generate Text action to produce a sales-ready profile summary returned under the key profile.

How to build it

  1. Open the Automations Canvas — Open MindStudio. The Automations Canvas is displayed by default. You’ll see a Start block and an End block already in place.

  2. Add a User Input block — Click + to add a block and select User Input. This block will hold both user inputs for this workflow.

    • Add the first user input — In the block settings on the right, click +, then click Create New. Set the Type to Short Text, enter name in the Variable field, set the Label to a short name like “Name”, and set the Help Text to something like “What is the prospect’s full name?”
    • Add the second user input — Click the + next to User Inputs in the Explorer panel on the left. Set the Type to Short Text, enter company in the Variable field, set the Label to a short name like “Company”, and set the Help Text to something like “What company do they work at?” Then return to the block settings, click +, and select company from the list to add it to the block.
    • Add the remaining inputs to the block — Once you’ve created all your user inputs, click the Main.flow tab to return to the workflow. Click the User Input block on the canvas to select it. In the block settings on the right, click + to open the Choose User Inputs to Add modal. Select company in the order you want it displayed to the user, then click Add.
  3. Add a Run Script block — Click + in the workflow, then select View All Blocks. From the Blocks screen, search for Run Script and select it. In the block settings, click Edit Script to open the script editor. Paste the prompt below to generate the script automatically.

    Generate a script that takes a person's name and company as input. Use a Search Google action to research the person and their company. Then use a Generate Text action to produce an enriched profile summary covering their role, professional background, company overview, and relevant context useful for sales outreach. Return the profile under a key named profile.
    • Return to the workflow — Once the script is generated, click the Main.flow tab to return to the workflow. The Input Variables and Output Variables settings will appear in the block settings on the right.
    • Configure Input Variables — Set the Variable for each:
      • For name, set the Variable to {{name}}
      • For company, set the Variable to {{company}}
    • Configure Output Variables — Confirm that profile is mapped to the variable {{profile}}.
  4. Add a Display Content block — Click + and select Display Content. Connect it after the Run Script block. In the block settings, set the Message field to {{profile}} — the variable you mapped in the Run Script block’s Output Variables. This displays the enriched profile generated by your script.

  5. Name your AI agent — Click Untitled Agent at the top of the interface, then update the Agent Name field — for example, “Lead Enrichment Tool.”

  6. Preview your AI agent — Click the Preview button, then select Open Draft Agent to run the AI agent and test your workflow.

Try it in MindStudio

Open MindStudio and follow along with this tutorial. No coding required.

Presented by MindStudio

No spam. Unsubscribe anytime.