Chaining Multiple Blocks Together
Learn how to chain multiple blocks together in a workflow to pass data from one step to the next.
This guide covers how to build more advanced AI workflows by chaining blocks together. You’ll learn how to take the output from one block, save it as a variable, and use it downstream to enrich prompts, create media, and display final outputs.
Overview: Blog Post Generator with Image
We’re building a multi-step blog post generator that does the following:
Collects a topic from the user.
Uses AI to generate an outline and key talking points.
Writes a full blog post using those points.
Generates a cover image based on the article.
Displays the final post and image together.
Step 1: Collect the Topic
Add a User Input block.
Input type: Short text.
Variable name:
topic
Label: “What topic would you like to write about?”
Step 2: Brainstorm Key Points
Add a Generate Text block.
Prompt:
In Output Behavior, select “Save to Variable”.
Name the variable:
key_points
Step 3: Generate the Blog Post
Add another Generate Text block.
Prompt:
Save the output to a new variable:
blog_post
Step 4: Create an Image Prompt
Add another Generate Text block.
Prompt:
Save output to:
image_description
Step 5: Generate the Image
Add a Generate Image block.
Use
{{ image_description }}
as the image prompt.Save image output to:
image
Step 6: Display the Final Output
Add a Display Content block.
Use this markdown-style format to render both the image and blog content:
This combines everything into one nicely formatted response.
Testing the Workflow
Click Preview to open a draft and enter a test topic (e.g., “F1 cars and tech”). The AI will:
Generate an outline and key points.
Write the full blog post.
Generate an image description.
Create an image.
Display both in the final output.
Use the Debugger to monitor each step:
Track inputs and outputs.
View how variables are resolved.
Analyze each block’s execution.
Recap and Best Practices
Chaining blocks means passing one block’s output as a variable to another block’s prompt.
Use the Save to Variable setting to store data for reuse.
Wrap variables with tags (e.g.,
<blog_post>{{ blog_post }}</blog_post>
) to clarify structure.Use Display Content blocks to compile results into a final presentation.
Chaining is a core MindStudio principle that enables powerful, dynamic workflows. Practice chaining in small steps to build confidence and scale up to more complex agents.
Keep experimenting and expanding your workflows by connecting logic, generation, and media blocks together!
Last updated