How to Approve and Publish AI-Drafted WooCommerce Product Updates
Build a Spojit workflow that drafts SEO and pricing updates for selected WooCommerce products with an AI agent, pauses for a human reviewer, then writes only the approved changes back to your store.
What This Integration Does
Letting an AI agent rewrite product titles, descriptions, and prices is fast, but publishing those changes blind is risky: a hallucinated price or an off-brand description goes straight to shoppers. This workflow puts a person in the loop. The agent drafts the proposed updates, a reviewer sees them side by side with the current values in the Spojit Approvals inbox, and the store is only touched after someone approves. You get the speed of AI authoring with the safety of human sign-off.
The workflow runs on demand from the Run button (a Manual trigger), taking a small list of product IDs as input. It reads each product from WooCommerce, asks the agent to propose a revised title, short description, and regular price, then halts at a Human node. While paused, no store data changes. On approval it loops through the drafts and calls update-product for each one. If the reviewer rejects or the request times out, the run halts and your catalog stays exactly as it was, so re-running later is safe and never double-applies edits.
Prerequisites
- A WooCommerce connection in Spojit with read and write access to products. See Adding a New Connection if you have not connected it yet.
- A handful of product IDs you want to refresh (find them with the WooCommerce
list-productstool or in your store admin). - At least one approver: a user, role, or team in your workspace who will review the drafts. Roles cascade (Owner > Admin > Member).
- Permission to edit workflows in your workspace, and a model available for the agent in Agent mode.
Step 1: Add a Manual trigger and define the input
Create a new workflow in the Workflow Designer and add a Trigger node set to type Manual. With a Manual trigger, the output is whatever request body you pass when you click Run. Plan to supply a short list of product IDs, for example:
{
"productIds": ["153", "188", "204"]
}
Downstream nodes read these as {{ trigger.productIds }}. Keep the list small at first so reviewers are not flooded.
Step 2: Loop over the products and read each one
Add a Loop node in ForEach mode iterating over {{ trigger.productIds }}. Inside the loop body, add a Connector node in Direct mode for the WooCommerce connector and pick the get-product tool. Map its id field to the current loop item, for example {{ item }}. Direct mode is deterministic and costs no AI credits, so it is the right choice for a plain fetch. The full product (current name, regular_price, description, and short_description) becomes available to the next node.
Step 3: Draft SEO and pricing updates with an AI agent
Still inside the loop, add a second Connector node, this time in Agent mode on the WooCommerce connector. Agent mode lets the agent reason over the product and propose changes. Pass the current product into the prompt and ask for a concrete draft. To get clean, predictable data back, turn on a Response Schema so the output is forced into JSON:
{
"id": "153",
"currentName": "Blue Cotton Tee",
"proposedName": "Organic Blue Cotton T-Shirt - Soft Everyday Fit",
"proposedShortDescription": "Breathable organic cotton tee in classic blue...",
"proposedRegularPrice": "24.95",
"rationale": "Tightened title for search, added material keyword, rounded price."
}
Write the prompt to forbid changing fields it was not asked to touch, and to keep proposedRegularPrice as a string (WooCommerce prices are strings). Store the result in an output variable such as draft. Collect each loop iteration's draft so you have a full list to review, for example {{ drafts }}.
Step 4: Pause for human approval
After the loop, add a Human node so a person signs off before anything is written. Configure:
- Label: something clear like
Review product updates. - Message: summarise what is being changed and reference the drafts, for example:
Approve {{ drafts.length }} AI-drafted product updates. Review the proposed name, short description, and price for each. - Approval slots: the only required field. Add a slot and place your reviewer (a user, role, or team) in it. Any atom in a slot satisfies that slot; every slot must be satisfied for the run to continue.
- Email approvers (optional): turn on to email the first ten approvers. Urgency and Notification title/body support
{{ variables }}. - Timeout (minutes): leave blank for no deadline, or set one. A timeout is treated as a rejection.
Approvers act in the Approvals inbox at /approvals. On approval the node outputs { approved: true, approvalId, outcome: "APPROVED" } and the workflow continues. A rejection or timeout halts the run, so nothing reaches WooCommerce. Note that "on reject, do X" branching is not supported; rejection simply stops the workflow.
Step 5: Write the approved changes back to WooCommerce
After the Human node, add a second Loop node in ForEach mode over your collected drafts, {{ drafts }}. Inside it, add a Connector node in Direct mode on the WooCommerce connector using the update-product tool. Map only the fields you want to change:
id→{{ item.id }}name→{{ item.proposedName }}short_description→{{ item.proposedShortDescription }}regular_price→{{ item.proposedRegularPrice }}
Leave the other update-product fields (description, sku, status) unset so they are untouched. Because this node only runs after approval, the store is changed exactly once per approved draft.
Step 6: Confirm the outcome by email
Add a Send Email node so the requester knows the updates landed. This sends from Spojit's built-in mail service with no connection needed. Set Recipients (comma-separated, templated), a templated Subject, and a plain-text Body listing each updated product, for example Updated {{ drafts.length }} products in WooCommerce after approval {{ approval.approvalId }}. External recipients must be on your org allowlist under Settings → General → Email recipients. To send from your own domain instead, swap in the Resend or SMTP connector.
Tips
- Keep the agent's Response Schema strict and ask for a
rationalefield. Surfacing the reasoning in the approval Message helps reviewers decide quickly. - Use Direct mode for the deterministic reads and writes (
get-product,update-product) and reserve Agent mode for the drafting step only, so you pay AI credits once per product. - Run small batches. A reviewer can scan five product drafts far faster than fifty, and a smaller blast radius is safer for pricing changes.
- Ask Miraxa, the intelligent layer across your automation, to scaffold the skeleton: "Build a workflow with a Manual trigger, a Loop over product IDs calling WooCommerce get-product, an Agent-mode draft step, a Human approval, then a Loop calling update-product." Then fine-tune fields in the properties panel.
Common Pitfalls
- WooCommerce prices are strings, not numbers. If
regular_pricecomes through as a number the update can be rejected; force it to a string in the agent's Response Schema. - A rejected or timed-out approval halts the workflow with no branch to handle it. If you need a "do something else on reject" path, run notification logic in a separate workflow rather than expecting downstream nodes to fire.
- If the WooCommerce connection lacks write scope, the reads in Step 2 succeed but
update-productfails. Confirm write access before going live. See Troubleshooting Connection Issues. - Make sure every approval slot resolves to a real, active approver. If a slot can never be satisfied, the run sits paused until any timeout you set elapses.
Testing
Start with a single product ID in the Manual trigger input and a draft status if you can stage one. Click Run, then open the Approvals inbox to see the pending request and the proposed values. Approve it, then verify in WooCommerce (or with a quick get-product call) that only the title, short description, and price changed. Do a second pass and reject the request to confirm the catalog is left untouched when sign-off is denied. Once both paths behave, expand the input list to your full batch.