Manufacturing and Production Quickstart
Get started with Stateset One to streamline your manufacturing operations.
Manufacturing and Production Quickstart Guide
Welcome to the Stateset One Manufacturing and Production Quickstart Guide! This guide will walk you through setting up your environment and using Stateset to manage your entire manufacturing process, from Bills of Materials (BOMs) to production execution and inventory management. Let’s imagine we are a mid-sized manufacturer looking to improve efficiency and reduce costs. By the end of this guide you will understand how to use Stateset to help us achieve these goals.
Table of Contents
- Introduction
- Getting Started
- Core Concepts
- API Walkthrough: End-to-End Manufacturing Workflow
- Manufacturing Process Optimization
- Real-Time Monitoring and Integration
- Error Handling and Logging
- Troubleshooting and Maintenance
- Support Resources
- Conclusion
Introduction
Stateset One provides a robust API for managing manufacturing and production operations. This guide will help you set up your environment, understand core concepts, use the API to handle workflows, implement optimization strategies and handle errors effectively.
What You’ll Learn:
- How to set up your Stateset environment and use the SDK.
- Core manufacturing concepts like BOMs, Work Orders, and Manufacturing Orders.
- How to use the Stateset API to manage your production process from start to finish.
- Strategies for optimizing your manufacturing workflow with data-driven decisions.
- How to handle errors gracefully and integrate with other systems.
Getting Started
Let’s get your environment ready.
1. Sign Up for Stateset One
- Visit stateset.io/signup and create a new account.
2. Generate an API Key
- After signing in, go to the Stateset Cloud Console to generate a new API key. This key will authenticate your API requests.
3. Install the Stateset Node.js SDK
Integrate Stateset’s SDK into your project to simplify API interactions.
Using npm:
Using yarn:
4. Set Up Environment Variables
Store your API key securely using environment variables. (Note: This example is for bash shell, adapt as needed for your environment)
5. Initialize the Stateset Client
Initialize the Stateset client in your application using the generated API key. (Note: Requires Node.js 16 or higher)
Note: The above example uses async/await
which requires a Javascript engine that supports it.
Core Concepts
Before we start using the API, let’s get a handle on some key manufacturing concepts. Understanding these terms will make working with the API much clearer. Here is a simplified diagram to help visualize the key concepts:
-
Product: The end item you are producing, whether it is a final product ready for sale or a subassembly.
-
Bill of Materials (BOM): A structured list of all the raw materials, components, and assemblies required to manufacture a specific product. It’s essentially a recipe for your product. Think of it as the ingredients list for your product.
-
Work Order: A document that authorizes the production of a specific quantity of a product. It specifies the product to be produced, quantity and the associated BOM.
-
Manufacturing Order: Derived from a Work Order, the Manufacturing Order tracks the actual progress of production. It includes information about when production starts, what resources are used (machines, personnel), and materials consumed. It’s where you track the production process.
-
Picks: The process of selecting and preparing the necessary components from inventory for production. This process is tracked to make sure the correct items are used and ensures traceability.
-
Cycle Counts: Regular inventory audits, done periodically. This is used to verify that the inventory data is accurate.
-
Waste & Scrap: Tracking materials that are lost due to defects, errors, or other production issues. This is vital to understanding production efficiency and reducing losses.
-
Machines: The equipment used to produce your items. Tracking machine usage and maintenance is key to optimal operations.
-
Maintenance: Scheduled or ad-hoc tasks performed on machinery to prevent failures and ensure reliability.
-
Kitting: The process of creating a kit of components that are gathered together to assemble in a manufacturing step. This can make the production process more efficient.
-
Inventory: Tracking the components you have in stock. Accurate inventory data is necessary for effective production planning.
These concepts form the backbone of the manufacturing process and are key to understanding how the Stateset API helps manage it.
API Walkthrough: End-to-End Manufacturing Workflow
Now that we have a foundational understanding of core concepts, let’s walk through the process of using the Stateset API in a real-world scenario.
Workflow 1: Creating Products & BOMs
First, let’s define a product and its Bill of Materials.
Example 1: Creating a Product
This creates a product named Advanced Widget
which you can then use in BOMs.
Example 2: Creating a BOM
This code creates a new BOM for our “Advanced Widget” product, specifying the component items (identified by item_id
) and their quantities. In this example we are using the product.id
from the previous step to associate the BOM with the product.
Workflow 2: Planning Production
Now that we have a BOM, we can plan our production.
Example 1: Creating a Work Order
This code creates a Work Order for our “Advanced Widget,” associated with the BOM created previously using the bom.id
. This signifies that we plan to manufacture 100 of item 001 and 50 of item 002.
Workflow 3: Executing Production
With our Work Order created, let’s begin the actual manufacturing process.
Example 1: Creating a Manufacturing Order
This creates a Manufacturing Order based on the Work Order. In our example, the Manufacturing Order copies the work_order_line_items
from the Work Order for reference. This signifies the start of production.
Example 2: Creating a Pick
Now that production has started, you’ll need to pick the materials.
This code initiates a new pick task to gather required inventory items inv_001
and inv_002
needed for production.
Example 3: Completing a Pick
Once a pick is complete, you can update it.
This shows how to mark the pick as completed and specify the quantities that were actually picked. In this case we are assuming all items were picked and match the original requested quantities.
Example 4: Tracking Machine Time
During production you’ll want to track how long machines are being used.
This example shows how to log the machine usage for a specific Manufacturing Order. Replace 'machine_001'
with the actual ID of your machine
Example 5: Tracking Waste
If waste occurs during production, you can track that as well.
This code logs 2 units of inv_001
as scrap due to a quality control rejection.
Example 6: Completing a Manufacturing Order
Finally when production is done, the Manufacturing Order can be completed.
This marks the Manufacturing Order as complete and closes the production loop.
Workflow 4: Inventory Management
Regular inventory checks are needed to maintain accurate data.
Example 1: Performing a Cycle Count
This example shows how to schedule a cycle count for a set of items and location. This is a regular process to confirm inventory.
Manufacturing Process Optimization
Optimizing your manufacturing processes is key to reducing waste, minimizing costs, and improving efficiency. Stateset gives you the data needed to implement optimization strategies. Here are some key techniques:
- Just-in-Time (JIT) Manufacturing: Optimize inventory levels to reduce waste and ensure timely delivery of raw materials.
- Overall Equipment Effectiveness (OEE): Track machine uptime, performance, and quality to identify areas for improvement.
- Pick Route Optimization: Calculate optimal routes for pickers in the warehouse to reduce the time it takes to complete picks.
- Predictive Maintenance: Analyze machine runtime data to predict and prevent potential failures.
- Waste Reduction: Use insights from waste and scrap data to improve processes and reduce losses.
Here’s an example of how you might calculate OEE with data from the Stateset API.
This snippet uses placeholder values but demonstrates how to calculate the Overall Equipment Effectiveness of a Manufacturing Order with the API data. You will want to expand on the gathering of the data to make sure your values are accurate.
Real-Time Monitoring and Integration
Real-time monitoring is key to ensuring that manufacturing operations are running smoothly and to identify areas for improvement. Stateset uses a combination of REST, GraphQL, and webhooks to provide updates on your systems.
Webhooks:
Webhooks are automated messages that are sent when something happens in Stateset. This enables you to get immediate feedback on system events without having to constantly request updates. When an event occurs, Stateset will notify an endpoint you’ve configured. You could use webhooks to track changes in order status, inventory levels, or new maintenance requests.
Examples of How to use Real-time Data and Integration
- BI Dashboard Integration: Connect Stateset with a Business Intelligence tool to build a dashboard for production metrics, waste analysis, machine status, and more. This allows managers and decision-makers to have a comprehensive view of operations.
- ERP Integration: Connect to your Enterprise Resource Planning (ERP) to automatically update inventory levels and supply chain data in response to manufacturing orders. This ensures the systems stay aligned.
Error Handling and Logging
Robust error handling and logging are necessary for stable operations. Here are some best practices:
-
API Error Responses: The Stateset API returns descriptive error messages. Always inspect the response when errors occur and handle the errors accordingly (e.g. bad request, missing fields, invalid keys, etc). Consult the API documentation for a full list of the error codes.
-
Retry Logic: Implement a retry mechanism for transient errors like network issues.
-
Centralized Logging: Send logs to a centralized logging service to assist with debugging and monitoring of the system.
In this example, we wrap the API call in a try/catch
to catch any errors and add additional logging.
Troubleshooting and Maintenance
Here are some solutions for common issues and suggestions for maintaining your systems:
-
API Connection Failures:
- Solution: Verify your API key is correct and active, check your internet connectivity, and verify the API endpoint is correct.
-
Data Inconsistencies:
- Solution: Use regular cycle counts to verify inventory accuracy, ensure all processes are followed. Verify all API calls respond as expected.
-
Machine Downtime:
- Solution: Implement a predictive maintenance schedule using data from the Stateset API (such as machine runtime).
-
Slow Performance:
- Solution: Use the API to monitor your data, identify slow operations, make database and query optimization adjustments as needed.
-
SDK Updates:
- Action: Regularly update your Stateset SDK to take advantage of the latest improvements. Be sure to review the change logs for potential compatibility issues.
-
Data Backups:
- Action: Set up regular backups to prevent data loss.
Support Resources
If you encounter any issues, here are the resources to help:
- API Documentation: docs.stateset.com/api
- Community Forum: community.stateset.io
- Support Email: support@stateset.io
- Tutorial Videos: learn.stateset.io
Conclusion
By working through this quickstart guide, you should now have a better understanding of how to use the Stateset API to manage your manufacturing processes. You’ve learned how to set up your environment, plan your production, execute manufacturing orders, optimize processes, handle errors, integrate with other systems and maintain the health of your system. By following these steps, you can improve the efficiency and reduce the costs of your manufacturing process. For any additional help, please make sure to utilize the support resources.