FiveonefourFiveonefour
Fiveonefour Docs
MooseStackTemplatesGuides
Release Notes
Source514
  1. MooseStack
  2. Moose Workflows

On this page

OverviewBasic UsageEnabling WorkflowsCore CapabilitiesIntegration with Other Capabilities

Moose Workflows

Overview

The Workflows module provides standalone task orchestration and automation. You can use this capability independently to build ETL pipelines, run scheduled jobs, trigger background tasks, and manage long-running tasks without requiring other MooseStack components like databases or streams.

Basic Usage

Export Required

Ensure your Workflow and Task is correctly imported into your main.py file.

Example (TypeScript equivalent): export { myworkflow, task1, task2 }

Learn more about export pattern: local development / hosted.

DataFlow.py
from moose_lib import Task, TaskConfig, TaskContext, Workflow, WorkflowConfigfrom pydantic import BaseModel class Foo(BaseModel):    name: str class Bar(BaseModel):    name: str    greeting: str    counter: int def run_task1(ctx: TaskContext[Foo]) -> Bar:    greeting = f"hello, {ctx.input.name}!"    return Bar(        name=ctx.input.name,        greeting=greeting,        counter=1    ) def run_task2(ctx: TaskContext[Bar]) -> None:    print(f"{ctx.input.greeting} (count: {ctx.input.counter})") task1 = Task[Foo, Bar](    name="task1",    config=TaskConfig(run=run_task1, on_complete=[task2])) task2 = Task[Bar, None](    name="task2",    config=TaskConfig(run=run_task2)) myworkflow = Workflow(    name="myworkflow",    config=WorkflowConfig(starting_task=task1)) # No export needed - Python modules are automatically discovered

Enabling Workflows

To enable workflows, you need to add the workflows feature to your moose.config.toml file:

moose.config.toml
[features]workflows = true

Core Capabilities

Definition
Define Workflows
Create workflow definitions with task sequences and data flow
Scheduling
Schedule Workflows
Set up recurring and scheduled workflow execution
Triggers
Trigger Workflows
Start workflows from events, APIs, or external triggers

Integration with Other Capabilities

While the Workflows capability works independently, it is designed to be used in conjunction with other MooseStack capabilities:

Moose OLAP
For batch data ingest, use workflows to run batch data extraction, transformations, and then load directly into your OLAP tables with the `OlapTable.insert()` method.
Learn More →
Moose APIs
Trigger workflows from API endpoints or call APIs from workflow tasks.
Learn More →
  • Overview
Build a New App
  • 5 Minute Quickstart
  • Browse Templates
  • Existing ClickHouse
Add to Existing App
  • Next.js
  • Fastify
Fundamentals
  • Moose Runtime
  • MooseDev MCP
  • Data Modeling
Moose Modules
  • Moose OLAP
  • Moose Streaming
  • Moose Workflows
    • Define Workflows
    • Scheduling
    • Triggers
    • Retries and Timeouts
    • Cancelling Running Workflows
  • Moose APIs & Web Apps
Deployment & Lifecycle
  • Moose Migrate
  • Moose Deploy
Reference
  • API Reference
  • Data Types
  • Table Engines
  • CLI
  • Configuration
  • Observability Metrics
  • Help
  • Release Notes
Contribution
  • Documentation
  • Framework