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
  • Configurations
  • Prompt
  • Response Behavior
  • Output Schema
  • Model Settings
  • Using Conditional Logic in Your Prompt
  • How to Use Conditionals:
Export as PDF
  1. Building AI Agents
  2. Automations

Generate Text Block

Use an AI model to generate text in your AI Agents.

Last updated 5 months ago

The Generate Text Block sends a text prompt to an AI model and returns the AI Model’s response.

Configurations

Prompt

Define the instructions sent to the AI model. Use {{variables}} to make the prompt dynamic and context-aware.

Response Behavior

Choose how the AI response is handled:

  • Display to User (Default): Shows the response to the end user.

  • Assign to Variable: Creates a new variable and saves the AI model’s response to it. Enter a variable_name ****to store the response for later use in the workflow.

Output Schema

Choose the format of the AI response:

Text (Default):

Outputs plain or markdown-formatted text, suitable for display or emails.

JSON:

Outputs the response in JSON format, ideal for structured data outputs required for integrations or further processing via code.

Example Schema:

{
    "title": "string",
    "summary": "string",
    "date": "string"
}

CSV:

Outputs data in CSV format, ideal for tabular data or spreadsheets.

Example Schema:

Title,Summary,Date

For both JSON and CSV outputs, you can explicitly define the output structure by providing a sample output schema.

Model Settings

The default setting is inherited from the underlying model configured in the Model Settings Tab. You can override this setting by choosing and configuring a different AI Model specifically for this block.

  • Model Selection: Choose a different model if needed for the block.

  • Temperature: Adjust randomness in the response:

    • Lower values = more predictable, consistent results.

    • Higher values = more creative, varied responses.

  • Response Length: Limit the output size in tokens to suit your needs.

Using Conditional Logic in Your Prompt

The Generate Text Block supports conditional logic to dynamically adjust the text prompt based on workflow variables. This is done using {{#if}}, {{else}}, and {{/if}} statements.

How to Use Conditionals:

Basic Syntax:

{{#if myVariable}}
Use {{myVariable}} to perform this task.
{{else}}
Perform a default action if myVariable is undefined.
{{/if}}

Example:

{{#if customerName}}
Write a thank-you email to {{customerName}}, highlighting our latest offers.
{{else}}
Write a general thank-you email to all customers, highlighting our latest offers.
{{/if}}

Nested Conditionals:

Combine multiple {{#if}} statements for complex logic:

{{#if userType}}
    {{#if isPremium}}
    Generate a personalized message for our premium user {{userType}}.
    {{else}}
    Generate a message for our standard user {{userType}}.
    {{/if}}
{{else}}
Generate a message for a general audience.
{{/if}}
Learn about variables →