API Reference - Pipeline

Core Pipeline Classes

Pipeline

class Pipeline

Base class for defining pipelines that process events in sequence.

Class Attributes:

__signature__: Signature | None

Cached signature for pipeline initialization.

Methods:

start(force_rerun: bool = False)

Starts pipeline execution.

Parameters:

force_rerun (bool) – Whether to force rerun of already executed events

shutdown()

Shuts down the pipeline and cleans up resources.

stop()

Stops pipeline execution.

get_pipeline_tree() Tree

Gets a tree representation of the pipeline structure.

Returns:

Tree object representing pipeline structure

Return type:

Tree

draw_ascii_graph()

Generates ASCII representation of pipeline graph.

draw_graphviz_image(directory='pipeline-graphs')

Generates GraphViz visualization of pipeline.

Parameters:

directory (str) – Output directory for graph images

BatchPipeline

class BatchPipeline

Pipeline class for handling batch processing of events.

Class Attributes:

pipeline_template: Type[Pipeline]

Template pipeline class to use for batch processing.

listen_to_signals: List[str]

List of signals to monitor during batch processing.

Methods:

execute()

Executes batch processing of pipelines.

get_pipeline_template()

Gets the template pipeline class.

Returns:

Pipeline class used as template

Return type:

Type[Pipeline]

PipelineTask

class PipelineTask

Represents a task node in a pipeline execution graph.

Attributes:

event: Type[EventBase] | str

Event class or name to execute.

parent_node: PipelineTask | None

Parent task in execution tree.

on_success_event: PipelineTask | None

Task to execute on success.

on_failure_event: PipelineTask | None

Task to execute on failure.

Properties:

property is_conditional: bool

Whether task has conditional branches.

property is_parallel_execution_node: bool

Whether task is part of parallel execution.

Methods:

get_children() List[PipelineTask]

Gets child task nodes.

get_root() PipelineTask

Gets root task in tree.

get_descriptor(descriptor: int) PipelineTask | None

Gets task associated with descriptor.

Parameters:

descriptor (int) – Descriptor number

Returns:

Associated task if found

Return type:

Optional[PipelineTask]

EventExecutionContext

class EventExecutionContext

Manages execution context for pipeline events.

Attributes:

task_profiles: List[PipelineTask]

Tasks being executed.

pipeline: Pipeline

Pipeline instance being executed.

execution_result: ResultSet

Results of task execution.

state: ExecutionState

Current execution state.

Methods:

dispatch() SwitchTask | None

Dispatches task execution.

Returns:

Task switch request if needed

Return type:

Optional[SwitchTask]

cancel()

Cancels task execution.

execution_failed() bool

Checks if execution failed.

Returns:

True if execution failed

Return type:

bool

execution_success() bool

Checks if execution succeeded.

Returns:

True if execution succeeded

Return type:

bool