Orderflow
by @ncreighton
Automate order routing, fulfillment, and inventory management across channels. Use when the user needs real-time order processing, multi-warehouse routing, o...
clawhub install orderflowπ About This Skill
name: Trigger Order Webhooks, Sync with Google Sheets & Send Alerts via Slack description: "Automate order routing, fulfillment, and inventory management across channels. Use when the user needs real-time order processing, multi-warehouse routing, or complex fulfillment workflows for e-commerce operations." version: 1.0.0 homepage: https://github.com/ncreighton/empire-skills metadata: { "openclaw": { "requires": { "env": ["SHOPIFY_API_KEY", "SHOPIFY_API_PASSWORD", "WAREHOUSE_API_TOKEN", "SLACK_WEBHOOK_URL"], "bins": ["curl", "node"] }, "os": ["macos", "linux", "win32"], "files": ["SKILL.md"], "emoji": "π¦" } }
OrderFlow: Intelligent E-Commerce Order Management
Overview
OrderFlow is a production-grade order management automation skill that transforms how online businesses handle fulfillment. Unlike basic trigger-based automation, OrderFlow orchestrates complex order workflows across multiple channels, warehouses, and fulfillment partners in real time.
Why OrderFlow matters:
Key integrations: Shopify, WooCommerce, Slack, Google Sheets, Twilio SMS, SendGrid, Zapier.
Quick Start
Try these example prompts immediately:
Example 1: Route High-Value Orders to Priority Warehouse
Route all orders over $500 to warehouse_east if inventory available,
otherwise warehouse_central. Notify #orders-team in Slack when a VIP
customer order is processed. Log the routing decision to Google Sheets.
Example 2: Auto-Fulfill Based on Inventory Levels
Create a workflow: if product_id=SKU123 has stock > 100 in warehouse_west,
ship from west (2-day delivery). If stock < 100, ship from warehouse_central
(5-day delivery). Notify customer via email based on selected warehouse.
Example 3: Smart Inventory Sync & Low-Stock Alerts
Sync real-time inventory across Shopify, WooCommerce, and internal database
every 15 minutes. If any product drops below 20 units, send SMS alert to
inventory manager and create a PO draft in Google Sheets.
Example 4: Complex Multi-Condition Fulfillment Logic
IF order source = Shopify AND order value > $1000 AND customer location = California
AND warehouse_la stock > 0 THEN route to warehouse_la, include gift receipt,
send priority label via email. Otherwise route to default warehouse and
auto-generate shipping label via ShipStation.
Capabilities
1. Intelligent Order Routing
2. Real-Time Inventory Management
3. Fulfillment Automation
4. Customizable Workflow Engine
5. Exception & Alert Management
6. Real-Time Notifications
7. Reporting & Analytics
Configuration
Environment Variables (Required)
# E-commerce Platform
SHOPIFY_API_KEY=your_key_here
SHOPIFY_API_PASSWORD=your_password_here
SHOPIFY_STORE_URL=yourstore.myshopify.comInventory & Warehouse
WAREHOUSE_API_TOKEN=your_token_here
WAREHOUSE_API_URL=https://warehouse.example.com/apiNotifications
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL
SENDGRID_API_KEY=your_sendgrid_key_here
TWILIO_ACCOUNT_SID=your_twilio_sid
TWILIO_AUTH_TOKEN=your_twilio_tokenShipping & Fulfillment
SHIPSTATION_API_KEY=your_key
SHIPPO_API_TOKEN=your_token
Workflow Configuration (JSON)
Create an orderflow-config.json file in your OrderFlow directory:
{
"routing_rules": [
{
"id": "rule_vip_priority",
"name": "Route VIP orders to priority warehouse",
"conditions": {
"customer_tier": "VIP",
"order_value": { "gte": 500 }
},
"actions": {
"warehouse": "warehouse_priority",
"shipping_speed": "expedited",
"notification": "slack_channel:vip_orders"
}
},
{
"id": "rule_inventory_fallback",
"name": "Fallback routing on stock shortage",
"conditions": {
"primary_warehouse_stock": { "lt": 1 },
"product_category": "electronics"
},
"actions": {
"warehouse": "warehouse_fallback",
"notify_inventory_team": true,
"log_exception": true
}
}
],
"inventory_sync": {
"enabled": true,
"interval_minutes": 15,
"sources": ["shopify", "woocommerce", "custom_api"],
"low_stock_threshold": 20,
"critical_stock_threshold": 5
},
"fulfillment": {
"default_carrier": "usps",
"carrier_selection": "cost_optimized",
"auto_generate_labels": true,
"batch_processing": true,
"batch_size": 50
},
"notifications": {
"slack_enabled": true,
"email_enabled": true,
"sms_enabled": true,
"sms_recipients": ["+1-555-0100"]
}
}
Setup Instructions
1. Install OrderFlow CLI:
npm install -g orderflow-cli
orderflow init
2. Authenticate integrations:
orderflow auth shopify --api-key YOUR_KEY --api-password YOUR_PASSWORD
orderflow auth warehouse --token YOUR_TOKEN
orderflow auth slack --webhook YOUR_WEBHOOK_URL
3. Deploy configuration:
orderflow config:deploy orderflow-config.json
orderflow workflows:activate
4. Test end-to-end:
orderflow test --order-id test_12345
Example Outputs
Order Routing Decision (Slack Notification)
π¦ Order Routed SuccessfullyOrder ID: #ORD-2024-087654
Customer: Acme Corp (VIP)
Total: $2,450.00
Items: 12x Widget Pro, 4x ServicePack
π― Routing Decision:
ββ Primary Warehouse: warehouse_east
ββ Reason: VIP priority + lowest shipping cost ($45 vs $89)
ββ Stock Check: β In stock (47 units available)
ββ Estimated Delivery: Jan 18-20, 2024
ββ Shipping Label: Generated & queued to printer
π¬ Actions Taken:
β Label generated (FedEx 2-Day)
β Inventory reserved (12x SKU123, 4x SKU456)
β Customer notified via email
β Fulfillment team alerted in #fulfillment
Confidence: 98% | Route Score: 9.2/10
Inventory Sync Report (Google Sheets)
| Product | SKU | Warehouse A | Warehouse B | Total | Status | Last Sync | |---------|-----|------------|------------|-------|--------|-----------| | Widget Pro | SKU123 | 47 | 12 | 59 | β Good | 2024-01-16 10:15 AM | | ServicePack | SKU456 | 3 | 28 | 31 | β οΈ Low | 2024-01-16 10:15 AM | | Premium Bundle | SKU789 | 0 | 8 | 8 | π΄ Critical | 2024-01-16 10:15 AM |
Fulfillment Exception Alert (Email)
Subject: β οΈ Fulfillment Exception: Order #ORD-2024-087654High-Priority Issue Detected
Order #ORD-2024-087654 (Acme Corp, $2,450)
Status: EXCEPTION - Inventory Mismatch
Time Detected: Jan 16, 2024, 10:30 AM
Problem:
β’ Ordered quantity: 12x Widget Pro
β’ Available in warehouse_east: 11 units (changed since routing)
β’ Status: PARTIALLY FULFILLABLE
Recommended Actions:
1. Source 1 unit from warehouse_central (in stock, +$12 shipping)
2. Split shipment: 11 from warehouse_east, 1 from warehouse_central
3. Contact customer & offer 10% discount for split delivery
4. Escalate to Ops Manager if not resolved in 2 hours
Action Required: YES | Severity: Medium | Auto-Escalate In: 1h 45m
Tips & Best Practices
1. Master Warehouse Scoring
Design your routing rules to score warehouses based on multiple factors:Use weighted scoring to automatically select the best warehouse, avoiding manual decision-making bottlenecks.
2. Implement Smart Fallback Chains
Define 3-4 fallback warehouses in priority order. When primary warehouse can't fulfill: 1. Try secondary warehouse 2. If unavailable, try tertiary warehouse 3. If all fail, trigger exception workflow (backorder, split shipment, or external 3PL)This prevents order rejections and keeps fulfillment flowing.
3. Set Realistic Inventory Thresholds
4. Automate Low-Touch Workflows
Identify orders that don't require human intervention:Target: 70-80% of orders auto-fulfilled, 20-30% requiring human review.
5. Monitor & Optimize Carrier Performance
Track per-carrier metrics:Rotate carriers quarterly or use dynamic selection based on real-time performance.
6. Integrate with Your Accounting System
Export fulfillment costs to your accounting software (QuickBooks, Xero, NetSuite) to calculate true product margins and identify unprofitable order types.7. Use A/B Testing for Routing Rules
Test two routing strategies on 10% of orders:Measure fulfillment time, shipping cost, and customer satisfaction. Roll out winner to 100% of orders.
Safety & Guardrails
What OrderFlow Will NOT Do
β Not a fraud detection system. OrderFlow does not validate payment legitimacy, detect credit card fraud, or flag suspicious accounts. Integrate with third-party fraud tools (Sift, MaxMind) for that.
β Not a customer communication platform. OrderFlow sends transactional notifications (routing decisions, shipping alerts) but does not handle general customer support, returns/refunds, or dispute resolution. Use Zendesk, Gorgias, or similar for customer service.
β Not a financial forecasting tool. Reporting shows fulfillment costs and metrics but does not predict demand, manage cash flow, or provide business strategy recommendations.
β Not a compliance or tax system. Does not calculate sales tax, VAT, duties, or enforce shipping regulations. Integrate with TaxJar or Vertex for tax compliance.
β Not a data migration tool. Cannot bulk import legacy orders or perform complex data transformations. Use ETL tools (Talend, Stitch) for one-time migrations.
Limitations & Boundaries
Privacy & Security
π‘ Examples
Try these example prompts immediately:
Example 1: Route High-Value Orders to Priority Warehouse
Route all orders over $500 to warehouse_east if inventory available,
otherwise warehouse_central. Notify #orders-team in Slack when a VIP
customer order is processed. Log the routing decision to Google Sheets.
Example 2: Auto-Fulfill Based on Inventory Levels
Create a workflow: if product_id=SKU123 has stock > 100 in warehouse_west,
ship from west (2-day delivery). If stock < 100, ship from warehouse_central
(5-day delivery). Notify customer via email based on selected warehouse.
Example 3: Smart Inventory Sync & Low-Stock Alerts
Sync real-time inventory across Shopify, WooCommerce, and internal database
every 15 minutes. If any product drops below 20 units, send SMS alert to
inventory manager and create a PO draft in Google Sheets.
Example 4: Complex Multi-Condition Fulfillment Logic
IF order source = Shopify AND order value > $1000 AND customer location = California
AND warehouse_la stock > 0 THEN route to warehouse_la, include gift receipt,
send priority label via email. Otherwise route to default warehouse and
auto-generate shipping label via ShipStation.
βοΈ Configuration
Environment Variables (Required)
# E-commerce Platform
SHOPIFY_API_KEY=your_key_here
SHOPIFY_API_PASSWORD=your_password_here
SHOPIFY_STORE_URL=yourstore.myshopify.comInventory & Warehouse
WAREHOUSE_API_TOKEN=your_token_here
WAREHOUSE_API_URL=https://warehouse.example.com/apiNotifications
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL
SENDGRID_API_KEY=your_sendgrid_key_here
TWILIO_ACCOUNT_SID=your_twilio_sid
TWILIO_AUTH_TOKEN=your_twilio_tokenShipping & Fulfillment
SHIPSTATION_API_KEY=your_key
SHIPPO_API_TOKEN=your_token
Workflow Configuration (JSON)
Create an orderflow-config.json file in your OrderFlow directory:
{
"routing_rules": [
{
"id": "rule_vip_priority",
"name": "Route VIP orders to priority warehouse",
"conditions": {
"customer_tier": "VIP",
"order_value": { "gte": 500 }
},
"actions": {
"warehouse": "warehouse_priority",
"shipping_speed": "expedited",
"notification": "slack_channel:vip_orders"
}
},
{
"id": "rule_inventory_fallback",
"name": "Fallback routing on stock shortage",
"conditions": {
"primary_warehouse_stock": { "lt": 1 },
"product_category": "electronics"
},
"actions": {
"warehouse": "warehouse_fallback",
"notify_inventory_team": true,
"log_exception": true
}
}
],
"inventory_sync": {
"enabled": true,
"interval_minutes": 15,
"sources": ["shopify", "woocommerce", "custom_api"],
"low_stock_threshold": 20,
"critical_stock_threshold": 5
},
"fulfillment": {
"default_carrier": "usps",
"carrier_selection": "cost_optimized",
"auto_generate_labels": true,
"batch_processing": true,
"batch_size": 50
},
"notifications": {
"slack_enabled": true,
"email_enabled": true,
"sms_enabled": true,
"sms_recipients": ["+1-555-0100"]
}
}
Setup Instructions
1. Install OrderFlow CLI:
npm install -g orderflow-cli
orderflow init
2. Authenticate integrations:
orderflow auth shopify --api-key YOUR_KEY --api-password YOUR_PASSWORD
orderflow auth warehouse --token YOUR_TOKEN
orderflow auth slack --webhook YOUR_WEBHOOK_URL
3. Deploy configuration:
orderflow config:deploy orderflow-config.json
orderflow workflows:activate
4. Test end-to-end:
orderflow test --order-id test_12345