
A WooCommerce order can contain several products, but many workflows need those products separately. Maybe you want one spreadsheet row per item, one CRM record per product, or cleaner data for reporting.
Instead of mapping line_items[0], line_items[1], and so on manually, you can loop through the full line_items array and process every product automatically. This guide shows how to do that in Bit Flows with an Iterator.
Map the WooCommerce line_items array into the Bit Flows Iterator, then connect the action you want to run next.
The Iterator processes each line item separately, so a multi-product order can create separate Google Sheets rows, CRM records, messages, or other actions without manual mapping.
Looping through WooCommerce order items means running the same action once for each distinct product row in an order. An order containing two T-shirts and one coffee mug has two line items, so the loop runs twice. The T-shirt quantity is 2, but it remains one row unless you intentionally add another quantity-based loop.
| Line item | Quantity | Iterator runs |
| T-shirt | 2 | 1 |
| Coffee mug | 1 | 1 |
| Total | 3 units | 2 line-item runs |
This distinction matters because a line-item loop answers “How many different product rows are in the order?” It does not answer “How many total units were purchased?” WooCommerce provides the quantity inside each item so the next action can still see that two T-shirts were ordered.
Prepare these items before building the workflow:
The recommended workflow uses three nodes: WooCommerce starts the flow, Iterator breaks the line_items array into current items, and Google Sheet adds one row for each current item. You do not need an AI Agent, Router, or JSON Parser for a normal structured WooCommerce response.

In Bit Flows, create a new flow and add WooCommerce as the trigger, then choose On New Order Create. This starts the workflow whenever WooCommerce creates a new order.

Before you go further, decide when the flow should run. On New Order Create fires the moment an order is created, which for most checkouts is while the order is still pending payment.
Open the trigger and click Listen Response. Bit Flows will listen for the next order for about three minutes.

While it is listening, open your store in a separate tab and place a test order. Add at least two different products to the cart, then proceed through the checkout process and complete the order. Using multiple products will help you see how the loop handles and processes more than one item within the same order.

When the order comes in, Bit Flows captures the response. You will see the order data, including the order_id and an order object that holds the billing details, totals, and the line_items array.

Click the plus icon after the trigger and add the Iterator tool. In the Array field, map the order line_items from the WooCommerce trigger. Map line_items, not line_items[0].

After a test run, expand the Iterator output, and you will see the fields for products: product_id, product_name, quantity, subtotal, total, product_sku, product_unit_price, and more. These are the fields you will send to the spreadsheet. Use the exact field names shown in your own captured response, since they can vary by store setup.

In Google Sheets, create a spreadsheet and add a header row. Use the fields that you want to track here, such as order details, customer information, product details, payment information, and order status.
After the Iterator, add Google Sheets and choose Add Row.
To connect Google Sheets with Bit Flows, go to Google Cloud Console, enable the Google Drive API and Google Sheets API, configure the OAuth consent screen, and create an OAuth Web Application using the Authorized JavaScript Origin and Redirect URI provided by Bit Flows. Then copy the generated Client ID and Client Secret and paste them into the Bit Flows connection fields. For the complete setup, follow the official Google Sheets integration guide.
Select your Google connection, the spreadsheet, and the sheet tab. Then map each column. Keep the split clear. Order-level fields come from the WooCommerce trigger, and product-level fields come from the Iterator:

For Customer Name, use Mix Input so you can combine two fields in one column, like billing_first_name and billing_last_name. Mix Input lets you place static text and more than one value into a single destination field, while normal mapping passes one value.
Map Order Total to the order total from the trigger, not to a line item total. Every row of the same order then shows the full order value. That value repeats on each product row by design, so treat it as a label, not a number to sum. If you want per-product revenue instead, add a Line Total column and map it to the current item’s total from the Iterator, which already accounts for quantity.
Run the flow, then place a test order with several different products to prove the loop works.
The Iterator processes each product in that order, and Add Row writes one row per product. An order with three products produces three rows, each with its own product name, quantity, and price, while the order-level fields stay the same across those rows.

That is the whole point of the loop: one order with several products turns into separate, usable product records, without ever selecting line_items[0], line_items[1], and so on by hand.
Mapping line_items[0] instead of line_items. This sends only the first product to the sheet. Map the full line_items array into the Iterator so every product is processed.
Expecting one row per unit. A quantity of 3 is still one line item and one row. If you truly need one row per unit, you would add a second loop based on quantity, which most stores do not need.
Order Total showing the wrong number. If the Order Total column shows the first product’s price, or the same small value on every row of a large order, it was mapped to a line item total instead of the order grand total. Map it to the order grand total from the trigger. For per-product revenue, add a Line Total column mapped to the current item’s total from the Iterator.
Using the creation trigger for a paid-sales sheet. On New Order Create fires before payment, so the sheet can fill with pending or abandoned orders. Use Order Status Set to Processing or Completed when you only want paid orders.
The Iterator is a tool that processes a list one item at a time. You give it the order line_items array, and it runs the next action once for each product in that array. Because it hands the next step one product at a time, you can map that product’s fields straight into a spreadsheet row.
One clarification that saves confusion later: the Iterator runs once per product row, not once per unit. If a customer buys three of the same phone, that is still one line item and one row, with a quantity of 3. It does not create three rows.
Once the Iterator is mapped to the WooCommerce line_items array, the rest of the workflow becomes much easier to manage. You can send each product to Google Sheets or any other connected action while still keeping the related order details with it.
This is especially useful when your automation needs structured product-level data instead of one bundled WooCommerce order.
WooCommerce order line items are the distinct product rows inside an order, with fields such as product ID, variation ID, quantity, subtotal, tax, and total.
Use Bit Flows: add a WooCommerce trigger, pass the order line_items array into an Iterator, then add an action, and it runs once per product with no PHP.
It creates one row per product line, not per unit, so a quantity of three is still a single line item with a quantity value of three.
Use On New Order Create to capture every order at creation, or Order Status Set to Processing or Completed when you only want to record paid orders.
Yes, after the Iterator you can add any Bit Flows action, so the same loop can create CRM records, send emails, or post messages, one per product.
No, when line_items arrives as a structured array, you only need the Iterator, since JSON Parser is for raw JSON text and an AI Agent is unnecessary for fixed mapping.
Yes, the WooCommerce trigger, the Iterator, and the Google Sheet action are all on the free Bit Flows plan, so the workflow runs without a paid upgrade.
