Skip to main content
Decides whether a freshly staged ProductChange should be confirmed immediately: it runs confirmProductChangeWorkflow for the change when force is true or the product_request feature flag is disabled, and does nothing otherwise (leaving the change pending for operator review). Run as a step by stageProductChangeWorkflow. Any events (product-change.confirmed) come from the nested confirm workflow.

Usage

import { autoConfirmProductChangeWorkflow } from "@mercurjs/core/workflows"

await autoConfirmProductChangeWorkflow(container).run({
  input: {
    change_id: "prch_01H...",
    confirmed_by: "sel_01H...",
  },
})

Input

change_id
string
required
Id of the product change to (conditionally) confirm.
confirmed_by
string
Actor id forwarded as confirmed_by to the confirm workflow.
force
boolean
Confirm regardless of the product_request feature flag.

Result

result
void
Returns nothing; the change is either confirmed (and its actions applied) or left pending.