Skip to content

No op step

A step that does nothing.

Author

Dimitrij Ray (dimitrij.ray@gdplabs.id)

References

NONE

NoOpStep(name)

Bases: BasePipelineStep

A step that does nothing.

This step is useful when you want to add a step that does not perform any processing. For example, you can use this step to implement a toggle pattern for a certain component.

Example:

pipeline = (
    step_a
    | ConditionalStep(
        name="branch",
        branches={
            "execute": step_b,
            "continue": NoOpStep("no_op")
        },
        condition=lambda x: "execute" if x["should_execute"] else "continue"
    )
    | step_c
)

Attributes:

Name Type Description
name str

A unique identifier for this pipeline step.

Initializes a new pipeline step.

Parameters:

Name Type Description Default
name str

A unique identifier for the pipeline step.

required

execute(state, config) async

Executes this step, which does nothing.

Parameters:

Name Type Description Default
state dict[str, Any]

The current state of the pipeline.

required
config RunnableConfig

Runtime configuration for this step's execution.

required

Returns:

Name Type Description
None None

This step does not modify the pipeline state.