Demos & Examples

Use cases for AI workflow orchestration. Full code examples available Q1 2026.

Example Workflows

Codebase Analysis & Planning

Workflow: Multi-step analysis starting with context gathering (read files, list directories), followed by AI-powered analysis, ending with structured Linear issue creation.

Problem: Running a 3-step analysis workflow means making 3 separate LLM calls. Each call re-sends system prompts and repository context. If step 2 fails (rate limit, timeout), you lose all progress and burn tokens re-running step 1.

With Sanar: Workflow checkpoints after each step (context gathering, analysis, issue creation). System prompts and repo context automatically cached between steps. If analysis fails, resume from that step with previous context intact - no re-gathering, no wasted tokens.

Target: 50-60% token reduction via caching (based on Anthropic's prompt caching specifications and typical multi-step workflow patterns).

Multi-Repository Implementation

Workflow: Implement a feature across backend, frontend, and shared libraries in parallel, then run tests, generate evidence for audit trail.

Problem: Implementing changes across 3 repos sequentially takes 45 minutes. If one repo fails, you have to manually track which succeeded and retry the right ones. No audit trail of what changed or why.

With Sanar: Parallel execution runs backend/frontend/library changes simultaneously. Built-in evidence store logs every step with full context. Failed workflows resume from checkpoint - successful repos stay done, failed repo retries automatically.

Target: 40% faster execution (3 parallel repos vs. sequential) based on Phase 2 design specifications.

Human-in-the-Loop Code Review

Workflow: AI generates code changes → pauses for human approval → applies changes → runs tests → creates PR with evidence of what changed and why.

Problem: Autonomous code changes are risky. You want AI to do the heavy lifting, but need human approval before applying changes. Typical tools don't support pause/resume - they run to completion or fail entirely.

With Sanar: Workflow pauses after code generation, sends notification for approval. Human reviews changes in context (sees what was analyzed, what problem was solved, what solution was chosen). Approve → workflow resumes and applies changes. Reject → workflow fails gracefully with full context logged.

Target from roadmap: 80% of implementation tasks use workflow automation with human oversight.

Compliance Evidence Generation

Workflow: Automated collection of SOC2/ISO27001 evidence from workflow execution logs, code changes, and system events. Generates structured reports for auditors.

Problem: Compliance audits require proving "who did what, when, and why" for every system change. Manual evidence collection is error-prone and time-consuming. Most workflow tools do not log enough detail for audit requirements.

With Sanar: Every workflow step automatically logged with full context - prompts, responses, decisions, outcomes. Evidence store provides immutable audit trail. Compliance workflows query evidence store and generate reports in auditor-friendly formats.

Planned feature: Automated SOC2 Type II evidence collection for workflow-driven development.

Workflow Architecture

// Real workflow from our codebase (TypeScript) @workflow({ name: "analysis", description: "Analyze codebase and create Linear issue", required_inputs: ["repo_path"], expected_outputs: ["analysis", "linear_issue_id"] }) class AnalysisWorkflow extends BaseWorkflowOrchestrator { _define_workflow() { // Step 1: Gather context from repository this.add_step({ name: "gather_context", agent_type: "context_gatherer", system_prompt_template: "Gather context for: {repo_path}", available_tools: ["read_file", "list_directory"], required_completion_tool: "submit_context" }); // Step 2: AI-powered analysis this.add_step({ name: "analyze", agent_type: "analyzer", system_prompt_template: "Analyze: {gather_context_result}", available_tools: ["web_search", "submit_analysis"], required_completion_tool: "submit_analysis", cache_context: true // Cache repo context for token savings }); // Step 3: Create Linear issue with analysis this.add_step({ name: "create_issue", agent_type: "linear_client", system_prompt_template: "Create issue: {analyze_result}", available_tools: ["linear_create_issue"], required_completion_tool: "linear_create_issue" }); // Define step transitions this.add_transition({ from_step: "gather_context", to_step: "analyze", condition: (result) => result.success }); this.add_transition({ from_step: "analyze", to_step: "create_issue", condition: (result) => result.success }); } } // How to use it (via CLI or MCP) const workflow = registry.get_workflow("analysis"); const result = await workflow.execute({ repo_path: "/path/to/your-project" }); // What you get back: { success: true, analysis: { architecture: "Monorepo with TypeScript CLI + Python sidecar", key_files: ["packages/core/src/orchestrator/base.ts", ...], recommendations: ["Add retry logic to Linear OAuth", ...] }, linear_issue_id: "SANAR-42", execution_time_ms: 8421, token_usage: { total: 12847, cached: 7891, cache_savings_pct: 61.4 } } // Automatic features you get for free: // - Checkpoints after each step (resume from failure) // - Context caching between steps (60%+ token reduction) // - Full telemetry and logging (debug with exact prompts/responses) // - Evidence store for audit trails (who/what/when/why)

vs. Temporal / Airflow / Prefect

Temporal is great for microservice orchestration. Airflow is great for data pipelines. Prefect is great for data workflows. We are not competing there.

Sanar is built specifically for LLM workflows:

If you are orchestrating LLM calls, Sanar saves you money and time.
If you are orchestrating microservices, use Temporal.
If you are orchestrating data pipelines, use Airflow.

What Makes This AI-Native

Most workflow tools (Temporal, Airflow, Prefect) were built for data pipelines or microservices. They treat LLM calls like any other API request - they do not understand the unique patterns of AI workflows.

Sanar is built specifically for AI workflow orchestration:

We are building the orchestration layer AI systems actually need - not adapting generic workflow tools to AI use cases.

Full Code Examples Coming Q1 2026

Complete working examples with Python/TypeScript SDKs, deployment guides, and best practices. Join the waitlist at sanar.co to get notified.