Adding lineage through the OpenMetadata API and Python SDK

How to push lineage from custom pipelines and tools into OpenMetadata with the REST API or Python SDK, export it to other systems, and verify it. Covers options, setup, security and limits to confirm.

On this page

Adding lineage through the OpenMetadata API and Python SDK: when your pipelines need it

When your in-house pipelines or custom tools move data that no connector can see, lineage in OpenMetadata has gaps. Programmatic lineage through the REST API or the Python SDK fills those gaps by letting your own code declare which tables, columns, dashboards, pipelines or metrics feed one another. OpenMetadata supports table, column, dashboard, pipeline and metric lineage, and it also accepts lineage events through its OpenLineage integration, so a job that already emits OpenLineage events may need less custom code than you expect.

Teams usually choose this path when the source of truth is a process the connectors cannot read: a homegrown transformation service, a file-based hand-off, a scheduler without a supported connector, or a sequence of scripts that only run in one environment. The lineage editor suits a small number of manual corrections, while a connector suits systems OpenMetadata already parses. Programmatic lineage suits the middle ground, where the same pipeline runs on every release and its edges should be reviewed and versioned like any other code. Confirm which of your tools already emit OpenLineage events before writing new integrations.

OpenMetadata documents programmatic access through REST APIs, a Python SDK, TypeScript packages and Java libraries, so your platform team can choose the language that matches the pipeline code. Before you build, decide who owns each lineage edge, which service names your code will reference, and how the job will delete or update edges when a pipeline is retired. Check the OpenMetadata documentation for the SDK version that matches your server, because API behavior can change between releases.

Which programmatic route fits your pipelines

The Python SDK suits teams whose pipelines already run as Python code, such as scheduled scripts, transformation jobs or custom ingestion tasks. Lineage calls are added next to the code that reads and writes the data, so the engineers who own the job also own the lineage edge. The SDK is one of the programmatic options OpenMetadata documents, alongside REST APIs, TypeScript packages and Java libraries. The team that builds it is usually the data engineering team that owns the pipeline, and they maintain it through every change to that pipeline.

  • Build owner: the team that writes and deploys the job maintains the lineage calls, so changes to sources or targets need a matching lineage update.
  • Version pinning: confirm which SDK version matches your OpenMetadata server version and pin it in the job's dependencies.
  • Entity identifiers: the calls reference fully qualified names of tables and columns, so confirm the service, database and schema names exactly as ingestion created them.
  • Granularity: decide whether the job records table-level edges only or column mappings too, and confirm the job can supply that detail reliably.
  • Failure handling: decide whether a lineage call failure should fail the pipeline run or only log a warning.

Before the build, check that every job's output tables already exist in the catalog under the names the job will use.

How lineage edges connect table and pipeline entities

Lineage in OpenMetadata is a set of edges between entities that already exist in the catalog. A table, a column, a pipeline or a dashboard must be ingested or created first, and each lineage request only links two of them. Before writing any code, decide which entity types your in-house pipelines and custom tools will connect, and confirm in the OpenMetadata lineage documentation which entity types the lineage API accepts as sources and targets and how it expects each one to be referenced. Edges are stored against the entities themselves, so a push that names an entity that does not exist will fail rather than create it.

The reference an edge uses is the fully qualified name, which is built from the service, database, schema and table names as they were ingested. A table ingested by a warehouse connector under one service name and referenced by your script under another will not match, even when both point at the same physical object. This is the most common failure in programmatic lineage. Cross-connector edges, such as a custom job that reads a table from a warehouse ingested by one connector and writes to a lake table ingested by another, work only when both sides resolve to the same stable names. Agree on service names and casing with the teams that own each connector before the first push, and record them in one place that your code reads from.

Test the identifiers before scaling the push. Retrieve each entity through the catalog API or SDK using the exact name your code will send, and confirm it returns the expected entity. Run the push against a non-production instance with one edge per entity type, then check the lineage view in the user interface. Ask your OpenMetadata administrator whether the account used by your code has permission to read both entities and create lineage, because a missing read permission can look like a missing entity. Keep a record of every name mapping so that a later connector rename does not silently break edges you created by hand.

How a custom job's lineage reaches OpenMetadata and other systems

The flow starts in a custom pipeline or internal tool inside the client's network, which calls the Python SDK or REST API. Those calls authenticate to the OpenMetadata server, which writes lineage edges between tables, columns, dashboards and pipelines in the metadata store. An export path reads the lineage back out for other systems. Check the hand-off at the trust boundary: the service account's permissions, the token source, and which entities the edges point to.

Lineage written by custom jobs, and exported to other systems, crosses one trust boundary.

Set up programmatic lineage in six checks

This sequence takes a team from a running OpenMetadata deployment to a verified lineage edge pushed by code. Each step ends with a check, so a failure is caught before lineage from in-house pipelines reaches production metadata.

  1. Confirm the deployment and server version

    The platform team confirms which OpenMetadata version runs in the organization's own infrastructure, whether on Kubernetes, bare metal or Docker for a trial, and records the exact server version from the admin interface or the deployment. Check the release notes for the version in use, since the 2.0 line includes breaking changes that affect ingestion images and credentials. The step is done when the team has a written version number that the SDK install will match.

  2. Create a dedicated service identity

    An administrator creates a bot or service identity used only by the lineage job, rather than reusing a personal account or an admin token. Grant it the narrowest permissions the security documentation describes for writing lineage to the relevant services, and avoid broad administrative roles. Because OpenMetadata does not support combining SSO with basic authentication, confirm how the service identity will authenticate and store its token in your secrets manager. The check is a test call from the job's environment that succeeds for the lineage write and fails for an out-of-scope action.

  3. Install the SDK matched to the server

    The engineer installs the Python SDK package whose version matches the OpenMetadata server, in a pinned virtual environment used by the lineage job. Mismatched client and server versions are a common source of failed requests and changed payload shapes, so the pin should follow the server version recorded in the first step. The check is a short script that imports the SDK, connects to the non-production server with the service identity, and prints the server version it reports.

  4. Map fully qualified names for both assets

    The engineer writes down the fully qualified name of every source and target table, column or pipeline the job will link, exactly as the catalog stores them after ingestion. Names include the service, database and schema segments, so a table ingested under a different service name will not match even when the table looks the same. Compare the mapping against the catalog for each asset and record any asset that is missing because its connector has not run yet. The check is a lookup for every name in the mapping that returns the expected entity.

  5. Push a test edge in a non-production instance

    The engineer creates one lineage edge between two known test assets in a non-production OpenMetadata instance, using the lineage operation in the SDK with the mapped names. Keep the first run to a single edge so that any payload or permission error is easy to isolate and reverse. Record the request, the response identifier and any warning the server returns. The check is a successful response with the edge identifier, and a second identical call that does not create a duplicate.

  6. Verify the edge in the UI and by read-back

    The engineer confirms the edge appears on the lineage view of both assets in the user interface, then reads it back through the API for the same asset and compares the upstream and downstream entries with the intended direction. A reversed edge or an edge attached to a similarly named asset means the mapping in step four needs correction before any production run. Once the read-back matches, the team can expand the job to more pipelines and schedule it under change control. The check is a matching edge in both the interface and the API response.

Security and operating controls for lineage writes

Every lineage edge pushed through the API or SDK changes what owners, auditors and impact analyses see. The controls below cover who holds write access, where credentials live, how writes are traced, and how changes to lineage get reviewed before they become trusted.

Scope the service token

Create a dedicated service identity for lineage jobs with write permission only on the services and entities those jobs touch. Avoid reusing an administrator token or a personal token. Because OpenMetadata does not allow SSO and basic authentication to be combined, decide the authentication mechanism for the whole deployment first, and confirm which token types and bot accounts the chosen option supports in the security documentation.

Security docs

Keep credentials out of job code

Do not place the OpenMetadata token in repositories, DAG files, notebooks or container images. Inject it at runtime from the secrets store your organization already operates, and rotate it on a schedule your security team sets. Confirm how your scheduler exposes secrets to the job, since logs and error traces can leak values if a job prints its configuration.

Audit who writes lineage

Record which job, identity and run wrote each edge, so a suspicious or wrong edge can be traced back to its source. Keep your job runners' logs and the identity used for each write together in your central log system. Check whether the OpenMetadata version you run exposes the change history you need for this, and test it with a deliberate write before relying on it.

Review automated edges for accuracy

Lineage pushed from a script reflects the script's understanding of the data flow, not the database's. Sample a set of edges each release, compare them with the actual queries or pipeline definitions, and flag edges that point at the wrong table or column. Assign a named owner to each lineage source so a reviewer knows who to ask when an edge looks wrong.

Put lineage jobs under change control

A job that rewrites lineage can remove or replace edges that other teams depend on. Treat lineage jobs like production code: versioned in source control, peer reviewed, tested against a non-production OpenMetadata instance, and deployed through a documented change process. Define whether a job should add edges only or also delete edges it no longer sees, because deletion is the riskier behavior.

Set the trust model for many writers

When many teams can push edges, the catalog becomes only as reliable as its least careful writer. Decide which teams may write to which domains, who approves a new source of lineage, and how conflicting edges from two sources are resolved. Document this model before opening write access broadly, since changing it later means revisiting every token already issued.

Limits to confirm in your environment before you build

Which OpenMetadata entity types accept lineage edges written through the API?

Confirm this for your exact OpenMetadata version before you design the script, because the set of entities that accept programmatic lineage edges can differ between releases. Check the lineage section of the API reference for the version you run, then create one edge of each type you need in a test environment and read it back through the UI and the API. Record which combinations succeed, which fail silently, and which return an error. Only build against the entity pairs you have proven, and keep that list with the pipeline code so the next upgrade review knows what to retest.

Can column-level lineage be written by API for the connectors you use?

Confirm this per connector and per version, since column-level lineage in OpenMetadata comes from several sources, including query parsing and the Lineage Agent, and not every source behaves the same way when lineage is written by API. Write one column-level edge for a table pair that your connectors already populate, then check whether the API edge merges cleanly with the ingested edge or creates a duplicate. Also confirm how the column names must be formatted, including fully qualified names and case sensitivity, because a mismatch usually produces an edge that looks correct but points at nothing.

What happens to lineage edges when a job reruns?

Confirm that repeated runs of the same job update existing edges instead of adding duplicates. Run your script twice against the same test tables, then compare the lineage graph and the stored edges after each run. Check whether the edge identifiers depend on the entity IDs, which can change if a table is dropped and recreated, and whether a rerun after a partial failure leaves half-written edges behind. Idempotency is the property you need to test first, because a nightly job that duplicates edges will degrade the graph quickly and is hard to clean up later.

How are deleted sources and stale lineage edges handled?

Confirm how the server treats an edge whose source job no longer exists or whose table has been removed. Ask three questions in your test environment: does deleting an entity also delete its manual or API-written lineage, does a script removing a dependency delete the edge it created, and does ingestion from a connector overwrite or preserve edges that were written by hand. Document the answers and decide who owns cleanup. Without an explicit owner for each edge, stale lineage accumulates and impact analysis starts pointing at tables that no longer feed anything.

Are there rate limits or payload size limits for lineage requests?

Confirm the request limits in your deployment, since the documentation you need is version-specific and your reverse proxy, API gateway or ingress controller may impose its own body size and timeout settings. Test a batch of your largest expected job graph in one request and in several smaller requests, and note any timeouts, HTTP 413 responses or partial writes. Check whether your organization's gateway, load balancer or Kubernetes ingress adds limits on top of the server defaults, and set your batch size from the measured results rather than from assumptions.

Which SDK version works with which OpenMetadata server version?

Confirm compatibility before pinning versions in your pipeline image. The Python SDK, the REST API and the server are released together but are installed separately, so a mismatch can break authentication, serialization or entity lookups without an obvious error. Pin the SDK to the same release line as the server in a test environment, run the lineage script end to end, and record the pair in your configuration. Repeat the check whenever either side is upgraded, including maintenance releases in the 2.0 line.

How do OpenMetadata 2.0 breaking changes affect existing lineage scripts?

Review the 2.0 release notes against every script that calls the API or SDK, because breaking changes can affect code that never touched the changed areas. The release notes list breaking changes including a new Databricks auth format, a new llmConfiguration block for embedding credentials, rebuilt custom ingestion images for Python 3.12 and a required Great Expectations migration to 1.3 before upgrading. Check whether your lineage scripts depend on any of those areas, rerun them against a 2.0 test instance, and compare the results with your pre-upgrade output before the production cutover.

Who should confirm these limits, and how long does it take?

Your data platform team should own the confirmation, with a security reviewer for service account scope and an owner of the upstream job for each lineage source. The effort depends on how many entity types, connectors and job patterns you need to prove, how many environments you maintain and whether you have a non-production OpenMetadata instance on the same version as production. Ask any implementation partner to list these checks as separate line items in the written scope, so you can see what is included, what you verify yourself and what recurs with each upgrade.

Exporting lineage to other systems and what to confirm

Teams export lineage out of OpenMetadata for three main reasons: governance reporting that lives in a separate GRC or risk tool, impact reviews run in a ticketing or change-management system, and audit files that must be retained outside the catalog. The export design decides what those consumers can trust. The two common patterns are reading lineage through the API on a schedule and storing dated snapshots, and consuming change events so downstream systems update only when an edge is added or removed. Snapshots are simpler to audit because each file records what the catalog said on a given day. Event consumption is more responsive but needs a receiver that handles retries, ordering and gaps. Choose one pattern per consumer and document it.

The export is only as accurate as the edges in the catalog. Lineage that the query parser missed, that a connector did not extract, or that was added by hand and never revisited will be exported with the same confidence as verified edges. Before a snapshot is treated as evidence, record which edges were created by ingestion, by the parser, by the OpenLineage integration, by the SDK or by a person, because each source has different reliability. Tie the export to the same owner and review process used for manual lineage edits so that stale edges are removed rather than carried forward in every file.

Confirm the endpoints, field names and response shapes against the exact OpenMetadata release you run, not against examples copied from documentation for another version. OpenMetadata 2.0 introduced breaking changes, so an export script written for 1.x may fail or silently miss fields. Ask your platform team to pin the release, run the export against a non-production instance after each upgrade, and compare record counts with a known lineage graph. Also confirm the service account's read permissions on every service the export touches, since a missing permission can produce a partial graph without an error. Log the release version alongside every exported file so an auditor can later tie the output to the software that produced it.

How much effort does programmatic lineage take, and what does it need from us?

What drives the effort of programmatic lineage in OpenMetadata?

The main drivers are the number of pipelines and tools that emit lineage, how consistently entities are named across systems, the languages and frameworks those tools use, and how much governance review each edge needs before it goes live. A team with a few well-defined ETL jobs can work through them in a short sequence. A company with dozens of in-house tools, free-text table names and no agreed owner for each edge will spend most of its effort on naming and review rather than on code. Ask any partner to break the quote down by these four drivers so you can see which ones you can reduce internally before the work starts.

Can an internal team add lineage through the OpenMetadata API alone?

Yes, if the team knows the OpenMetadata entity model (services, databases, tables, columns, pipelines and their fully qualified names) and is comfortable writing Python. The REST API, the Python SDK and the lineage concepts are documented, so a platform or data engineering team can build a first pipeline push, test it in a non-production instance and then extend it. Teams that lack that entity knowledge, or that need lineage from many languages at once, often bring in outside help for the design and first release, then keep the work in-house. Confirm your team's skills against the documented scope before deciding.

What does the work need from our side?

Expect to provide four things: a non-production OpenMetadata environment where pushes can be tested safely, service accounts with the narrowest permissions that allow the lineage writes, a list of the pipelines and tools in scope with their current owners, and a named owner for every lineage edge or group of edges. The owner decides whether an edge is correct, who is notified when it breaks, and who approves changes. Without named owners, lineage tends to decay as pipelines change, so this input matters as much as the code.

Is a partner worth it for a fixed-scope lineage project?

A partner is worth considering when the scope is clear enough to write down and the internal team lacks time or experience with the entity model or the SDK. DeployOpen works on fixed-scope engagements where scope, deliverables and timelines are agreed in writing before work starts, and it hands over the code, documentation and runbooks so your team can operate the result. Weigh that against the cost of your own engineers' time and the risk of lineage that is built once and then left to drift. Ask for a quote that lists the pipelines in scope, the test and handover steps, and what is excluded.

What determines how long the first release takes?

The timeline depends on the number of pipelines in scope, how much of the entity naming must be cleaned up first, whether the target OpenMetadata instance and service accounts already exist, and how many review cycles the owners require. Access requests and change approvals in your own organization often take longer than the coding. Confirm your access and approval lead times early, because they are usually the least predictable part of the plan. Any duration you are given should trace back to a written scope and these inputs rather than a general estimate.

How does ongoing maintenance of programmatic lineage work after the first release?

Lineage code needs upkeep whenever a source pipeline, table name, schema or OpenMetadata version changes. Plan for a regular review of failed pushes, a check of new or renamed entities, and testing of the lineage jobs against each OpenMetadata upgrade, since upgrades can include breaking changes. Recurring work is usually small when owners are named and pushes are monitored, and larger when they are not. Ongoing support, upgrades and continuous testing can be covered by a retainer, and the cost should be stated in the same written scope.

How DeployOpen scopes and delivers programmatic lineage

Programmatic lineage work usually fails on scope, not code: which pipelines count, who owns each edge, and how the jobs keep running after handover. The cards below follow the order DeployOpen uses on a fixed-scope engagement, from a written scope to optional retainer support.

Written scope before any code

Each engagement starts with a written scope that names the source systems, the pipelines or tools that will push lineage, the OpenMetadata environment, and the deliverables. Ask for the scope to state which entities are in and out, such as tables, dashboards, pipelines and custom tools, and which lineage direction each job will write. The written scope is the basis for the quote, so a change in scope should be recorded as a change to that document.

Inventory of pipelines and lineage gaps

Before writing jobs, DeployOpen inventories the in-house pipelines and custom tools that move data, then compares them with lineage OpenMetadata already receives from its connectors and OpenLineage events. The output is a gap list showing which edges are missing, which are duplicated and which entities do not yet exist in the catalog. Check that the inventory names an owner for each pipeline, because owner data decides who can correct an edge later.

Build of SDK and API jobs in your infrastructure

Lineage jobs are built to run where your pipelines run, using the Python SDK or REST API, with credentials held in your secrets store rather than in code. Agree on how each job authenticates to OpenMetadata, given that the product does not support combining SSO and basic authentication at once. Confirm the target environment, the job scheduler and the change process before the first job is deployed.

Verification against the live catalog

Each job is verified by reading the lineage back from the catalog and comparing it with the inventory, including upstream and downstream direction, entity matches and behavior when a job is re-run. Test a deliberate failure, such as a renamed table, to see whether the edge is updated, duplicated or removed. Ask for the verification results to be delivered with the jobs, not as a separate summary.

Handover documentation for your team

The handover package describes each job, its schedule, its credentials, the entities it writes, and the steps to add a new pipeline or retire an old one. It also records the known limits, such as lineage the job cannot infer from a source system. Ask whether the documentation will be kept in your repository so your engineers can maintain it after the engagement ends.

Optional retainer for upgrades and changes

After handover, a retainer can cover upgrades to the SDK, changes to the OpenMetadata API and fixes when a pipeline changes shape. The current release line is 2.0.0 and it includes breaking changes, so an upgrade plan should be part of any retainer discussion. DeployOpen does not publish a price list. A quote follows from the written scope, so ask for the retainer terms and what is included before committing.

2.0 release notes

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.