Workflow Scripts
Build a workflow by describing it in plain language — or by assembling actions in code.
What Is a Workflow Script?
A Workflow Script is a TypeScript file that defines workflow logic in code. Instead of connecting blocks on the Automations Canvas, you describe what your workflow should do, and the built-in AI agent writes the script for you. You can also add actions manually using the + Add Action button.
Once written, a Workflow Script is executed on the Automations Canvas using a Run Script block, which connects your script to the rest of your workflow — passing in inputs and mapping outputs to variables just like any other block.
No API keys or developer setup are required. Workflow Scripts run entirely within MindStudio.
When to Use a Workflow Script
Workflow Scripts are a great fit when you want to:
Build a workflow quickly by describing it in plain language
Express multi-step logic (conditionals, loops, data formatting) more naturally than with visual blocks
Consolidate several actions into a single, self-contained script
Iterate on a workflow by chatting with the AI agent in the Script Editor
Workflow Scripts and visual workflows can also be combined — a single Run Script block can sit alongside other blocks on the canvas.
Inputs to the Workflow Script are specified as launch variables, such as from a User Input block. Outputs from the Workflow Script are specified as output variables for following blocks.
Creating a Workflow Script
Step 1: Add a New Workflow Script
In the Explorer panel on the left, locate the Workflows section.
Click the + button, and then Workflow Script.
A new script file (e.g.,
index.ts) will be created and opened in the Script Editor.

The Script Editor has three main areas:
Left panel — AI Agent chat: Describe your workflow in plain language. The AI agent reads your description, writes the TypeScript code, and explains what it built. You can ask follow-up questions, request changes, or iterate from there.
Center panel — Script Editor: The generated (or manually written) TypeScript code is displayed here.
Right panel — Actions & Summary:
Actions: Lists every MindStudio action (block) in your code — for example, Search Google or Generate Text — along with the line number where it appears. This gives you a quick overview of what your script does.
Summary: A plain-language explanation of the script, auto-generated from the code.
Step 2: Build Your Workflow Script
Building by Describing
The fastest way to create a Workflow Script is to describe what you want to build in the AI Agent chat panel.
Example prompt:
"Generate a script that asks the user for a topic to do a Google Search about. Google does a search on the top 5 responses. A Generate Text block summarizes the responses according to the user's topic, then displays that summary to the user."
The AI agent will:
Write the complete TypeScript script.
Show you the code in the center panel.
Explain what it built and suggest ways to extend it.
Answer your follow-up questions.
You can continue chatting to refine the script at any time.
Building by Adding Actions Manually
Click + Add Action at the bottom of the Script Editor.
The block/connector selection modal will appear — the same one used on the Automations Canvas.
Select the action (block) you want to add.
The corresponding code will be inserted into your script.
Step 3: Use the Script in a Workflow
A Workflow Script runs on the Automations Canvas via a Run Script block. This is how inputs are passed into the script and outputs are made available to the rest of the workflow.
Open or create a workflow (
.flowfile) in the Explorer.On the Automations Canvas, add a Run Script block where you want the script to execute.
In the block's configuration panel on the right, set:
Source Code: Select your Workflow Script file from the dropdown.
Input Variables: Map workflow variables to your script's input parameters. For example, map
{{topic}}from a User Input block to thetopicparameter.Output Variables: Map your script's return values to workflow variables. For example, map the
summaryreturn value to{{summary}}.
The output variables are now available to any following block on the canvas — for example, a Display Content block to show
{{summary}}to the user.
How this example connects to a workflow:
Start → User Input (collects topic) → Run Script (runs this script, passes in {{topic}}, outputs {{summary}}) → Display Content (displays {{summary}}) → End

Last updated