WooCommerce · Arazzo Workflow

WooCommerce Upsert Product by SKU

Version 1.0.0

Find a product by its SKU and create it only if no matching product exists.

1 workflow 1 source API 1 provider
View Spec View on GitHub E-CommerceOpen-SourceOrderProductWordPressArazzoWorkflows

Provider

woocommerce

Workflows

upsert-product-by-sku
Upsert a product keyed on its SKU, creating it only when missing.
Searches the catalog for a product matching the supplied SKU and either reads the matched product or creates a new one when no match exists.
3 steps inputs: productName, regularPrice, sku outputs: createdProductId, productId
1
findProduct
Search the catalog for a product matching the supplied SKU, returning at most one result.
2
getExisting
Read the matched product to confirm its current pricing and stock status.
3
createNew
Create a new product carrying the supplied SKU when no existing product matched.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: WooCommerce Upsert Product by SKU
  summary: Find a product by its SKU and create it only if no matching product exists.
  description: >-
    Keeps a catalog idempotent when syncing from an external source of truth.
    The workflow searches the catalog for a product matching the supplied SKU,
    then branches: when a match is found it reads the existing product, and when
    no match is found it creates a new product carrying that SKU. Every step
    spells out its request inline so the flow can be read and executed without
    opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: productsApi
  url: ../openapi/woocommerce-products-api-openapi.yml
  type: openapi
workflows:
- workflowId: upsert-product-by-sku
  summary: Upsert a product keyed on its SKU, creating it only when missing.
  description: >-
    Searches the catalog for a product matching the supplied SKU and either
    reads the matched product or creates a new one when no match exists.
  inputs:
    type: object
    required:
    - sku
    - productName
    - regularPrice
    properties:
      sku:
        type: string
        description: Stock-keeping unit used to detect an existing product.
      productName:
        type: string
        description: Product name to use when creating a new product.
      regularPrice:
        type: string
        description: Regular price as a decimal string to use on create.
  steps:
  - stepId: findProduct
    description: >-
      Search the catalog for a product matching the supplied SKU, returning at
      most one result.
    operationId: listProducts
    parameters:
    - name: search
      in: query
      value: $inputs.sku
    - name: per_page
      in: query
      value: 1
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      matchedProductId: $response.body#/0/id
    onSuccess:
    - name: productExists
      type: goto
      stepId: getExisting
      criteria:
      - context: $response.body
        condition: $.length > 0
        type: jsonpath
    - name: productMissing
      type: goto
      stepId: createNew
      criteria:
      - context: $response.body
        condition: $.length == 0
        type: jsonpath
  - stepId: getExisting
    description: >-
      Read the matched product to confirm its current pricing and stock status.
    operationId: getProduct
    parameters:
    - name: id
      in: path
      value: $steps.findProduct.outputs.matchedProductId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      productId: $response.body#/id
      productSku: $response.body#/sku
    onSuccess:
    - name: done
      type: end
  - stepId: createNew
    description: >-
      Create a new product carrying the supplied SKU when no existing product
      matched.
    operationId: createProduct
    requestBody:
      contentType: application/json
      payload:
        name: $inputs.productName
        type: simple
        status: publish
        sku: $inputs.sku
        regular_price: $inputs.regularPrice
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      productId: $response.body#/id
      productSku: $response.body#/sku
  outputs:
    productId: $steps.getExisting.outputs.productId
    createdProductId: $steps.createNew.outputs.productId

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/woocommerce-upsert-product-by-sku-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.