Interface IPipelineSchema<Payload>

IPipelineSchema

Defines the schema for a pipeline, including execution logic and optional callbacks.

interface IPipelineSchema<Payload extends object = any> {
    callbacks?: Partial<IPipelineCallbacks<Payload>>;
    execute: <T = any>(
        clientId: string,
        agentName: string,
        payload: Payload,
    ) => Promise<void | T>;
    pipelineName: string;
}

Type Parameters

  • Payload extends object = any

    Type extending object for the pipeline payload.

Properties

callbacks?: Partial<IPipelineCallbacks<Payload>>

Optional callbacks for pipeline lifecycle events.

execute: <T = any>(
    clientId: string,
    agentName: string,
    payload: Payload,
) => Promise<void | T>

Type declaration

    • <T = any>(
          clientId: string,
          agentName: string,
          payload: Payload,
      ): Promise<void | T>
    • Type Parameters

      • T = any

        Type of the execution result.

      Parameters

      • clientId: string

        The client identifier.

      • agentName: string

        The name of the agent executing the pipeline.

      • payload: Payload

        The payload data for the pipeline.

      Returns Promise<void | T>

      The result of the pipeline execution.

Function to execute the pipeline logic.

pipelineName: string

The name of the pipeline.