7.5 KiB
EmboFlow Workflow Execution Model
Goal
Define how EmboFlow represents, validates, executes, and observes canvas workflows.
The workflow system is the product core. The canvas is only the editing surface. The real system of record is the versioned workflow definition and its immutable run snapshots.
Core Objects
WorkflowDefinitionLogical workflow identity under a projectWorkflowVersionImmutable snapshot of nodes, edges, runtime defaults, and plugin referencesNodeInstanceConcrete node on a workflow graphWorkflowRunOne execution of one workflow versionRunTaskExecutable unit derived from a node during one runArtifactManaged output from a task or run
Workflow Layers
Each workflow version contains three layers.
Visual Layer
Used only by the editor:
- node positions
- collapsed state
- groups
- zoom defaults
- viewport metadata
Logic Layer
Used for graph semantics:
- nodes
- edges
- input/output ports
- branch conditions
- merge semantics
- dependency graph
Runtime Layer
Used for execution:
- node config values
- executor settings
- runtime resource limits
- retry policy
- code hooks
- cache policy
Visual changes must not change workflow semantics. Runtime changes must produce a new workflow version.
The current V1 editor implementation keeps a mutable local draft that is initialized from the latest saved workflow version. Saving the draft creates a new immutable workflow version. Triggering a run from a dirty draft first saves a fresh workflow version, then creates the run from that saved snapshot.
Node Categories
V1 node categories:
SourceTransformInspectAnnotateExportUtility
V1 Built-In Node Families
- asset upload/import
- archive extract
- folder rename
- directory validation
- metadata validation
- video quality inspection
- dataset readers for RLDS, LeRobot, HDF5, Rosbag
- canonical mapping nodes
- dataset writers and exporters
- training config export
- Python processing node
Node Definition Contract
Each node definition must expose:
idnamecategoryversiondescriptioninputSchemaoutputSchemaconfigSchemauiSchemaexecutorTyperuntimeDefaultspermissionscapabilitiescodeHookSpec
Code Hook Spec
V1 supports user code hooks only on:
TransformInspectUtility
Hooks must use a constrained entrypoint instead of arbitrary script structure.
Example:
def process(input_data, context):
return input_data
This keeps serialization, logging, and runtime control predictable.
Data Flow Contract
Tasks should exchange managed references, not loose file paths.
V1 reference types:
assetRefdatasetVersionRefartifactRefannotationTaskRefinlineConfig
Executors may materialize files internally, but the platform-level contract must remain reference-based.
Validation Stages
Workflow execution must validate in this order:
- workflow version exists
- referenced plugins exist and are enabled
- node schemas are valid
- edge connections are schema-compatible
- runtime configuration is complete
- referenced assets and datasets are accessible
- code hooks pass static validation
- executor and scheduler requirements are satisfiable
Validation failure must block run creation.
Run Lifecycle
When a user executes a workflow:
- resolve workflow version
- snapshot all runtime-relevant inputs
- resolve plugin versions
- freeze node config and code hooks
- compile graph into a DAG
- create
WorkflowRun - create
RunTaskentries - enqueue ready tasks
- collect outputs, logs, and task state
- finalize run status and summary
Run State Model
WorkflowRun Status
pendingqueuedrunningsuccessfailedcancelledpartial_success
RunTask Status
pendingqueuedrunningsuccessfailedcancelledskipped
partial_success is used for workflows where non-blocking nodes fail but the run still produces valid outputs.
Retry And Failure Policy
Each node instance may define:
- retry count
- retry backoff policy
- fail-fast behavior
- continue-on-error behavior
- manual retry eligibility
V1 should support:
fail_fastcontinue_on_errorretry_n_timesmanual_retry
Cache Model
V1 should support node-level cache reuse.
Recommended cache key inputs:
- workflow version
- node id
- upstream reference summary
- config summary
- code hook digest
Current V1 Runtime Notes
- The React workflow editor now loads the latest persisted version from the Mongo-backed API instead of rendering only a fixed starter graph.
- Draft edits are local editor state until the user saves, at which point the draft is serialized into a new workflow version document.
- The API runtime now has direct HTTP integration coverage against a real Mongo runtime through
mongodb-memory-server, in addition to the older in-memory contract tests. - plugin version
- executor version
Cache hit behavior:
- reuse output artifact refs
- reuse output summaries
- retain previous logs reference
- mark task as cache-resolved in metadata
Execution Context
Each task receives a normalized execution context containing:
- workspace id
- project id
- workflow run id
- task id
- actor id
- node config
- code hook content
- input references
- storage context
- temp working directory
- runtime resource limits
This context must be available across Python, Docker, and HTTP executors.
Observability Requirements
Each task must emit:
- status transitions
- start time and finish time
- duration
- executor metadata
- resource request metadata
- stdout/stderr log stream
- structured task summary
- artifact refs
Current V1 Implementation Notes
The current codebase keeps the low-level contract tests in memory while the executable local runtime persists workflow state to MongoDB.
The persisted local runtime now covers:
- workspace and project bootstrap
- asset registration and probe reporting
- workflow definition and immutable version snapshots
- workflow runs and task creation
- artifact registration and producer lookup
The first web authoring surface already follows the three-pane layout contract with:
- left node library
- center workflow canvas
- right node configuration panel
The first explore surface currently includes built-in renderers for:
- JSON artifacts
- directory artifacts
- video artifacts
The UI must allow:
- graph-level run status
- node-level log inspection
- node-level artifact browsing
- task retry entrypoint
- direct navigation from a node to preview output
Canvas Interaction Rules
V1 editor behavior should enforce:
- port-level connection rules
- incompatible edge blocking
- dirty-state detection
- explicit save before publish/run if graph changed
- per-node validation badges
- run from latest saved version, not unsaved draft
Example V1 Pipelines
Delivery Normalization
Raw Folder Import
-> Archive Extract
-> Folder Rename
-> Directory Validation
-> Metadata Validation
-> Video Quality Check
-> Delivery Export
Dataset Conversion
Rosbag Reader
-> Canonical Mapping
-> Frame Filter
-> Metadata Normalize
-> LeRobot Writer
-> Training Config Export
V1 Non-Goals
The V1 workflow engine does not need:
- loop semantics
- streaming execution
- unbounded dynamic fan-out
- event-driven triggers
- advanced distributed DAG partitioning
The V1 goal is a stable, observable DAG executor for data engineering workflows.