Skip to main content
Material costs typically account for 50-70% of total manufacturing cost. Even small variances — an extra kilogram of resin per batch, a substitution at a higher unit price, or a scrap rate that creeps up by half a percent — add up fast across hundreds of production runs. Most teams only catch these during monthly cost reviews, long after the opportunity to intervene has passed. This use case connects your ERP and inventory data to a Wayak agent that compares actual material consumption against BOM standards. A weekly playbook uses Python to calculate quantity and price variances for every material, flag the largest deviations, and deliver a report your procurement and production teams can act on immediately.

What you need

Data sources

  • ERP system — Bills of materials (BOMs) with standard quantities, material issue transactions, and standard cost records
  • Inventory management system — Current stock levels, material receipts with actual unit prices, and lot tracking data

Knowledge spaces

  • BOM standards documentation — Upload your standard BOM definitions and approved material substitution lists
  • Procurement policies — Price variance thresholds and approved vendor lists for reference
Semantic layer: Define these in your ontology before setting up the agent.
ComponentNameDefinition
ObjectMaterial IssueMaps to ERP material issue transactions. Represents a single material withdrawal against a work order
ObjectBOM LineMaps to the bill of materials detail table. Represents the planned quantity of a material for one unit of finished good
MetricQuantity VarianceActual quantity consumed minus standard quantity (from BOM), per work order or batch
MetricPrice Variance(Actual unit price minus standard unit price) multiplied by actual quantity consumed
DimensionMaterial TypeGroups materials by category: raw materials, packaging, consumables, components
DimensionSupplierGroups material issues by the vendor who supplied the material lot
See building a semantic layer for a step-by-step guide.

Agent setup

1

Create the agent

Go to Agent Space > New agent.
FieldValue
NameMaterial Variance Analyst
RoleMaterial cost and usage analyst
GoalIdentify material consumption variances and pricing discrepancies
2

Set the description

You are a material cost analyst. When analyzing material usage, always separate quantity variance from price variance — they have different root causes and different owners. Present the largest dollar-impact variances first. For quantity variances, check whether a material substitution was made. For price variances, compare against the approved vendor price list. Use specific numbers: show the standard quantity, actual quantity, and difference. When variance exceeds 5% of standard cost, recommend an investigation and specify whether it is a production issue (quantity) or procurement issue (price).
3

Scope data access

Grant access to:
  • ERP system data source (BOMs, material issue transactions, standard costs)
  • Inventory management system data source (receipts and pricing)
  • BOM standards documentation knowledge space
  • Procurement policies knowledge space
  • Material Issue and BOM Line objects in the semantic layer
4

Add skills

Trigger: User asks about material variance, waste, or BOM compliance
  1. Identify the work order, product, or material from the user’s request.
  2. Pull the BOM standard quantities for the finished good.
  3. Pull the actual material issue transactions for the specified work orders.
  4. Calculate quantity variance for each material line: actual quantity minus standard quantity.
  5. Calculate price variance for each material: (actual price minus standard price) multiplied by actual quantity.
  6. Sort by total dollar impact, largest first.
  7. Present a table with material name, standard quantity, actual quantity, quantity variance, standard price, actual price, and price variance.
Trigger: User asks about substitutions or unexpected materials
  1. Pull all material issue transactions for the specified work orders.
  2. Compare issued material item numbers against the BOM’s specified item numbers.
  3. Identify any material issued that does not appear on the BOM (potential substitution).
  4. Check the substitution against the approved substitution list in the knowledge space.
  5. Flag unapproved substitutions and include the cost difference versus the standard material.

Automation

Playbook: Weekly material variance report

1

Set the trigger

Schedule the playbook to run every Monday at 7:00 AM.
2

Build the workflow

The playbook compiles the previous week’s material consumption against BOM standards and highlights the largest variances.
  1. Query step — Pull all material issue transactions for work orders completed in the previous 7 days, along with corresponding BOM lines.
  2. Python code step — Calculate quantity variance and price variance for every material-work order combination. Aggregate to material level and rank by total dollar impact.
  3. Condition step — Filter to materials where total variance exceeds 5% of standard cost or $500 in absolute terms.
  4. Format step — Build a report with two sections: top quantity variances (for production review) and top price variances (for procurement review).
The Python code step uses a Python code block to compute both quantity and price variances, aggregate them by material, and rank by dollar impact. You can customize the variance thresholds and add trend calculations comparing to the previous week.
3

Configure delivery

Send the full report via email to the production manager and procurement lead. Include the total variance dollar amount in the subject line.
4

Test and activate

Click Run now to test with live data, then toggle to Active.

What’s next

Work order cost tracking

Monitor overall production order costs and catch overruns before they escalate.

All manufacturing use cases

See the full list.