# BOM Import Preflight (`willing_relic/bom-import-preflight`) Actor

Check manufacturing BOM CSVs before ERP import. Find circular assemblies, missing item-master codes, invalid quantities and duplicate component lines. Get a row-level report for up to 10,000 records. No ERP login or automatic data changes.

- **URL**: https://apify.com/willing\_relic/bom-import-preflight.md
- **Developed by:** [RevLab](https://apify.com/willing_relic) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1,000.00 / 1,000 completed preflights

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### What does BOM Import Preflight do?

Find structural problems in a manufacturing bill of materials before you load it into an ERP system. Paste a CSV containing parent items, components and quantities, optionally supply an item master, and receive a report with exact source record numbers. No ERP login, spreadsheet installation or AI subscription is needed.

This is an independent structural checker for manufacturing BOMs. It is not a software dependency/SBOM scanner. It does not change your data or certify that an import will succeed.

### What it checks

- Circular assemblies, including self-references and cycles across multiple levels. The report identifies every edge belonging to a circular group without incorrectly flagging downstream leaf components.
- Parent or component codes absent from an optional supplied item master.
- Missing codes, surrounding whitespace and case-only code differences. Codes are never silently merged or corrected.
- Invalid decimal quantities and nonpositive component consumption.
- Repeated parent/component/UOM combinations, reported as warnings because repeated lines can be intentional.
- Missing or padded UOM values when the optional UOM column is included.

### Input

Use these exact CSV headers: `parent,component,quantity` and optionally `uom`. Preserve leading zeros in item codes. Quantities must be plain decimals without thousands separators or scientific notation. Supply one effective BOM structure; select the relevant revision, date and site before exporting. Revision, routing and other extra columns are rejected so separate versions are not silently combined.

The limit is 10,000 BOM records and 2 MB of CSV text. The optional `itemIds` list accepts up to 20,000 exact codes. Omitting it explicitly skips missing-item checks. An empty supplied list means no codes are valid.

### First run: sample data and your own file

The example input contains both a sample BOM and sample item-master codes: BIKE, FRAME, WHEEL, HUB and BOLT. When using your own BOM, replace those sample codes with your actual item master. Leaving the sample codes in place checks your file against the sample master and can flag valid items as missing.

To skip item-master checks, use the JSON input editor and omit the entire `itemIds` property. Do not use an empty list (`[]`): that means an explicitly empty master, so every supplied code is absent. Check `itemMasterChecked` and the summary coverage before interpreting a result. Do not build a master list from the BOM itself to make missing-reference errors disappear.

Here is a complete JSON input without an item master. The `\n` sequences represent CSV line breaks. Replace the full JSON input, including any existing sample `itemIds` property:

```json
{
  "bomCsv": "parent,component,quantity\n00100,00200,2"
}
```

For this example, expect one BOM record, zero errors, zero warnings and `itemMasterChecked: false`. Missing-item-reference checks are explicitly skipped. This result does not certify ERP compatibility.

To see findings with the supplied example unchanged, expect five BOM records, three errors and zero warnings: circular-assembly findings at records 4 and 5, and a nonpositive quantity at record 6. These are intentional sample defects. A completed sample run is still subject to the $1 completed-preflight price.

For CSV preparation, export one effective revision/date/site, preserve item codes as text, and use `parent,component,quantity` with optional `uom`. Choose the correct source columns yourself; native ERP import templates have not been validated. BOM CSV accepts CSV text, not an XLSX workbook or a file URL.

### Results

The Dataset contains one summary followed by findings. Each finding includes a code, severity, source record number, parent/component codes and an explanation. Record 2 is the first data record after the header, including CSV records containing quoted fields. The complete JSON report is also saved under `REPORT` in Storage.

`no_issues_in_checked_scope` means only that these structural checks found nothing. It does not establish ERP compatibility, correct costs or correct business quantities. No UOM conversion, alternate/revision selection, scrap/byproduct modeling or automatic repair is performed.

### Pricing and support scope

$1 per completed preflight, up to the stated limits, with platform usage included. A report that finds problems is still a completed preflight. Findings do not add charges. Invalid input fails before a completed report and does not trigger the completed-preflight charge. Set your maximum run budget to at least $1. No subscription or manual cleanup service is included.

All processing uses deterministic Python code. Input is processed within the run; no external website, LLM or ERP receives the submitted data from this Actor. Apify stores input/output under the account's platform retention and access settings. Use only files you are authorized to process.

### Example finding

```json
{"kind":"finding","code":"CIRCULAR_ASSEMBLY","severity":"error","row":4,"parent":"WHEEL","component":"HUB","message":"Edge belongs to circular assembly group 1"}
```

### How to use it

1. Export one effective BOM and map its headers to the supported columns.
2. Paste the CSV into BOM CSV in the Input tab. Optionally enter item-master codes.
3. Run the preflight and review summary coverage, errors and warnings in Output.
4. Correct source records in your own process and run again if needed.

The API, scheduling and integrations are available through Apify. The Dataset supports platform exports including JSON, CSV and Excel. Use the Issues tab to report reproducible product defects; custom ERP configuration and data-cleanup services are outside this product.

# Actor input Schema

## `bomCsv` (type: `string`):

One effective manufacturing BOM structure. Exact headers parent,component,quantity and optional uom. Maximum 10,000 records/2 MB.

## `itemIds` (type: `array`):

Exact case-sensitive valid item codes. Omit to skip master-reference checks.

## Actor input object example

```json
{
  "bomCsv": "parent,component,quantity,uom\nBIKE,FRAME,1,EA\nBIKE,WHEEL,2,EA\nWHEEL,HUB,1,EA\nHUB,WHEEL,1,EA\nBIKE,BOLT,0,EA",
  "itemIds": [
    "BIKE",
    "FRAME",
    "WHEEL",
    "HUB",
    "BOLT"
  ]
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "bomCsv": `parent,component,quantity,uom
BIKE,FRAME,1,EA
BIKE,WHEEL,2,EA
WHEEL,HUB,1,EA
HUB,WHEEL,1,EA
BIKE,BOLT,0,EA`,
    "itemIds": [
        "BIKE",
        "FRAME",
        "WHEEL",
        "HUB",
        "BOLT"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("willing_relic/bom-import-preflight").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "bomCsv": """parent,component,quantity,uom
BIKE,FRAME,1,EA
BIKE,WHEEL,2,EA
WHEEL,HUB,1,EA
HUB,WHEEL,1,EA
BIKE,BOLT,0,EA""",
    "itemIds": [
        "BIKE",
        "FRAME",
        "WHEEL",
        "HUB",
        "BOLT",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("willing_relic/bom-import-preflight").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "bomCsv": "parent,component,quantity,uom\\nBIKE,FRAME,1,EA\\nBIKE,WHEEL,2,EA\\nWHEEL,HUB,1,EA\\nHUB,WHEEL,1,EA\\nBIKE,BOLT,0,EA",
  "itemIds": [
    "BIKE",
    "FRAME",
    "WHEEL",
    "HUB",
    "BOLT"
  ]
}' |
apify call willing_relic/bom-import-preflight --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,willing_relic/bom-import-preflight"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/NjhIQOvQkclv9rCKK/builds/9Ugxm3ORjfgZh2iBo/openapi.json
