1
0
Fork 0
mirror of https://github.com/maziggy/bambuddy.git synced 2026-05-09 16:35:47 +02:00

[GH-ISSUE #991] feat: Order-to-Project automation with product-file mapping #692

Closed
opened 2026-05-07 00:12:52 +02:00 by BreizhHardware · 1 comment

Originally created by @legend813 on GitHub (Apr 15, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/991

Originally assigned to: @maziggy on GitHub.

Feature Request

Background / Use Case

I run an online shop (WooCommerce) and have already built an n8n workflow that calls Bambuddy's API to create a project whenever a new order comes in. This works today, but the integration is shallow: the project is created empty, and I still have to manually add files and queue the prints.

Workflow today:
WooCommerce order → n8n → POST /api/projects → empty project in Bambuddy

What I want:
WooCommerce order → n8n (or direct webhook) → Bambuddy creates project + adds correct files at correct quantities + queues prints automatically


Proposed Feature

1. Product → File mapping

A configuration table (settable via UI and API) that maps a product identifier (SKU, product ID, or name) to one or more print files already stored in Bambuddy's File Manager:

SKU "VASE-RED"   → vase_v2.3mf  ×1, base_plate.3mf ×1
SKU "BRACKET-L"  → bracket_left.3mf ×1
SKU "BRACKET-R"  → bracket_right.3mf ×1

2. Order intake endpoint (or extended project creation)

Extend the existing POST /api/projects endpoint (or add POST /api/orders) to accept order line items:

{
  "name": "Order #538",
  "source": "woocommerce",
  "line_items": [
    { "sku": "VASE-RED",   "quantity": 3 },
    { "sku": "BRACKET-L",  "quantity": 2 }
  ]
}

Bambuddy would:

  1. Create the project
  2. Resolve each SKU via the product→file mapping
  3. Add the resolved files × quantity to the project
  4. Optionally auto-queue them (configurable: auto_queue: true/false)

3. Auto-queue / auto-print (optional, configurable)

A per-project or per-mapping flag that automatically pushes resolved print jobs into the print queue so they start printing as soon as a printer is available — without any manual step.


Optional Extension: Native WooCommerce Integration

This section describes a deeper, optional integration layer on top of the core feature above.
The core (SKU-based mapping + order API) works without it — this just removes the need to type SKUs manually.

Instead of requiring users to enter SKUs by hand, Bambuddy could connect directly to a WooCommerce store and:

a) Pull products automatically
Configure a WooCommerce connection (store URL + REST API key) in Bambuddy's Settings. Bambuddy fetches the product catalogue via the WooCommerce REST API and caches it locally.

b) Display products in the mapping UI
The product→file mapping screen shows a searchable dropdown of real WooCommerce products (name + SKU + thumbnail) instead of a plain text field. No copy-pasting of SKUs required.

c) Optional: receive orders via WooCommerce webhook
Register a WooCommerce webhook (order.created) that posts directly to Bambuddy — eliminating the need for n8n or any other middleware entirely:

WooCommerce order.created webhook → Bambuddy /api/webhooks/woocommerce → project created + files queued

Configuration needed (Settings → Integrations → WooCommerce):

Field Description
Store URL e.g. https://myshop.com
Consumer Key WooCommerce REST API read key
Consumer Secret WooCommerce REST API secret
Webhook Secret Shared secret to verify incoming webhooks
Auto-sync products Interval to refresh the product cache

What stays generic (no WooCommerce required):
The core mapping table and order intake API remain shop-agnostic. Shopify, custom shops, or n8n workflows can all POST line items using SKUs — WooCommerce is just one optional source that enables the richer UI.


Why this matters

  • 3D-print-on-demand shops are a growing use case; Bambuddy is already the best self-hosted print manager for Bambu printers
  • With this feature, the entire fulfillment loop (order in → printed part out) could be fully automated
  • The WooCommerce extension in particular removes all friction from the initial setup: connect once, map visually, done

Implementation notes

  • Product→file mappings could live in a new product_mappings DB table
  • The existing Project + Queue logic already handles most of the heavy lifting
  • An "Order" model could be a thin wrapper over Project with source, external_order_id, and line_items — no full rework needed
  • WooCommerce credentials stored like existing integrations (HA, Spoolman) — encrypted at rest
  • Product cache refresh can reuse the existing background task scheduler
  • The n8n community (and other automation tools) would immediately benefit from a clean API surface here

Current workaround

n8n workflow: Schedule Trigger → JS → WooCommerce getAll orders → Switch (new/existing) → HTTP Request POST to Bambuddy → JS

The project gets created but files and print quantities must be added manually.


Originally created by @legend813 on GitHub (Apr 15, 2026). Original GitHub issue: https://github.com/maziggy/bambuddy/issues/991 Originally assigned to: @maziggy on GitHub. ## Feature Request ### Background / Use Case I run an online shop (WooCommerce) and have already built an n8n workflow that calls Bambuddy's API to create a project whenever a new order comes in. This works today, but the integration is shallow: the project is created empty, and I still have to manually add files and queue the prints. **Workflow today:** `WooCommerce order → n8n → POST /api/projects → empty project in Bambuddy` **What I want:** `WooCommerce order → n8n (or direct webhook) → Bambuddy creates project + adds correct files at correct quantities + queues prints automatically` --- ### Proposed Feature #### 1. Product → File mapping A configuration table (settable via UI and API) that maps a product identifier (SKU, product ID, or name) to one or more print files already stored in Bambuddy's File Manager: ``` SKU "VASE-RED" → vase_v2.3mf ×1, base_plate.3mf ×1 SKU "BRACKET-L" → bracket_left.3mf ×1 SKU "BRACKET-R" → bracket_right.3mf ×1 ``` #### 2. Order intake endpoint (or extended project creation) Extend the existing `POST /api/projects` endpoint (or add `POST /api/orders`) to accept order line items: ```json { "name": "Order #538", "source": "woocommerce", "line_items": [ { "sku": "VASE-RED", "quantity": 3 }, { "sku": "BRACKET-L", "quantity": 2 } ] } ``` Bambuddy would: 1. Create the project 2. Resolve each SKU via the product→file mapping 3. Add the resolved files × quantity to the project 4. Optionally auto-queue them (configurable: `auto_queue: true/false`) #### 3. Auto-queue / auto-print (optional, configurable) A per-project or per-mapping flag that automatically pushes resolved print jobs into the print queue so they start printing as soon as a printer is available — without any manual step. --- ### Optional Extension: Native WooCommerce Integration > This section describes a deeper, optional integration layer on top of the core feature above. > The core (SKU-based mapping + order API) works without it — this just removes the need to type SKUs manually. Instead of requiring users to enter SKUs by hand, Bambuddy could connect directly to a WooCommerce store and: **a) Pull products automatically** Configure a WooCommerce connection (store URL + REST API key) in Bambuddy's Settings. Bambuddy fetches the product catalogue via the [WooCommerce REST API](https://woocommerce.github.io/woocommerce-rest-api-docs/#products) and caches it locally. **b) Display products in the mapping UI** The product→file mapping screen shows a searchable dropdown of real WooCommerce products (name + SKU + thumbnail) instead of a plain text field. No copy-pasting of SKUs required. **c) Optional: receive orders via WooCommerce webhook** Register a WooCommerce webhook (`order.created`) that posts directly to Bambuddy — eliminating the need for n8n or any other middleware entirely: ``` WooCommerce order.created webhook → Bambuddy /api/webhooks/woocommerce → project created + files queued ``` **Configuration needed (Settings → Integrations → WooCommerce):** | Field | Description | |-------|-------------| | Store URL | e.g. `https://myshop.com` | | Consumer Key | WooCommerce REST API read key | | Consumer Secret | WooCommerce REST API secret | | Webhook Secret | Shared secret to verify incoming webhooks | | Auto-sync products | Interval to refresh the product cache | **What stays generic (no WooCommerce required):** The core mapping table and order intake API remain shop-agnostic. Shopify, custom shops, or n8n workflows can all POST line items using SKUs — WooCommerce is just one optional source that enables the richer UI. --- ### Why this matters - 3D-print-on-demand shops are a growing use case; Bambuddy is already the best self-hosted print manager for Bambu printers - With this feature, the entire fulfillment loop (order in → printed part out) could be fully automated - The WooCommerce extension in particular removes all friction from the initial setup: connect once, map visually, done ### Implementation notes - Product→file mappings could live in a new `product_mappings` DB table - The existing Project + Queue logic already handles most of the heavy lifting - An "Order" model could be a thin wrapper over Project with `source`, `external_order_id`, and `line_items` — no full rework needed - WooCommerce credentials stored like existing integrations (HA, Spoolman) — encrypted at rest - Product cache refresh can reuse the existing background task scheduler - The n8n community (and other automation tools) would immediately benefit from a clean API surface here --- ### Current workaround n8n workflow: `Schedule Trigger → JS → WooCommerce getAll orders → Switch (new/existing) → HTTP Request POST to Bambuddy → JS` The project gets created but files and print quantities must be added manually. ---
BreizhHardware 2026-05-07 00:12:52 +02:00
Author
Owner

@maziggy commented on GitHub (Apr 22, 2026):

I don't think that we are going to implement this, because it would be tailored to your specific requirements which would certainly not fit the workflow of other users.

But you can do all this with the existing API. Check the API browser under settings.

<!-- gh-comment-id:4296282032 --> @maziggy commented on GitHub (Apr 22, 2026): I don't think that we are going to implement this, because it would be tailored to your specific requirements which would certainly not fit the workflow of other users. But you can do all this with the existing API. Check the API browser under settings.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy-maziggy-1#692
No description provided.