DB - pipeline_steps

abstract

Records each individual agent step within a pipeline run — input/output JSON, status, and duration — providing a detailed trace of the multi-agent reasoning chain.

Table Info

PropertyValue
Table Namepipeline_steps
SQLAlchemy Modelbackend/db/models.py :: PipelineStep
Pydantic Schemabackend/api/routes/pipeline.py
Migration Filealembic/versions/
TimescaleDB HypertableNo
Partition Column

Columns

ColumnSQLAlchemy TypeNullableDefaultDescription
idIntegerNoautoPrimary key
run_idInteger FKNoFK → pipeline_runs.id (CASCADE delete, indexed)
seqIntegerNoStep sequence number within the run (ordered)
step_nameString(50)NoAgent step name (e.g., indicator_agent, trend_agent)
statusString(10)Nook | skip | error
input_jsonTextYesnullJSON input payload to this step
output_jsonTextYesnullJSON output from this step
errorTextYesnullError message if status=error
duration_msIntegerNo0Step execution time in milliseconds

Constraints & Indexes

NameTypeColumnsPurpose
pk_pipeline_stepsPRIMARY KEYidRow uniqueness
idx_pipeline_steps_runINDEXrun_idFast lookup of steps by run
fk_pipeline_steps_runFOREIGN KEYrun_id → pipeline_runs.id CASCADEDelete steps when run deleted

Entity Relationships

SQLAlchemy Model (reference snapshot)

class PipelineStep(Base):
    __tablename__ = "pipeline_steps"
 
    id: Mapped[int] = mapped_column(Integer, primary_key=True)
    run_id: Mapped[int] = mapped_column(
        Integer, ForeignKey("pipeline_runs.id", ondelete="CASCADE"), index=True
    )
    seq: Mapped[int] = mapped_column(Integer)
    step_name: Mapped[str] = mapped_column(String(50))
    status: Mapped[str] = mapped_column(String(10))  # ok | skip | error
    input_json: Mapped[str | None] = mapped_column(Text, nullable=True)
    output_json: Mapped[str | None] = mapped_column(Text, nullable=True)
    error: Mapped[str | None] = mapped_column(Text, nullable=True)
    duration_ms: Mapped[int] = mapped_column(Integer, default=0)
 
    run: Mapped["PipelineRun"] = relationship("PipelineRun", back_populates="steps")
RoleLink
Related TableDB - pipeline_runs
Related TableDB - llm_calls