---
question: Does deleting a pipeline remove the triples it wrote?
kind: task
via_web: na
via_cli: available
via_python: available
via_api: na
via_config: na
prereq: You need write access to the module's source. Nothing registers a pipeline outside its file, so deleting it is a code change plus a restart.
next:
  - /v2/capabilities/build/knowledge-graph/creating-a-pipeline
  - /v2/capabilities/build/pipelines/monitor-runs
---

> **You are reading the v2.x docs (engine modules). New projects use v3.** [Read this page in v3](/capabilities/build/pipelines/delete-a-pipeline) · [Migrate from 2.x to 3.0](/capabilities/upgrade/migrate-to-3)

# Delete a pipeline

A pipeline exists because its file is in the module's `pipelines/` folder: the module imports the files there at startup, keeps each `Pipeline` subclass defined in it, mounts its `POST /pipelines/<name>` route and, on ABI 3.x in a NATS project, publishes it as the durable workflow `pipeline.<slug>`. Neither `config.yaml` nor the module's `__init__.py` lists it. Delete the file, remove what imports it, and restart the engine.

What goes with it: the class, its agent tools, its route and, on ABI 3.x with NATS, `pipeline.<slug>`. Its past runs stay in System › Jobs until the retention prunes them.

What can still point at it:

- **Agents** that import the class or its `as_tools()` in `New()`. Their import then raises `ModuleNotFoundError`, and the engine fails at startup until you remove it.
- **Module jobs** (ABI 3.x, NATS) or **Dagster assets** (ABI 2.x, 3.x without NATS) whose code imports it. The schedule keeps firing, and each run fails.
- **Callers by name** of `pipeline.items_pipeline`, in any module (ABI 3.x, NATS). The module's own `self.get_workflow(...)` raises `ValueError`: a module that looks it up in `on_initialized` fails to start. `self.engine.get_workflow(module_id, ...)` and `ctx.call(...)` check nothing: their runs stay `QUEUED`, since no module takes them. Nexus answers 404.
- **Tests** that import it (`*_test.py`).

The triples it already wrote stay in the triple store. Deleting the pipeline does not remove them.

## Web UI

Not applicable. Nexus has no screen that deletes a pipeline: it is a file in a module. Use the CLI or Python on this page. On ABI 3.x in a NATS project, after the restart, System › Jobs marks `pipeline.<slug>` as no longer declared by any module, and keeps its past runs.

## CLI

### Find what uses it

```bash
grep -rn "ItemsPipeline\|items_pipeline" src/
```

Every hit outside the pipeline's own file is an import or a call by name to remove: see the Python tab for agents and jobs.

### Remove the file

```bash
git rm src/my_module/pipelines/ItemsPipeline.py
```

Remove its test file too, if it has one (`ItemsPipeline_test.py`).

### Restart and check

Restart the engine, then check that the route is gone (and, on ABI 3.x with NATS, that `pipeline.items_pipeline` is gone from `GET /api/workflows`):

```bash
curl -s http://localhost:9879/openapi.json | jq '.paths | keys | map(select(startswith("/pipelines")))'
```

`items_pipeline` no longer appears. When no pipeline is left, the API has no Pipelines section at all.

## Python

### Remove it from agents

Drop the import and the tools from each agent's `New()`:

```python title="agents/MyAgent.py"
# Remove:
from my_module.pipelines.ItemsPipeline import ItemsPipeline, ItemsPipelineConfiguration
tools += ItemsPipeline(ItemsPipelineConfiguration()).as_tools()
```

### Remove its job

On ABI 3.x with NATS, delete the `@job` or `@workflow` method on `ABIModule` that calls it, or point it at another pipeline. After the restart the schedule is no longer hosted. Past runs stay in the System app until the [retention](/v2/capabilities/build/pipelines/monitor-runs?via=config) prunes them. On ABI 2.x and 3.x without NATS, remove the Dagster asset and its schedule from the module's orchestration.

### Delete the file

Delete `pipelines/ItemsPipeline.py` and its tests, then restart. To keep the file but stop the module from loading it, move it out of `pipelines/`: discovery only looks there.

## REST API

Not applicable. No route deletes a pipeline. Its `POST /pipelines/<name>` route (and, on ABI 3.x with NATS, its `pipeline.<slug>` entry in `/api/workflows`) disappears when the engine restarts without the file.

## Config

Not applicable. No `config.yaml` key lists or disables a single pipeline. `enabled: false` on a module under `modules:` unloads the whole module, all its pipelines, agents and jobs included. On ABI 3.x, `nats.workflows.bridge: false` unpublishes every engine pipeline at once, and keeps the classes.

## Remove its data

To also remove what the pipeline wrote, drop the named graph it inserted into, if nothing else writes there. From Python, `triple_store.drop_graph(URIRef("http://ontology.naas.ai/graph/my_module"))`. Check the graph name in the pipeline's `insert` call before you delete the file.
