Skip to Content
DocumentationGetting StartedBasic Concepts

Basic Concepts

Loopstack uses a modular architecture where every component (workflow, document, tool, and workspace) is defined as a reusable, configurable element.

Every component in Loopstack consists of two parts:

  1. TypeScript Services: Defines data structure, validation rules, capabilities.
  2. YAML Configuration: Defines the runtime behavior, UI representation, and execution flow

Note, using the separate yaml configs is optional. You can also define the behaviour using the config property in the decorator options following the same schema. However, we recommend using the yaml configuration for better modularity, reusability and readability.

Example

Here’s a minimal example showing the essential components of a workflow:

workflow.ts - Container

@Workflow({ configFile: './config.yaml', }) export class ClassificationWorkflow { @Input({ schema: z.object({ message: z.string(), }) }) args: { message: string } @InjectDocument() classificationDocument: ClassificationDocument; @InjectTool() aiGenerateDocument: AiGenerateDocument; @InjectTool() notifyTool: NotifyTool; }

workflow.yaml - State Machine

transitions: - id: step1 from: start to: message_classified call: - tool: AiGenerateDocument args: response: document: classificationDocument prompt: | Classify the following message: {{ args.message }} assign: classification: ${{ response.data.content }} - id: notify from: message_classified to: end call: - tool: notifyTool args: message: ${{ args.message }} priority: ${{ state.classification.priority }}

Block Types

Loopstack includes several block types, each serving a specific purpose:

  • Workspaces: Group related workflows and provide organizational structure
  • Workflows: Orchestrate processes using state machine transitions
  • Documents: Define structured data with validation and UI configuration
  • Tools: Encapsulate reusable operations (API calls, transformations, etc.)
Last updated on