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
  • Agent
  • Workflow
  • Launch Variables
  • Output Variables
  • Preparing the Sub-Workflow
  • Launch Variables:
  • Structured Outputs:
  • Best Practices
Export as PDF
  1. Building AI Agents
  2. Automations

Run Workflow Block

Execute a sub-workflow within a parent workflow

The Run Workflow Block allows you to execute a separate workflow within your main workflow. This block is ideal for running sub-processes and reusing common processes across multiple workflows.


Configurations

Agent

Select the AI Agent containing the workflow you want to run.

  • Use the dropdown to choose the appropriate AI Agent.

  • Ensure the selected AI Agent contains the workflow you want to execute.

Workflow

Choose the specific workflow within the selected AI Agent to execute.

  • Select from available workflows in the chosen AI Agent.

  • For modular workflows, ensure the selected workflow is designed for integration.

Launch Variables

Define the values to pass to the required variables in the selected workflow.

  • Assign static values or use variables from the current workflow.

Example:

  • Variable: customer_name

  • Value: {{userName}}

Output Variables

Map the outputs of the sub-workflow back to variables in the parent workflow.

  • Assign the variable_name you want to store the sub-workflow's output in.

  • Enter the variable_name without curly braces.

Example:

  • Variable: customer_profile

  • Mapped to: customer_info in the parent workflow


Preparing the Sub-Workflow

Before a sub-workflow can be used in the Run Workflow Block, it must be configured with:

Launch Variables:

Define the launch variables that the parent workflow will provide. Go to the sub-workflow you'd like to run and add Launch Variables in the Start Block of the sub-workflow.

Example Launch Variables:

  • customer_name: The parent workflow will pass the customer name down to the sub-workflow.

  • order_id: The parent workflow will pass the ID of the customer's order down to the sub-workflow.

Structured Outputs:

Define the Return Data that the sub-workflow will return to the parent workflow. Add these variables to the sub-workflow’s Terminator Block under Return Data -> JSON Output.

Example Return Data:

  • customer_profile: Returns customer details retrieved from the sub-workflow.

  • order_status: Returns the status of the processed order from the sub-workflow.

Note: If a workflow lacks these configurations, you will see an error message:

"The selected workflow has not been configured with launch variables and structured outputs."


Best Practices

  • Ensure Variable Alignment: Make sure that required variables in the sub-workflow are properly assigned with values during execution.

  • Optimize Your Workflows: Use this block to simplify complex workflows by breaking them into manageable, reusable components.

  • Test Input and Output Mapping: Verify that all variables are passed correctly between the parent and sub-workflows.

Last updated 1 month ago

Define Launch Variables in Sub-workflow
Define Return Data in Sub-workflow