---
title: "What's in the Artifact"
description: "What an Artifact bundle contains, which objects can produce one, and how to run it outside Corridor."
---
TL;DR
An Artifact is a self-contained bundle that Corridor generates for a registered object. It packs the object's full logic together with every dependency it needs, so you can run it in your own environment without connecting back to Corridor. Available for a Data Element, Feature, Model, or Policy.
## What is it?
An Artifact is a bundle of documents and ready-to-run scripts that Corridor builds for a registered object. Any object you register - a Data Element, Feature, Model, or Policy - can be exported as an Artifact and run somewhere else entirely.
The idea is simple: the Artifact takes the logic you built inside Corridor and hands it to you as a standalone package. It runs on its own, in an isolated test environment or in production, with no live connection to Corridor.
An Artifact is built to:
- **Carry the full logic** - so the object you registered in Corridor can run outside it.
- **Be self-sufficient** - everything the object needs is packed inside the bundle.
- **Stay lightweight** - it leans on the runtime environment as little as possible.
## Which objects can produce an Artifact?
You can export an Artifact for any of these four objects:
- Data Element
- Feature
- Model
- Policy
An Artifact can be exported at any stage - draft, pending approval, approved, or rejected. When the object is still in progress, Corridor builds the bundle on the spot at export time. Once the object is **Approved**, Corridor keeps a finalized bundle ready, and that is the one you download.
## What's inside an Artifact
At its heart, an Artifact exposes a Python function you can call to run the whole object end to end - starting from your input tables and producing the final result. Alongside that logic, the bundle carries the metadata and version details needed to reproduce the object's behavior exactly.
A bundle broadly contains:
File
What it holds
metadata.json
Information about the object in the bundle - its inputs, version, group, permissible purpose, and other registered details.
input_info.json
The input tables and columns the object expects, so you know exactly what to feed the main() function.
python_dict/
The Python-dictionary version of the logic, for low-latency runs. Contains the runnable code (__init__.py) and a versions.json listing the library versions used.
pyspark_dataframe/
The PySpark version of the same logic, for running on large data. Also contains __init__.py and its own versions.json.
Because the Artifact pins the exact versions of every dependency it was built with, a production run stays reproducible - what you approved is exactly what runs.
## How to run an Artifact
The Artifact ships with two ways to run the same logic. Both expose a `main()` function - you pick the one that fits your data and environment:
- **`python_dict`** - for low-latency runs. You send data as a Python dictionary. Best for scoring one record or a small batch quickly.
- **`pyspark_dataframe`** - for large data. You send data as a Spark DataFrame. Best for running over big tables at scale.
Whichever you use, the call is the same. You pass your input tables to `main()`, and it returns two things: the output data and an errors callback.
```python
out_data, out_errs = main(in_data, runtime_params={})
errors = out_errs() # call the callback to get any runtime errors
result = out_data['final_data']
```
:::note[Two ways to import]
After you unpack the bundle, you can either run from inside the engine folder (`cd` into `python_dict/`, then `from __init__ import main`), or add the bundle folder to your path and import the folder as a package (`from python_dict import main`). The examples below use the second style.
:::
The keys in `in_data` are the input table references (for example, `data_table_8`). You will find the exact references your object expects in the bundle's `input_info.json`.
### Running with a Python dictionary
Send each input table as a dictionary of columns, where every column carries its `type` and `values`.
```python
import sys
sys.path.insert(0, 'policy_2.15/') # the bundle folder, named