Workflow Structure with Agent Catalyst
An Agent Catalyst workflow is a plain text document that defines a process or goal. Written in Markdown with enhanced syntax, it provides a structured, intuitive way to design and execute tasks.
Agent Catalyst Workflow Organization
Agent Catalyst workflows are structured into three levels:
Workflow: The overarching program, written in natural language and Markdown.
Phase: Subsections representing mini-programs that can reset or reuse context.
Action: Specific tasks or requests sent to AI models or tools within a phase.
Workflows execute sequentially, processing each phase in order and completing all actions within those phases.
Markdown Syntax in Workflows
Agent Catalyst enhances standard Markdown with additional capabilities:
Standard Markdown: Fully supported for text formatting.
Horizontal Rules (
---
): Separate phases within the workflow.Flow Elements:
<GenText />
,<Loop />
, and others for specific actions.JavaScript Expressions (
{}
): Inject dynamic content or reference results.Frontmatter: Define input data and metadata at the start of the workflow.
Phases
Phases organize workflows into logical sections. Each phase resets the context unless data is explicitly passed forward.
Single Phase Example
Multiple Phases Example
Use {poem}
to pass data between phases. Each phase provides a clean context for new actions.
Workflow Descriptions
If the first phase contains no actions, it serves as a description of the workflow’s purpose.
Actions
Actions are the building blocks of workflows. Each action performs a task and produces an output that can be referenced later.
Built-In Actions:
AI Generation:
<GenText />
for text,<GenObject />
for structured data.Control Flow:
<Loop />
,<Cond />
for iteration and conditional logic.
Example:
Expressions
JavaScript expressions enclosed in {}
inject dynamic content into workflows.
In Text:
In Action Attributes:
In Flow Blocks:
Expressions can reference:
Workflow inputs (from frontmatter).
Results of prior actions.
Helper variables provided by actions.
Action Helpers
Actions like <Loop />
and <Cond />
provide helper variables accessible via $
or the action's as
name.
Nested Loops Example
$
refers to the current loop's helpers.$outer
accesses helpers from the parent loop.
Block Scoping
Actions that wrap content (e.g., <Loop />
) create nested scopes. Variables can be reused without conflict, and parent state must be explicitly passed using provide
.
Example with Nested Scopes
With Agent Catalyst, workflows are flexible, modular, and intuitive, enabling dynamic, context-aware AI solutions tailored to your needs.
Last updated