Skip to content

Proposal: Transaction Protocol for idempotent, auditable agent pipelines #11266

@vystartasv

Description

@vystartasv

Problem

Haystack pipelines lack transaction guarantees. When a step fails mid-execution, there's no standard way to:

  1. Know exactly what completed and what didn't
  2. Resume from failure point (idempotency)
  3. Roll back partial work (compensation)

For production deployments in regulated environments, this is a hard requirement.

Proposed Solution

Transaction Protocol (L7) from Works With Agents (CC BY 4.0): idempotency, rollback, and immutable audit trails.

from haystack import Pipeline
from works_with_agents import TransactionProtocol

pipeline = Pipeline()
pipeline.add_component(embedder, ...)
pipeline.add_component(retriever, ...)
pipeline.add_component(generator, ...)

tx = TransactionProtocol.begin("doc-qna-pipeline")
try:
    result = pipeline.run({"query": "What is GDP?"})
    tx.commit(result)  # Signed, hashed, timestamped
except PipelineError:
    tx.rollback()  # Compensation per component

Provides: idempotency tokens, step-level audit trail, compensation actions, cryptographic signatures for tamper-proof evidence.

Why Haystack: pipeline architecture = natural transaction boundaries. Production users need this. Zero breaking changes — wrapper pattern.

Spec: https://workswithagents.dev/specs/transaction.md
SDK: pip install works-with-agents

Would a PR adding Transaction Protocol support to Haystack be welcome?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions