Skip to main content
Production cost overruns often go undetected until month-end close, when it is too late to correct the root cause. A single material pricing error or unplanned labor hour can cascade across dozens of work orders. By the time finance flags it, you have already shipped the product at a loss. This use case connects your ERP work order data to a Wayak agent that calculates cost variance in real time and a playbook that scans for overruns every morning. You get alerts the same day a variance appears, not weeks later.

What you need

Data sources

  • ERP system (SAP, Oracle, or similar) — Work order headers with planned costs, posted cost transactions (labor, material, overhead), and BOM details
  • General ledger — Cost center postings for overhead allocation validation

Knowledge spaces

  • Cost accounting procedures — Upload your standard costing methodology and variance investigation guidelines
  • Work order templates — Reference documents for standard cost structures by product type
Semantic layer: Define these in your ontology before setting up the agent.
ComponentNameDefinition
ObjectWork OrderMaps to the ERP work order header table. Represents a single production order with planned and actual costs
ObjectCost TransactionMaps to posted cost line items. Represents individual labor, material, or overhead charges against a work order
MetricCost VarianceActual total cost minus estimated total cost, expressed in currency and as a percentage
MetricVariance by CategoryCost variance broken down by labor, material, and overhead components
DimensionProduct TypeCategorizes work orders by finished good type (assembly, fabrication, packaging)
DimensionCost CenterGroups transactions by the responsible department or production area
See building a semantic layer for a step-by-step guide.

Agent setup

1

Create the agent

Go to Agent Space > New agent.
FieldValue
NameProduction Cost Monitor
RoleProduction order analyst
GoalSurface cost overruns and variance issues before they escalate
2

Set the description

You are a production cost analyst. Monitor work orders and flag any where actual costs deviate significantly from estimates. Lead with the numbers — show the variance first, then explain the likely cause. Use direct, factual language. When a variance exceeds 10%, always recommend a specific next step (review labor entries, check material pricing, audit overhead allocation). Do not speculate about root causes you cannot verify from the data.
3

Scope data access

Grant access to:
  • ERP system data source (work order and cost transaction tables)
  • General ledger data source (cost center postings)
  • Cost accounting procedures knowledge space
  • Work Order and Cost Transaction objects in the semantic layer
4

Add skills

Trigger: User asks about production cost variance or work order costs
  1. Identify the work order number from the user’s request.
  2. Pull the estimated cost from the work order header, including planned labor, planned materials, and planned overhead.
  3. Pull the actual cost by summing all posted transactions against the work order.
  4. Calculate the total variance as actual cost minus estimated cost.
  5. Break the variance into labor, material, and overhead categories.
  6. If the total variance exceeds 10%, flag it and list the top three contributing line items.
  7. Present results in a table with estimated, actual, and variance columns for each cost category.
Trigger: User asks to compare costs across work orders or product types
  1. Identify the product type or date range from the user’s request.
  2. Pull all completed work orders matching the criteria.
  3. Calculate the average cost variance percentage for each product type.
  4. Rank product types from highest to lowest average variance.
  5. Highlight any product type with an average variance above 5%.
  6. Present a summary table with order count, average estimated cost, average actual cost, and average variance.

Automation

Playbook: Daily cost variance alert

1

Set the trigger

Schedule the playbook to run every weekday at 6:00 AM, before the morning production meeting.
2

Build the workflow

The playbook queries all work orders with transactions posted in the last 24 hours, calculates the variance for each, and filters for any exceeding the 10% threshold.
  1. Query step — Pull all work orders with new cost postings since yesterday.
  2. Python code step — Calculate variance percentage for each work order and categorize by labor, material, and overhead.
  3. Condition step — Filter to only work orders where total variance exceeds 10%.
  4. Format step — Build a summary table with work order number, product, estimated cost, actual cost, variance amount, and variance percentage.
The Python code step uses a Python code block to compute variance percentages and categorize overruns by cost type. You can customize the threshold (default 10%) and add additional calculations like rolling averages.
3

Configure delivery

Send the report via email to the production manager and cost accounting team. Include the summary table and a count of flagged work orders in the subject line.
4

Test and activate

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

What’s next

Shift performance reporting

Automate OEE calculations and downtime tracking at the end of every shift.

All manufacturing use cases

See the full list.