OpenLineage Jobs, Runs, and Datasets Explained

Updated on
10 min read

OpenLineage is an open event model for describing how data jobs use and produce datasets. Data engineers and platform teams can use it to connect pipeline activity across schedulers, processing engines, and storage systems without requiring every tool to share the same internal metadata database. This explainer covers the job, run, and dataset model, how events form lineage, and how to emit a small event from Python.

Why OpenLineage Is Being Discussed

Data platforms commonly combine an orchestrator, a stream processor, a warehouse, and object storage. Each system can report its own job status, but those local views do not always show which upstream datasets affected a table or which downstream products may be affected by a failed transformation. As pipelines cross tool boundaries, incident response and governance need a common way to describe the work and its data dependencies.

OpenLineage gives those systems a shared vocabulary and event format. Its project overview describes an open framework for collecting lineage metadata about datasets, jobs, and runs. Instead of asking every producer to understand every catalog or observability product, integrations can emit compatible events for a backend that builds a broader view.

This is useful for tracing a batch load from source to report, understanding how a schema change travels through dependent jobs, or comparing what a pipeline declared with what it actually read and wrote. OpenLineage reports metadata; it does not run the pipeline or guarantee data quality.

What Is OpenLineage?

OpenLineage is an open specification and collection of clients and integrations for capturing data lineage. Its central model has three entities:

  • A Job describes a defined unit of work, such as a scheduled task, SQL model, or streaming application.
  • A Run is one particular execution of that job.
  • A Dataset is a discrete collection of data, such as a database table, object-store path, or stream.

Events describe changes to these entities or observations about a job run. For example, a run event can say that a transformation started, read raw.orders, and wrote analytics.daily_orders. A backend can connect that observation to other events and build a graph of jobs and datasets.

The OpenLineage object model defines these entities, their identifiers, event types, and extensible metadata called facets. A lineage backend can use the shared structure to combine observations from different tools, even though each tool may discover its own metadata differently. Producers and backends still need compatible versions and sensible identifiers for that interoperability to work.

The Problem OpenLineage Solves

Without shared lineage events, teams often infer dependencies from scheduler configuration, SQL text, logs, or the names of tables. These clues can be incomplete. A job may read several inputs dynamically, create outputs with parameterized names, or run in a system whose metadata is not visible to the warehouse catalog. Static documentation can also describe intended dependencies without recording what happened during a specific execution.

That gap makes common questions expensive to answer: Which run last wrote this dataset? What did it read? Which jobs consume a table that is about to change? Did the failing run use the same schema or code revision as the successful run before it?

OpenLineage provides a structured record of jobs, runs, datasets, and their relationships. Events can include metadata such as source-code location, SQL, schema, ownership, or data quality metrics through facets. A backend can then present those details together rather than requiring operators to search each producer independently.

The specification is not a replacement for a data catalog, scheduler, access-control system, or data-quality test suite. A catalog helps users discover and govern assets; an orchestrator schedules work; a lineage event records what a producer knows about the work and data. A deployment often uses these systems together.

How OpenLineage Works

An emitting integration observes a job and sends events to a compatible backend. Each event identifies its producer and schema, the job namespace and name, the run ID when the event concerns a run, and any relevant input or output datasets. The backend ingests the event and associates the identifiers with prior observations.

Imagine a pipeline that reads warehouse.raw.orders, standardizes the records, and writes warehouse.analytics.daily_orders. The scheduler identifies a job such as orders.daily_rollup; an execution creates a unique run ID. A start event can identify the job and run, while a later event reports the input and output datasets. The resulting edges are raw.orders → orders.daily_rollup → daily_orders. Another job’s events can extend the graph downstream.

The model distinguishes runtime observations from design-time metadata:

Event type Describes Associated with a run? Typical use
RunEvent A job execution and its state, with observed inputs and outputs Yes Record a run starting, completing, or failing
JobEvent A job’s static metadata, such as declared inputs, outputs, or documentation No Publish job metadata from a compiler or metadata extractor
DatasetEvent Metadata about a dataset, such as schema, ownership, or documentation No Publish dataset details without waiting for a job run

These are different observations, not three names for the same event. A JobEvent can describe intended or statically discovered dependencies, while a RunEvent can provide details from an actual execution. A DatasetEvent updates the dataset’s own metadata outside a run. Backends can combine these forms, but should preserve the distinction between declared information and runtime evidence.

Run events use state values such as START, RUNNING, COMPLETE, ABORT, FAIL, and OTHER. For a finite batch task, a typical lifecycle starts with START and ends with one terminal state. The run-cycle documentation also describes streaming and service jobs, which may emit periodic observations instead of a simple start-to-completion sequence. Events from one run may be accumulative, while long-running processes can report complete snapshots for specific windows.

Key Concepts and Components

Namespaces and names identify jobs and datasets within a context. A job’s namespace might identify the scheduler installation, while a dataset’s namespace might identify a warehouse or object store. The pair should be stable and unique within that context; using a path or name that changes unpredictably makes graph construction less useful.

Run IDs distinguish executions of the same job. A producer creates a unique run ID and reuses it for the events belonging to that execution. A retry or later scheduled execution should not reuse the previous run’s ID.

Facets are extensible metadata attached to jobs, runs, or datasets. Standard facets describe concepts such as a dataset schema, source-code location, or run error; custom facets can carry tool-specific details. Facets are schema-versioned and include producer information, so consumers can interpret extensions without assuming every producer emits the same set.

Producers and schema URLs identify where an event came from and which event schema it follows. They help a consumer validate and interpret the payload. OpenLineage transports are separate from the event model: deployments can choose an HTTP, Kafka, file, or other supported transport rather than requiring one universal backend.

The model has conceptual similarities to provenance standards, but it is not identical to them. The W3C PROV Data Model defines a domain-agnostic model of entities, activities, and agents. OpenLineage focuses on operational events and identifiers for data jobs and datasets. They address related provenance problems at different levels; a PROV model should not be assumed to be a drop-in OpenLineage event payload.

Real-World Uses

Incident investigation: A backend can show the run that produced a table, the inputs it reported, and whether it completed or failed. Operators can narrow a search to the responsible producer and execution instead of relying only on timestamps and table names.

Impact analysis: If a dataset’s schema or contents are changing, connected job and dataset observations help identify downstream consumers. This is most effective when all important producers emit events and use stable identifiers.

Governance and reproducibility: Ownership, schema, source-code location, or version facets can add context to a lineage graph. For table snapshots and storage metadata, see Apache Iceberg’s table format and snapshot model; OpenLineage can describe the job relationships around such data, but does not replace the table format’s transaction history.

Streaming operations: Stream processors can periodically report which datasets they use and how a run is progressing. Checkpoints answer a different recovery question: Apache Flink checkpoint barriers describe how Flink restores processing state and input positions, while lineage events help explain data dependencies across the wider pipeline.

Getting Started: Emit a Lineage Event

The OpenLineage Python client can create events and send them through a configured transport. For a local exercise, use the official Python client usage guide to start the Marquez reference backend, then install the client in a virtual environment:

python -m venv .venv

Activate it with source .venv/bin/activate on macOS or Linux, or .\.venv\Scripts\Activate.ps1 in Windows PowerShell, then install the package:

python -m pip install openlineage-python

Create openlineage.yml in the working directory to configure the local HTTP endpoint:

transport:
  type: http
  url: http://localhost:5000

Save this as emit_lineage.py. It emits a start and completion event for one run, using the same run ID and reporting the source and output datasets on completion:

from datetime import datetime, timezone

from openlineage.client import OpenLineageClient
from openlineage.client.event_v2 import Dataset, Job, Run, RunEvent, RunState
from openlineage.client.uuid import generate_new_uuid

client = OpenLineageClient()
producer = "https://example.org/orders-pipeline"
job = Job(namespace="example-warehouse", name="orders.daily_rollup")
run = Run(runId=str(generate_new_uuid()))
source = Dataset(namespace="warehouse", name="raw.orders")
output = Dataset(namespace="warehouse", name="analytics.daily_orders")

client.emit(
    RunEvent(
        eventType=RunState.START,
        eventTime=datetime.now(timezone.utc).isoformat(),
        run=run,
        job=job,
        producer=producer,
    )
)

client.emit(
    RunEvent(
        eventType=RunState.COMPLETE,
        eventTime=datetime.now(timezone.utc).isoformat(),
        run=run,
        job=job,
        producer=producer,
        inputs=[source],
        outputs=[output],
    )
)

Run python emit_lineage.py, then inspect the local Marquez UI at http://localhost:3000. Confirm that the job, run, and datasets appear and that the graph connects the source to the output through the job. The Apache Airflow OpenLineage provider documentation covers an integration for Airflow-managed pipelines; configure its transport and namespace for the actual deployment.

For production, choose a transport and backend deliberately, protect the endpoint with appropriate authentication, and avoid attaching secrets or sensitive row-level data as facets. Validate schema and event volume, decide which jobs should emit metadata, and test that retries preserve a run ID only for the same execution. Missing instrumentation or inconsistent dataset names produces an incomplete graph even when events are syntactically valid.

Common Misconceptions

“OpenLineage runs or schedules the pipeline.”

It describes metadata emitted by a producer. A scheduler or processing engine still executes the work, and a backend stores or presents the emitted events.

“A lineage event proves the data is correct.”

An event can report inputs, outputs, and quality metrics, but it does not independently verify them. Use data tests and monitoring to check correctness; lineage helps connect those results to jobs and datasets.

“Every run has the same start-and-finish lifecycle.”

Batch tasks commonly use start and terminal events. Continuous stream processors and services may emit observations periodically and have no normal completion event. Consumers should interpret events in the context of the job’s processing model.

“OpenLineage is a universal catalog or a formal W3C data model.”

It is an open specification focused on lineage events and integrations. Catalogs and broader provenance models can complement it, but their metadata structures and responsibilities are not interchangeable.

Changelog and Last Updated

  • Changelog: Initial publication.
  • Last updated: Reviewed against the OpenLineage object model, run-cycle, Python client, and Airflow provider documentation.
TBO Editorial

About the Author

TBO Editorial writes about the latest updates about products and services related to Technology, Business, Finance & Lifestyle. Do get in touch if you want to share any useful article with our community.