Skip to Content
WorkflowsOverview

Workflows

Build automated AI pipelines with visual DAG composition and execution monitoring.

Workflow canvas showing a multi-node DAG with connected Prompt, Guardrail, and HITL nodes

What are Workflows?

Workflows in M3 Forge are Directed Acyclic Graphs (DAGs) that orchestrate multi-step AI operations. Each workflow consists of nodes connected by edges, where data flows from inputs through transformation, validation, and enrichment stages to produce final outputs.

Workflows enable:

  • Visual pipeline composition using a drag-and-drop canvas editor
  • Reusable logic through modular node architecture
  • Quality control with built-in validation and guardrails
  • Human oversight via approval gates and correction steps
  • Real-time monitoring of execution status and logs

DAG Execution Model

Workflows execute as directed acyclic graphs where:

  1. Nodes represent operations (LLM invocation, code execution, validation, human review)
  2. Edges define data flow and execution order
  3. Inputs are passed as JSONPath-accessible context
  4. Outputs from each node become available to downstream nodes via $.nodes.<node_id>.output

The execution engine respects dependency order, runs independent branches in parallel, and provides detailed logging at each step.

Key Concepts

Nodes

Atomic units of work that perform specific operations. Each node has:

  • Type - Defines behavior (Prompt, Code, Guardrail, HITL, etc.)
  • Configuration - Parameters like model selection, thresholds, routing rules
  • Inputs - Data consumed from upstream nodes or workflow context
  • Outputs - Results made available to downstream nodes

See the Node Catalog for all available node types.

Edges

Directed connections between nodes that define:

  • Data flow - Output from source node becomes input to target node
  • Execution order - Target node runs after source completes
  • Conditional routing - Guardrail and HITL nodes support multiple output paths

Context

JSON object containing all workflow state:

  • Input data - Initial payload passed to workflow ($.data.*)
  • Node outputs - Results from executed nodes ($.nodes.<node_id>.output)
  • Metadata - Execution timestamps, user info, run ID

Access context in node configurations using JSONPath syntax like $.nodes.llm_node.output.text.

Paths

Nodes like Guardrail and HITL Router can route execution to different downstream paths based on evaluation results. Each path specifies:

  • path_id - Identifier like pass, fail, approve, reject
  • target_node_ids - Array of nodes to execute on this path

This enables retry loops, fallback logic, and conditional branching.

When to Use Workflows

Workflows are ideal for:

Use CaseExample
Multi-step document processingExtract → Classify → Route → Transform → Validate
RAG pipelinesRetrieve → Rerank → Generate → Faithfulness check
Approval workflowsProcess → Review → Approve/Reject → Notify
Data validationExtract → Schema validation → PII detection → Quality scoring
Iterative refinementGenerate → Evaluate → Retry if needed → Return result

For simple single-step operations, use Agents or direct API calls instead.

Getting Started

Architecture

Workflows are stored as JSON DAG definitions in PostgreSQL (marie_scheduler.dags table) and executed by the Marie-AI backend via a RabbitMQ-backed job scheduler. The M3 Forge frontend provides:

  • Canvas editor (React Flow) for visual composition
  • tRPC API for DAG CRUD operations
  • SSE streams for real-time log consumption
  • Run management UI for monitoring and control

Workflows execute on Marie-AI backend infrastructure, not in the browser. The canvas is a visual editor that generates executable DAG JSON.

Next Steps

Last updated on