What is a Use Case?
In MagOneAI, a Use Case is a workflow — a sequence of activities that orchestrate AI agents, tools, and logic to accomplish a task. Each Use Case is defined visually on the canvas, stored as portable JSON, and executed durably by Temporal. Think of a Use Case as a blueprint for how your AI agents, tools, and decision logic work together. You define the steps, connect them together, and MagOneAI handles the orchestration, execution, and state management.MagOneAI uses the term “Use Case” for what other platforms call workflows or pipelines. Each Use Case contains Activities — the individual steps that make up the workflow.
Visual canvas builder
Build workflows visually using the drag-and-drop canvas in MagOneAI Studio. The canvas provides an intuitive way to design complex orchestration logic without writing code.Building on the canvas
Add activities
Drag activity nodes from the sidebar onto the canvas. Each node represents a step in your workflow.
Connect the flow
Draw connections between nodes to define the execution order. Data flows through these connections.
Available node types
Agent
Execute an AI agent with reasoning, tools, and knowledge bases
Tool
Call an MCP tool directly with specific parameters
Parallel
Run multiple branches simultaneously for maximum throughput
Condition
Route execution based on conditional logic
Human Task
Pause for human approval or input before continuing
Sub Use Case
Call another workflow as a reusable component
ForEach
Iterate over collections and process each item
Workflow as JSON
Every canvas workflow has an equivalent JSON definition. This portable format enables:- Version control — Track changes to workflows in Git
- Import/export — Share workflows across projects and teams
- Programmatic generation — Build workflows dynamically
- Backup and migration — Move workflows between environments
Execution lifecycle
When you trigger a workflow, MagOneAI orchestrates a series of steps to execute your Use Case reliably and durably.Trigger fires
The workflow starts from a trigger — an API call, schedule, manual execution, or chat message. The trigger provides initial input data.
Temporal workflow starts
MagOneAI creates a Temporal workflow execution. This ensures durable execution with automatic recovery and retry capabilities.
Activities execute in sequence
Each activity in your workflow runs in order, respecting parallel branches and conditional logic. Activities execute one at a time unless you use Parallel nodes.
Activity processing
Each activity receives input from the variable store, performs its work (agent reasoning, tool execution, etc.), and produces output.
Variable store updates
After each activity completes, its output is stored in the variable store. Subsequent activities can access this data through variable references.
Data flow through the workflow
Data flows through your workflow via the variable store — a key-value store scoped to each execution:- Trigger input enters the variable store
- Activity outputs are written to the variable store
- Downstream activities read from the variable store using variable references like
{{previous_activity.output.field}} - Final output is assembled from variable store contents
Temporal durable execution
MagOneAI leverages Temporal to provide robust, reliable workflow execution with enterprise-grade durability guarantees.What Temporal provides
Crash recovery
If a server crashes mid-execution, the workflow automatically resumes from the last checkpoint
Automatic retries
Failed activities are automatically retried according to your retry policy
Long-running execution
Workflows can run for minutes, hours, or even days without losing state
Full observability
Complete execution history with activity-level logs, timing, and state transitions
How checkpointing works
Every workflow step is checkpointed to durable storage:- Before each activity — Temporal records the execution state
- After each activity — Results are persisted before moving to the next step
- On failure — The workflow can resume from the last successful checkpoint
- Across restarts — Server restarts don’t interrupt execution
Benefits for AI workflows
Durable execution is especially valuable for AI workflows:- Long LLM calls — Agents can take minutes to reason and execute tools
- Human-in-the-loop — Workflows can wait hours or days for human approval
- Batch processing — Process thousands of items without worrying about failures
- Cost optimization — No compute resources consumed while waiting for external events