Core Concepts
Flow Execution Lifecycle
| Phase | Operations | Validation | Next Phase |
|---|---|---|---|
| Validation | • Schema validation of flow JSON • Dependency analysis and cycle detection • Variable reference validation | All checks must pass | Queue or Reject |
| Queueing | • Flow added to in-memory execution queue • Assigned unique identifier (timestamp + execution number) • Waits for available execution slot | Concurrency limits | Execute when slot available |
| Execution | • Flow execution context created with isolated variable registry • Input variables merged with flow variables (input variables take precedence) • Nodes execute sequentially according to dependency order • Variables resolved just-in-time during node execution • Parallel branches handle failures independently | Runtime validation per node | Complete or Fail |
| Completion | • Temporary files cleaned up • Variable registry cleared • Flow removed from active execution tracking | Resource cleanup verification | Return results |
Model Context Protocol (MCP) Integration
The OpenFlow Protocol supports integration with Model Context Protocol (MCP) servers, enabling LLMs to access external tools and data sources in real-time. MCP integration extends LLM capabilities beyond their training data.
MCP Server Configuration
MCP Authentication Configuration
MCP Tools Configuration
Core Components
Component Overview
| Component | Purpose | Scope | Characteristics |
|---|---|---|---|
| Flow | Complete AI workflow definition | Global | Self-contained, executable, versioned |
| Node | Single processing step | Flow-scoped | Unique ID, input/output schema, configurable |
| Variable | Data binding mechanism | Flow/Node-scoped | Typed, resolvable, interpolated |
| Provider | External service integration | System-wide | Authenticated, rate-limited, standardized |
| Execution Context | Runtime state container | Execution-scoped | Isolated, temporary, tracked |
Flow Structure
| Element | Description | Required | Examples |
|---|---|---|---|
| Metadata | Name, version, description, author | ✅ | "document_analyzer", "v1.2.0" |
| Variables | Input/output parameters with types | ✅ | {"id": "user_input", "type": "string"} |
| Nodes | Ordered processing steps | ✅ | [{"id": "llm_1", "type": "LLM"}] |
| Dependencies | Implicit from variable references | Auto-derived | {{llm_1.output}} → dependency |
Variable Types
| Variable Type | Purpose | Scope | Resolution |
|---|---|---|---|
| Flow Variables | Declared parameters with defaults | Flow-level | At flow definition |
| Node Outputs | Generated by node execution | Flow-level | Runtime, sequential |
| Input Variables | Runtime values from execution | Flow-level | At execution start |
| Scoped Variables | Temporary within control flow | Node-level | Within control structures |
Provider Categories
| Provider Type | Services | Capabilities | Integration Pattern |
|---|---|---|---|
| LLM Providers | OpenAI, Anthropic, Grok, Bedrock | Text generation, chat, vision | API key + endpoint |
| Vector Database | Pinecone, Weaviate, Chroma | Embedding CRUD, similarity search | Connection + index |
| Embedding | OpenAI, Nvidia, Microsoft | Text-to-vector conversion | Model selection + API |
| Custom | User-defined APIs | Domain-specific operations | Custom interface implementation |
Execution Model
Concurrency Control
| Aspect | Implementation | Configuration | Behavior |
|---|---|---|---|
| Global Limit | Max concurrent flows system-wide | global_limit: 3 | Queue overflow flows |
| Flow Queue | In-memory FIFO queue | Auto-managed | Wait for available slots |
| Flow Isolation | Separate variable registries | Per-execution context | Prevent cross-flow contamination |
| Flow Identity | Timestamp + execution number | 20240115_143022_001 | Unique tracking identifier |
Node Execution Patterns
| Pattern | Behavior | Failure Handling | Use Cases |
|---|---|---|---|
| Sequential | Nodes execute in dependency order | Stop on first failure | Linear processing pipelines |
| Parallel Branches | Independent execution paths | Continue other branches | Concurrent operations |
| FOR_EACH | Sequential iteration processing | Stop on iteration failure | Batch processing |
| Conditional | Branch based on conditions | Skip false branches | Decision trees |
Variable Resolution
| Aspect | Mechanism | Format | Timing |
|---|---|---|---|
| Resolution | Just-in-time evaluation | {{variable_name}} | Before node execution |
| Registry | Flow-scoped storage | {{node_id.output.property}} | Runtime maintenance |
| Interpolation | Template string replacement | {{llm_1.output.text}} | Dynamic substitution |
| Isolation | Per-execution context | Separate namespaces | Prevent conflicts |
Error and Resource Management
| Management Type | Strategy | Scope | Cleanup |
|---|---|---|---|
| Error Handling | Fail-fast, no automatic retry | Node/Flow level | Immediate termination |
| Temporary Files | Auto-cleanup after completion | Flow execution | Post-execution cleanup |
| Registry State | Clear after completion | Per-execution | Memory management |
| Status Tracking | Real-time execution monitoring | System-wide | Observability support |
Flow Definition Schema
Schema Overview
Every OpenFlow flow MUST conform to the following JSON schema structure. The schema enforces type safety, validates relationships between components, and ensures protocol compliance.
Root Flow Object
FlowVariable Schema
Flow variables define the data interface of the flow:
Supported Data Types
| Type | Description | Examples | Validation |
|---|---|---|---|
string | Text values, template strings | "Hello World", "{{user_input}}" | Length, pattern, format |
number | Numeric values (int/float) | 42, 3.14, -100 | Min/max, range validation |
boolean | True/false values | true, false | Exact match only |
array | Ordered collections | ["a", "b", "c"], [1, 2, 3] | Item type, min/max length |
object | Key-value structures | {"key": "value", "nested": {}} | Property validation |
file | File paths for processing | "/path/to/file.pdf" | Path validation, existence |
null | Explicit null values | null | Null check only |
any | Dynamic typing (use sparingly) | Any valid JSON | Minimal validation |