gensphere

7. Execution

Executing workflows in GenSphere is straightforward using the GenFlow class. This section explains how to execute your workflow and handle outputs.

7.1 Setting Up the Environment

Ensure that:

7.2 Executing the Workflow

Use the GenFlow class to execute your workflow.

Example:

from gensphere.genflow import GenFlow

flow = GenFlow(
    yaml_file='combined.yaml',
    functions_filepath='functions.py',
    structured_output_schema_filepath='schemas.py'
)
flow.parse_yaml()
flow.run()

7.3 Accessing Outputs

After execution, outputs from each node are accessible via the outputs attribute.

Example:

# Access all outputs
outputs = flow.outputs

# Access specific node outputs
data_collection_output = outputs.get('data_collection').get('collected_data')

# Print the outputs
print("Collected Data:")
print(data_collection_output)

7.4 Handling Exceptions

If an error occurs during execution:

7.5 Logging

GenSphere uses Python’s logging module to log execution details.

7.6 Execution Flow

The execution order of nodes is determined by their dependencies: