MindStudio Docs
  • Get Started
    • Overview
    • MindStudio Chrome Extension
    • Quickstart Guide
    • What is an AI Agent?
    • AI Agent Use Cases
  • Free vs. Paid AI Agents
  • Building AI Agents
    • Editor Overview
    • Workflow Generator
    • Writing Prompts
      • Templating
    • AI Models
    • Variables
      • Working with JSON
      • Using Handlebars Templating
    • Dynamic Variables
    • Data Sources
    • Automations
      • Start Block
      • Generate Text Block
      • Generate Image Block
      • Generate Chart Block
      • Generate Asset Block
      • Display Content Block
      • Text to Speech Block
      • Analyze Image Block
      • User Input Block
      • User Context Block
      • Query Data Block
      • Run Function Block
      • Scrape URL Block
      • Extract Text from File Block
      • Post to Slack Block
      • Menu Block
      • Logic Block
      • Checkpoint Block
      • Jump Block
      • Run Workflow Block
      • Terminator Block
    • Integrations
      • Search Bluesky Posts
      • Scrape Facebook Page
      • Scrape Meta Threads Profile
      • Scrape Instagram Comments
      • Scrape Instagram Mentions
      • Scrape Instagram Posts
      • Scrape Instagram Profile
      • Scrape Instagram Reels
      • Create LinkedIn Post
      • Create X Post
      • Search X Posts
      • Search Google
      • Search Google Images
      • Search Google Trends
      • Search Google News
      • Create Google Doc
      • Fetch Google Doc
      • Update Google Doc
      • Create Google Sheet
      • Fetch Google Sheet
      • Update Google Sheet
      • Enrich Company via Domain
      • Find Contact Email for Website
      • Find Email
      • Verify Email
      • Enrich Person via Email
      • Fetch YouTube Captions
      • Fetch YouTube Channel
      • Fetch YouTube Comments
      • Fetch YouTube Video
      • Search YouTube
      • Search YouTube Trends
      • Create Notion Page
      • Update Notion Page
      • Apify
      • Run Scenario
      • Post to Slack
      • HTTP Request
      • Run Node
      • Create Contact
      • Add Note
      • Send Email
      • Send SMS
    • Publishing & Versioning
  • Embedding AI Agents
  • Using Webhooks
  • Workspace Management
    • Workspace Overview
    • Workspace Settings
    • Usage Explorer
    • Billing Settings
    • Account Settings
    • Team Settings & Access Controls
  • Test & Evaluate
    • Testing Suite Overview
    • Evaluations
    • Profiler
    • Debugger
  • Integration Guides
    • Zapier + MindStudio
    • Make.com + MindStudio
    • n8n + MindStudio
  • Developers
    • API Reference
    • NPM Package
    • Custom Workflow Functions
  • Additional Resources
    • Glossary
    • Allowing Access to Mindstudio From Your Network
  • Solutions
    • MindStudio Solutions Partners
    • MindStudio For Developers
    • MindStudio for Enterprises
Powered by GitBook
On this page
  • How Dynamic Inputs Work
  • Building a Workflow with Dynamic Inputs
  • Example: Fire Sprinkler Part Finder
  • Use Cases for Dynamic Variables
  • Conclusion
Export as PDF
  1. Building AI Agents

Dynamic Variables

Learn how to properly use dynamic variables in your AI Workflows

Last updated 1 month ago

Dynamic Variables in MindStudio enable workflows to generate and modify user inputs in real time, allowing for more adaptive and interactive experiences. This feature is particularly useful for scenarios where follow-up questions depend on previous responses, such as product recommendations, lead generation, and troubleshooting agents.

By leveraging variables, arrays, and Handlebars helpers, Dynamic Inputs allow workflows to progressively collect information and adjust questions based on user input.


How Dynamic Inputs Work

Dynamic Inputs use variables to store and retrieve responses, allowing the workflow to adjust its next question dynamically. This pattern is useful in AI Agents that require multiple layers of questioning before generating a final result.

Key Elements

  1. Inputs Array – myVariable[] - Stores inputs generated into an array.

  2. (optional) User Input Block with Dynamic Prompts – Add {{myVariable[]}} to the title of a

  3. (optional) Handlebars helpers - Used to quickly find items in the array variable.


Building a Workflow with Dynamic Inputs

1. Collect Initial User Information

Start by gathering basic user input using a User Input Block. This might include general details like name, contact information, or the primary topic of inquiry.

Example: "What part are you looking for?"

The response is stored in a variable, such as partRequest.


2. Generate a Follow-Up Question

Once the user provides an initial answer, the workflow generates a follow-up question based on the input. This follow-up question is:

  • Added to the Questions Array variable: questions[].

  • Displayed dynamically as the next prompt using: {{lastItem questions}}.

Example:

  • The user inputs "fire sprinkler".

  • The workflow generates "What type of sprinkler are you looking for?" and stores it in questions.


3. Store User Responses

Each response is stored in the Answers Array Variable (answers[]), ensuring all collected data is saved for final processing.

Example:

  • The user selects "Pendant", which is added to answers.


4. (optional) Logic Block for Additional Questions

The Logic Block determines:

  • If more information is needed, the workflow loops back, dynamically generating another follow-up question.

  • If sufficient responses are collected, the workflow moves forward to generate the final result.

Example:

  • Second Follow-Up Question: "What temperature rating do you need?"

  • Third Follow-Up Question: "What finish or color scheme?"


5. Generate the Final Result

Once all necessary inputs are collected, the workflow processes the information and generates a response based on the accumulated answers.

Example Output: "You are looking for a brass pendant fire sprinkler with a 135°F temperature rating."


Example: Fire Sprinkler Part Finder

This workflow dynamically adjusts to refine user requests:

Step
User Input
Follow-Up Question

1

Fire Sprinkler

What type of sprinkler are you looking for?

2

Pendant

What temperature rating do you need?

3

135°F

What finish or color scheme do you need?

4

Brass

Final output is generated

Each follow-up question is stored in questions[], and the corresponding user input is stored in answers[].


Use Cases for Dynamic Variables

Dynamic Inputs open new possibilities for AI-driven workflows:

  • Lead Qualification – Tailor follow-up questions based on user responses to better qualify leads.

  • Product Recommendations – Ask clarifying questions to suggest the best product options.

  • Troubleshooting Assistants – Adjust questions dynamically based on user-reported issues.


Conclusion

  • Dynamic Variables leverage arrays to adjust varaibles in real time.

  • The Logic Block determines when to stop questioning and proceed with generating results.

  • Handlebars helpers like {{lastItem}} retrieve the most recent question for dynamic presentation.

This pattern is a powerful way to build interactive and intelligent AI Agents that adapt to user needs dynamically. While it requires a deeper understanding of arrays and variable management, the flexibility it provides makes it a game-changer for many AI-driven workflows.

User Input