Ecommerce Agent Workflows Guide
Build a multi-agent order-to-cash pipeline with Shopify, NetSuite & DCL using StateSet’s Agent & Workflow Frameworks.
Ecommerce Agent Workflows
This guide shows how to orchestrate Shopify → NetSuite → DCL operations with multiple autonomous AI Agents powered by StateSet’s Agent Framework, Workflow Framework, and Agentic OS Connector.
CTOs, Solutions Architects, and DevOps engineers building a resilient, observable, and fully-automated order-to-cash pipeline.
StateSet One platform orchestrates complex order operations by connecting various e-commerce and backend systems. This automation streamlines processes from order capture to fulfillment, inventory management, and customer service. Key benefits include:
- Automated Order Flow: Seamlessly move order data from Shopify to NetSuite and then to DCL for fulfillment.
- Real-time Fulfillment Updates: Keep Shopify and NetSuite synchronized with shipment and tracking information from DCL.
- Inventory Accuracy: Maintain consistent inventory levels between NetSuite, DCL, and Shopify.
- Efficient Inbound Logistics: Automate PO/ASN communication with DCL and item receipt processing in NetSuite.
- Agentic Customer Service: Enhance Gorgias with AI-powered responses and actions via integrations with Recharge and Shopify.
- Centralized Orchestration: Utilize StateSet for robust, observable, and scalable workflow management.
This guide focuses on the API-driven interactions orchestrated by the workflows defined in workflows.js
and activities in activities.js
.
1. Architectural Primer
Layer | Purpose |
---|---|
Agent Framework | Runs containerised agents that each own one business capability. Triggers → Preconditions → Actions → Post-conditions ensure deterministic, idempotent runs. |
Workflow Framework | Declarative, version-controlled sequences of API calls with rollback, retries, and logging baked in. Every Agent owns a single Workflow implementation. |
Agentic OS Connector | A thin HTTP/gRPC façade that pushes normalised events into the Agent bus, manages secrets, schedules retries, and renders the cross-system Work-Graph UI. |
2. Catalog of Agents & Workflows
Order Processing Tier
# | Agent / Workflow | Trigger | Purpose |
---|---|---|---|
1 | shopifyToNetsuiteWorkflow | Shopify Agent | Convert Shopify Order → NetSuite Sales Order (SO); tag order SENT_TO_NS . |
2 | netsuiteToDCLWorkflow | NetSuite Agent | Transform SO and POST to DCL; set custbody_sent_to_3pl = T . |
3 | dclTrackingUpdateWorkflow | DCL Agent | Create Item Fulfillment & optional Cash Sale in NetSuite; push tracking to Shopify. |
Inventory Management Tier
# | Agent / Workflow | Trigger | Purpose |
---|---|---|---|
4 | dclPoNotificationWorkflow | NetSuite PO/TO status Pending Receipt | Send ASN (Advance Ship Notice) to DCL. |
5 | dclPoReceiptWorkflow | DCL Agent | Create Item Receipt, reconcile quantity, close PO if complete. |
6 | inventorySyncWorkflow | Cron (*/15 min) | Pull inventory from NetSuite, bulk update Shopify. |
7 | inventoryBundlesSyncWorkflow | Cron (*/15 min +10 sec) | Compute bundle availability and update Shopify bundles. |
Financial Processing Tier
# | Agent / Workflow | Trigger | Purpose |
---|---|---|---|
8 | netsuiteInvoiceFlow | SO status Pending Billing | Create Invoice, tag SO INVOICED . |
9 | netsuitePaymentFlow | Invoice Open + payment settlement | Record payment, apply to Invoice, close Invoice. |
3. End-to-End Pipeline Walkthrough
4. Deployment & Operations
- Packaging – Each Agent ships as a container invoking
agent run
. - Versioning – Semantic versions; upgrades spin a shadow copy replaying last 24 h of events before cut-over.
- Observability – Logs & metrics stream to Grafana/Prometheus; Work-Graph UI renders lineage and retries.
- Error Handling – Automatic exponential retries for idempotent calls; compensation jobs registered per Agent; Slack/E-mail hooks after N failures.
5. FAQ
Q: Do I need all nine agents on day one?
No. Start with the Shopify→NetSuite workflow, then gradually enable the others as your operational maturity grows.
Q: How are bundle quantities computed?
inventoryBundlesSyncWorkflow
requests BOM data from NetSuite, then calculates bundle_qty = MIN(component_qty[])
.
Q: Can I extend this to Amazon or WooCommerce?
Yes—write a new Agent that maps their order schema to the canonical OrderCreated
event expected by shopifyToNetsuiteWorkflow
.
6. Triggering Workflows from the CLI
Once your Agents are deployed you can kick-off any workflow on demand via the Stateset CLI (a lightweight Node binary).
• Single command – stateset run --connector <workflow>
posts a JSON payload to the Agentic OS Connector REST endpoint.
• Stateless – The CLI simply packages your payload and returns the workflow_id
; orchestration, retries and logging are handled by the platform.
• Environment-driven – Point to prod, staging or local dev-tunnels by changing the STATESET_ENDPOINT
env variable or passing --endpoint
.
• CI/CD ready – Works in GitHub Actions, CircleCI, or any shell, enabling synthetic orders during pipeline builds or bulk-replay of historical events.
• Security – Uses the same API tokens as the dashboard; no secrets are stored locally.
Next Steps
- Read the Agents Quickstart to understand core Agent APIs.
- Explore Order Operations for advanced order-management patterns.
Happy automating! 🚀