Core Concepts: Workflows
In ProStream, Workflows are modular processing units that handle specialized object types, orchestrate data preparation, and generate spatial data structures. They form the backbone of the "Prepare Scene" and "Create SubScenes" processes.
What is a Workflow?
Rather than hard-coding a single monolithic pipeline for scene processing, ProStream divides the work into distinct Workflows. A Workflow is responsible for:
- Identifying a specific subset of objects in your scene (e.g., standard prefabs vs physics colliders).
- Generating the appropriate spatial data (like a QuadTree grid).
- Handling the creation and population of SubScenes for those specific objects.
Key Workflow Components
Understanding workflows involves a few key types:
- WorkflowAsset: A
WorkflowAsset, implemented as aScriptableObject, that defines the workflow's configuration (e.g., is it active, what are its grid settings). - WorkflowComponent: A
WorkflowComponent, implemented as aMonoBehavioursingleton in your scene, that executes the runtime logic for the workflow. - WorkflowContainer: A
WorkflowContainerthat owns and manages all activeWorkflowComponents. - WorkflowAssetContainer: A
WorkflowAssetContainerthat finds and tracks all activeWorkflowAssetsin your project.
Built-in Workflows
ProStream currently includes two primary workflows for scene generation:
1. InstanceObjectsWorkflow
This is the default, primary workflow for ProStream.
- It handles standard Unity Prefab instances.
- It is responsible for creating the main spatial QuadTree.
- It organizes visual geometry, props, and environment assets into streaming sections (Ground, LargeObjects, etc.).
See the InstanceObjects Workflow guide for the full Prepare Scene and Create SubScenes flow.
2. ColliderObjectsWorkflow
The ColliderObjectsWorkflow creates separate collider-focused scene data for GameObject physics workflows.
Key Technical Benefits:
- Separate physics scene data: Lets you generate dedicated collider scenes alongside your visual Entity SubScenes.
- Dynamic spatial organization: Uses its own QuadTree data and can build grouped collider proxies for dense scenes.
INFO
Although ColliderObjects is documented alongside other workflows, the normal user-facing way to turn it on is through the Collider modification. The workflow settings still live in the Workflows system, but the extraction behavior is tied to that modification.
See the ColliderObjects Workflow guide for the full activation path and process breakdown.
Process Overview
The diagram below shows where the two current workflows share the same pipeline, where ColliderObjects branches through the collider modification path, and where both results contribute to the final streamed scene output.
Process Flow Diagram
Workflow Lifecycle
Workflows follow a strict lifecycle integrated deeply into the SceneConnector.
- Discovery: When the scene is loaded, the
SceneConnectorqueries theWorkflowAssetContainerto find all active and enabledWorkflowAssetsin the project. - Activation: The
SceneConnectoradds these assets to its internal list. - Instantiation: For every active workflow, the
WorkflowContainercreates a childGameObjectin the scene hierarchy and attaches the correspondingWorkflowComponent. - Execution: During the Prepare Scene and Create SubScenes operations, the
ProcessRunneriterates through all activeWorkflowComponentsand executes their respective stages (Initialize,Execute,Cleanup).
How Workflows tie into the Main Processes
When you click Prepare Scene (Calculate Positions):
- Phase 1: Every active workflow is asked to validate its data (
CheckWorkflowObjects()). - Phase 4: Every active workflow executes its spatial calculations (e.g., generating the QuadTree grid and assigning objects to cells).
When you click Create SubScenes:
- The process loops through all active workflows, running them through an
Initialize->Execute->Cleanuppipeline to physically generate the.unityscene files on disk and organize the objects within them.
