Appearance
Data Flow & Transformations
Overview
The Workflow Engine enables seamless data communication between models built in different programming languages. Understanding how data flows between tasks helps you design effective workflows.
Why Data Flow Matters
Real-world workflows often combine specialist models built by different teams in different languages. A Python demand forecaster's output needs to become a Julia simulator's input, which feeds a Go optimiser. The Workflow Engine handles this automatically - data flows between models regardless of their implementation language.
Core Principle
Data moves automatically between tasks without custom integration code. You define what tasks need and what they produce. The system handles the rest.
Transfer Mechanisms
The system uses different transfer mechanisms optimised for different scenarios:
File-Based Transfer
Used for large datasets and complex structures. Tasks write output files to shared locations, and downstream tasks read from those locations.
Best for:
- Large simulation results
- Multi-dimensional arrays
- Complex nested structures
- When multiple downstream tasks need the same data
Cache-Based Transfer
Used for smaller data and workflow coordination. Data is stored in fast memory for instant access.
Best for:
- Small to medium datasets
- Workflow state and coordination
- Frequently reused results
- Performance-critical paths
Direct Transfer
Used when invoking containerized models. Input is sent directly in the request, output returned in the response.
Best for:
- Small input/output payloads
- Real-time inference
- Stateless operations
The system automatically selects the most efficient mechanism based on data size and workflow structure.
Cross-Language Interoperability
The Universal Contract
Every model follows a standard three-type pattern:
- Input: Data the model receives
- Parametres: Configuration that controls behaviour
- Output: Data the model produces
This contract is language-agnostic. A Julia model can consume a Python model's output seamlessly.
Multi-Language Pipeline Example
Consider a workflow combining:
- Python Preprocessor: Cleans raw data
- Julia Simulator: Runs high-performance simulation
- Go Analyser: Visualises results
The system handles data flow automatically:
- Python writes output in its native format
- System transforms it to Julia-compatible format
- Julia processes and produces results
- System transforms to Go-compatible format
- Go receives and renders data
No team needs to coordinate data formats or write integration code.
Data Transformation
When Automatic Matching Isn't Enough
Sometimes you need explicit transformation:
- Unit conversion (miles to kilometres)
- Data reshaping (pivoting, aggregating)
- Filtering or sampling
- Format conversion
Use operator tasks for custom transformations:
Task A → operator (transform) → Task BThe operator reads A's output, performs transformations, and produces input for B.
Common Transformation Patterns
Merge Multiple Sources:
Task A ──┐
├→ operator (merge) → Task C
Task B ──┘Split Into Multiple Paths:
┌→ Task B
Task A → operator ──┤
└→ Task CFilter and Sample:
Task A → operator (filter) → Task BCaching for Performance
How Caching Works
Tasks can be configured to cache results. Before execution, the system:
- Computes a cache key from input data and parametres
- Checks if results exist for that key
- If cached: Skips execution, uses cached results
- If not cached: Executes normally, caches results
When to Use Caching
Good candidates:
- Expensive computations (long-running simulations)
- Stable preprocessing steps
- Tasks with many dependent downstream tasks
Avoid caching:
- Non-deterministic models (results vary for same inputs)
- Real-time data sources (always want fresh data)
- Tasks with external side effects
Benefits
- Faster iteration: Changing one task doesn't re-run unchanged tasks
- Cost savings: Expensive computations run only once for identical inputs
- Reproducibility: Same inputs produce same outputs (or use cached results)
Connecting to External Systems
Data Import: Bringing Data In
Data Import tasks bring data from external databases or APIs into workflows:
- Query external data sources
- Transform responses into workflow-friendly formats
- Provide data to downstream tasks
Example: Load rail network topology from an operational database before running capacity simulation.
Data Export: Sending Data Out
Data Export tasks push workflow results to external systems:
- Format results for external APIs
- Update operational databases
- Trigger downstream processes
Example: Export optimised schedules to a fleet management system for execution.
Performance Considerations
Parallel Execution
Independent tasks execute in parallel automatically:
- Tasks with no dependencies run concurrently
- Reduces overall workflow execution time
- Maximises resource utilisation
Transfer Optimisation
The system selects transfer mechanisms based on:
- Data size (small → cache, large → files)
- Number of consumers (multiple → shared files)
- Performance requirements (latency-sensitive → cache)
Resource Management
- Task outputs are stored efficiently
- Temporary data is cleaned up automatically
- Storage usage is monitored
See Also
- Workflow Execution Manager - How workflows are orchestrated
- Data Schema - Understanding workflow structure
- Architecture - Overall Workflow Engine architecture
