AstroBaaS

Orders & fulfilment

Order Processing Automation

Paid pluginsize Lplanned, not built

Indicative price, not an offer: EUR 250-500/year or EUR 600 one-off

Generated from docs/plan/paid/order-processing-automation/PLAN.md in the AstroBaaS repository. Nothing described below is implemented — it is the written plan for it.

Automates order fulfillment, accounting, and CRM workflows via webhooks and integrations. Merchants map order events to actions: export order to ERP, sync payment to accounting, post to CRM, generate invoice.

The problem

I manually process 500+ orders daily across fulfillment, accounting, and CRM. Without automation, I employ a full person just to copy-paste data.

What it does

  • Automation workflow builder: low-code UI to define ‘if order.paid then export_to_erp’
  • Trigger events: order.created, order.paid, order.shipped, order.refunded, order.cancelled, order.delivered
  • Action library: export_csv, export_json, export_xml, post_to_webhook, send_email, create_erp_order, sync_accounting
  • Field mapping: map Order fields (customer_name, email, order_id, total, shipping_address) to ERP fields (customer, order_number, amount)
  • Conditional logic: if order.total > 1000 then route_to_manager; if coupon.code = ‘wholesale’ then export_wholesale_variant
  • Batch export: daily at 23:00 UTC, export all orders paid today as CSV to SFTP or webhook
  • Error handling: if webhook fails, retry 3x with exponential backoff; log failure; email staff
  • Audit trail: log every automation action (export sent, webhook fired, email sent) with timestamp and response
  • Testing: dry-run workflow to preview output before enabling
  • Rate limiting: respect target system rate limits (e.g., CRM 100 req/min); queue requests

What it deliberately does NOT do

Each boundary carries its reason. A boundary without a reason gets crossed by the next person who reads this.

  • Complex conditional logic (nested if/else, loops): out of scope—simple AND/OR only. Reason: rule engine complexity deferred.
  • Custom data transformation (e.g., split customer name into first/last): out of scope—simple field mapping only. Reason: custom logic is rare.
  • Bi-directional sync (ERP orders back to storefront): out of scope—one-way export only. Reason: sync complexity is deferred.
  • Real-time export (sub-second latency): out of scope—batch or webhook-based (near real-time, 5-30s delay). Reason: transactional DB not in scope.
  • ERP-specific integrations (SAP, Oracle): out of scope—webhook/CSV export only. Reason: merchant uses integration tool (Zapier).
  • Human approval before action: out of scope. Reason: workflow complexity deferred.

Data model

Workflow table/collection (workflow_id, trigger_event, actions JSON, enabled, created_at, last_run_at). WorkflowExecution table (exec_id, workflow_id, triggered_by_order_id, status, result JSON, error?, executed_at). FieldMapping table (mapping_id, workflow_id, source_field, target_field, transform?).

API

  • POST /workflows (staff, body: {trigger_event, actions: [{type, config}], enabled?: true}) → {workflow_id}
  • GET /workflows → [{workflow_id, trigger_event, actions_count, enabled, last_run_at}]
  • PUT /workflows/:id (staff, body: {actions?, enabled?}) → {workflow_id}
  • DELETE /workflows/:id (staff) → 204
  • POST /workflows/:id/test (staff, body: {sample_order_id}) → {status: ‘success’|‘error’, preview: {…}, error?: string}
  • GET /workflows/:id/executions (staff, query: ?limit=50) → [{exec_id, status, triggered_by, executed_at, error?}]
  • GET /workflows/:id/executions/:exec_id → {exec_id, order_id, actions_executed, results: [{action, status, response}]}

Every route added here must also appear in src/pages/openapi.json.ts — a test fails the build if it does not.

Admin

Workflows section: list workflows with trigger event, action count, enabled toggle. Create Workflow button opens builder with trigger selector, action blocks, field mapping UI. Test button previews output. Execution history shows results and errors.

The seam — why this is paid

Core owns workflow definition, trigger events, and basic action library (export_csv, webhook_post, email). Paid pack owns: ERP-specific integrations (SAP, NetSuite), bi-directional sync, custom transformations, approval workflows. Why: core provides honest webhook/CSV export and simple mapping; ERP integrations and complex workflows are paid.

Requires ERP/WMS/fulfillment system credentials. Paid for integration expertise and support for order routing.

Dependencies

  • orders (order entity and events)
  • webhooks (order.created, order.paid, etc.)
  • email-layer (send_email action)

Acceptance checks

Each of these must be able to fail. Before claiming this is done, break the code deliberately and watch each one go red.

  • Workflow created: trigger=order.paid, action=export_csv to SFTP; workflow_id returned
  • Order 123 is marked paid; workflow triggers automatically; CSV exported to SFTP within 5 seconds
  • Field mapping: Order.customer_name -> ERP.customer; Order.total -> ERP.amount_minor; mapping stored
  • Conditional action: if order.total > 10000 then post_to_webhook(‘https://manager-alert.example.com’); workflow posts when order > 10000
  • Webhook fails (timeout); retry 3x with 1s, 2s, 4s delays; if all fail, status=‘failed’, error logged
  • Test workflow: dry-run with sample order; output previewed without actually exporting
  • Execution history shows: order 123 exported to SFTP at 14:32 UTC; response logged
  • Disabling workflow: enabled=false; no new triggers fire; existing executions are unaffected
  • Rate limit: CRM webhook allows 100 req/min; system queues requests; exports delayed if limit exceeded
  • CSV export maps field names: ‘customer_name’, ‘email’, ‘order_id’, ‘total’, ‘shipping_address’ (no custom transforms)

Risks

Trigger missing: if order.paid event is not fired, workflow never triggers; payment collection logic must be audited. SFTP credentials: if exposed in logs, attacker can access merchant’s ERP data. Rate limiting: if target system adds rate limit and system doesn’t respect it, exports fail silently (no retry on 429). Field mapping: if mapping is wrong (e.g., ‘total’ in cents but ERP expects dollars), all exports are wrong. Audit trail: if execution logging fails, no evidence of what was exported; compliance risk.

Commercial context

Suggested priceEUR 250-500/year or EUR 600 one-off
Rival anchorXtento Order Export (CSV, XML, JSON, SQL)

The anchor is what the nearest equivalent charges on Shopify or Magento today. It is context for a pricing decision, not the decision.


Generated from the commerce plan. See docs/COMMERCE-PLAN.md for the full catalogue and ../../AI-GUIDE.md for how to work on this repository.