Skip to main content

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


2. Catalog of Agents & Workflows

Order Processing Tier

Inventory Management Tier

Financial Processing Tier


3. End-to-End Pipeline Walkthrough


4. Deployment & Operations

  1. Packaging – Each Agent ships as a container invoking agent run.
  2. Versioning – Semantic versions; upgrades spin a shadow copy replaying last 24 h of events before cut-over.
  3. Observability – Logs & metrics stream to Grafana/Prometheus; Work-Graph UI renders lineage and retries.
  4. 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 commandStateSet 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.
When to use the CLI vs. Webhooks?Use the CLI for backfills, migrations, on-demand tests or bulk operations. Use webhooks or schedules for real-time and recurring automation.

Next Steps

  1. Read the Agents Quickstart to understand core Agent APIs.
  2. Explore Order Operations for advanced order-management patterns.
Happy automating! 🚀