Agent Catalyst workflows can leverage input data in two main ways to process and generate meaningful outputs:
Static Data: Predefined and embedded directly in the workflow.
User Input: Dynamically provided by the user at runtime.
Static data is defined in the workflow’s frontmatter metadata using the data field. These values are accessible throughout the workflow during execution.
Example: Static Data
Accessing Data: Reference static data fields like quote or langs using {} syntax, e.g., {quote} or {langs}.
Complex Structures: Data can include simple strings, nested objects, or arrays.
User inputs allow workflows to be reusable by prompting for specific input values during execution. Inputs are defined using the input field in the frontmatter metadata.
Example: User Input
Dynamic Prompts: The user is prompted to input a quote during execution.
Reusability: The workflow adapts to different inputs without modification.
Agent Catalyst supports diverse input types for flexible user interaction. Inputs are specified as key-value pairs under the input field.
1. Text Input
Prompts the user for a single-line or multi-line text.
Example:
2. Select Input
Prompts the user to choose from a list of options.
Example:
3. File Input
Prompts the user to upload a file or specify a file path.
Example:
4. Array Input
Prompts the user to enter multiple text values, which are returned as an array.
Example:
Uniqueness: All variable names (from inputs or actions) must be unique within the workflow. Duplicate names will cause a compilation error.
Nested Scopes: Variables can be reused within nested scopes (e.g., within <Loop /> or <Cond />).
Example of Block Scoping:
In this example:
item and subitem are scoped to their respective loops.
Parent variables must be explicitly passed using provide.
Field
Type
Description
Required
type
string
Must be "text".
✅
message
string
Prompt displayed to the user.
✅
multiline
boolean
Allows multi-line input (default: false).
❌
Field
Type
Description
Required
type
string
Must be "select".
✅
options
array
List of options (strings or objects).
✅
Field
Type
Description
Required
type
string
Must be "file".
✅
fileType
string
File type ("text" or "image").
✅
Field
Type
Description
Required
type
string
Must be "array".
✅
multiline
boolean
Allows multi-line input.
❌
yaml ---
data:
quote: "The only limit to our realization of tomorrow is our doubts of today."
langs:
- Spanish
- Italian
- German
- French
---
<Loop
as="translations"
until={$.index === langs.length}
provide={{ langs, quote }}>
Translate "{quote}" into {langs[$.index]}.
<GenText as="translation" model="openai:gpt-4o" />
</Loop>yaml ---
data:
langs:
- Spanish
- Italian
- German
- French
input:
quote:
type: text
message: "Enter a quote you'd like to translate:"
---
<Loop
as="translations"
until={$.index === langs.length}
provide={{ langs, quote }}>
Translate "{quote}" into {langs[$.index]}.
<GenText as="translation" model="openai:gpt-4o" />
</Loop>yaml quote:
type: text
message: "Enter your favorite quote:"
multiline: false yaml language:
type: select
message: "Select a language for translation:"
options:
- Spanish
- French
- German yaml upload:
type: file
fileType: text
message: "Upload a text file for processing:" yaml languages:
type: array
message: "Enter a list of languages for translation:"
multiline: true yaml <Loop
as="outer"
until={$.index === items.length}
provide={{ item: items[$.index] }}>
Item: {item.name}
<Loop
as="inner"
until={$.index === item.subitems.length}
provide={{ subitem: item.subitems[$.index] }}>
Subitem: {subitem.name}
</Loop>
</Loop>