Skip to main content

What are Workflows?

Workflows in Shannon are durable, stateful processes that orchestrate AI agents to complete complex tasks. Built on Temporal, they provide:
  • Durability: Workflows survive service restarts and failures
  • Determinism: Can be replayed for debugging
  • Visibility: Full execution history and state inspection
  • Reliability: Automatic retries and error handling

Workflow Architecture

Workflow Architecture

Cognitive Patterns

Shannon implements several proven cognitive patterns for different task types:

Chain-of-Thought (CoT)

Sequential reasoning where each step builds logically on the previous one. Best for:
  • Mathematical problems
  • Step-by-step analysis
  • Linear workflows
Example:
Shannon automatically applies Chain-of-Thought reasoning for sequential mathematical and analytical tasks.
Execution:

Tree-of-Thoughts (ToT)

Explores multiple solution paths simultaneously, evaluates them, and selects the best. Best for:
  • Design decisions
  • Strategic planning
  • Problems with multiple approaches
Example:
Shannon automatically applies Tree-of-Thoughts exploration for design and planning tasks with multiple solution paths.
Execution:

ReAct (Reasoning + Acting)

Interleaves thinking and acting in loops, ideal for dynamic problem-solving. Best for:
  • Research tasks
  • Debugging problems
  • Adaptive workflows
Example:
Shannon automatically applies ReAct (Reasoning + Acting) for research and iterative discovery tasks.
Execution:

Debate Pattern

Multiple agents argue different perspectives, then synthesize consensus. Best for:
  • Decision making
  • Evaluating trade-offs
  • Balanced analysis
Example:
Shannon automatically applies the Debate pattern for decision-making tasks requiring multiple perspectives.
Execution:

Task Decomposition

For complex tasks, Shannon automatically decomposes them into subtasks:

DAG (Directed Acyclic Graph) Execution

DAG Execution Parallel Execution: Subtasks without dependencies run in parallel, reducing latency. Example:

Decomposition Strategy

Shannon analyzes tasks and creates execution plans internally. While the decomposition structure isn’t directly exposed in the SDK response, you can observe the workflow execution through events:
Internal Structure (for understanding, not directly accessible):
  • Subtasks run in parallel when no dependencies exist
  • Synthesis task waits for all subtasks to complete
  • Each subtask is assigned to specialized agents

Workflow Activities

Temporal workflows are composed of activities - discrete units of work:

Monitoring Workflows

Via Python SDK

Task decomposition happens internally in Shannon. Use event streaming to observe workflow execution in real-time.

Via Temporal UI

Visit http://localhost:8088 to see:
  • Workflow execution timeline
  • Activity statuses
  • Input/output payloads
  • Error traces
  • Replay history

Deterministic Replay

Shannon workflows are deterministic - they produce the same result when replayed with the same inputs. Use cases:
  • Debugging: Replay failed workflows to find bugs
  • Testing: Validate code changes don’t break existing workflows
  • Auditing: Understand exactly what happened
Example:

Workflow Configuration

Workflow behavior is configured via environment variables (examples):
Monitor workflow execution via streaming events:
See Configuration Guide for all environment variables.

Error Handling

Workflows automatically handle failures:
Activities retry automatically with exponential backoff:
If an LLM provider is failing, circuit breaker opens and routes to fallback:
If complex mode fails, automatically falls back to simpler execution.
Tasks halt immediately when budget limits are reached, preventing cost overruns.

Best Practices

1. Choose the Right Strategy

Match the cognitive strategy to your task:

2. Use Appropriate Mode

  • simple: Direct execution, no overhead
  • standard: Task decomposition, multi-agent
  • complex: Full cognitive patterns (CoT, ToT, etc.)

3. Monitor Progress

Stream events to track workflow execution:

4. Set Timeouts

Prevent workflows from running indefinitely via environment variables:

Next Steps

Cost Control

Learn budget management

Streaming

Real-time event streaming

Architecture

System architecture overview

Python SDK

Get started with the SDK