SDK Reference
Log In
SDK Reference

Run all components in the pipeline

Run all components in the pipeline. It works in the same manner as Link on Jupyter's Run All.

pipeline.execute_all()

Example

from mrx_link.sdk import LinkPipeline
from mrx_link.sdk.utils import create_link_component

# Code cell
code1 = """
x = 1
"""
code2 = """
y = 1
z = 1
"""
code3 = """
print(f"{x + y + z = }")
"""

if __name__ == "__main__":
    # Create pipeline object
    pipeline = LinkPipeline()

    # Create components
    component1 = create_link_component(identifier="111-1", name="test1", code=code1)
    component2 = create_link_component(identifier="111-2", name="test2", code=code2)
    component3 = create_link_component(identifier="222", name="test3", code=code3)

    # Add components to the pipeline
    pipeline.add_component(component=component1)
    pipeline.add_component(component=component2)
    pipeline.add_component(component=component3)

    # Add edges
    pipeline.add_edge(parent_id="111-1", child_id="222")
    pipeline.add_edge(parent_id="111-2", child_id="222")

    # Run the pipeline 
    pipeline.execute_all()

Output

x + y + z = 3