Flag a return nobody answered
An automation that waits 3 days after a return request and notifies the store's managers if it is still unanswered. A validated definition using a wait step and a live current.return value.
When a customer requests a return, wait 3 days. If nobody has approved, declined or cancelled it by then, notify the managers. Trigger: return.requested@1. Steps: wait, condition on current.return.status, notify_me@1.
Model background: Automations.
The definition
{
"schemaVersion": 1,
"trigger": {
"type": "return.requested@1",
"origins": [
"USER",
"API",
"MCP",
"ASSISTANT",
"BULK",
"IMPORT",
"DUPLICATE",
"SYSTEM",
"AUTOMATION"
]
},
"steps": [
{
"id": "pause",
"type": "wait",
"duration": {
"amount": 3,
"unit": "days"
}
},
{
"id": "still",
"type": "condition",
"when": {
"op": "all",
"rules": [
{
"path": "current.return.status",
"op": "eq",
"value": "REQUESTED"
}
]
},
"then": [
{
"id": "tell",
"type": "action",
"contract": "notify_me@1",
"input": {
"title": "Return {{return.number}} has waited 3 days",
"message": "Nobody has approved or declined return {{return.number}} for order {{order.number}}."
}
}
]
}
]
}Replace before saving: the wait duration (minutes, hours or days, 5 minutes to 90 days) and the wording of the notice.
How it works
return.requested@1is one of six return triggers (requested,approved,declined,received,completed,cancelled). Their facts are the order facts plusevent.facts.return.status,.resolution,.source,.autoApproved,.reasonCode,.unitCountand.lineCount. No decline text and no merchant note is ever in the facts.- The facts are frozen at the request, so after the
waitthe condition reads the live valuecurrent.return.status(REQUESTED,APPROVED,RECEIVED,COMPLETED,DECLINED,CANCELLED). StillREQUESTEDmeans nobody answered. - If it was answered, the condition is false, there is no
else, and the run endsSUCCEEDEDwith the outcomeCONDITION_NOT_MET. That is the normal, quiet result for most returns. - The text may use the order variables plus
{{return.id}},{{return.number}},{{return.status}},{{return.resolution}}and{{return.unitCount}}. A customer can cancel a request only while it waits for approval, so a cancelled return readsCANCELLEDhere.
What it does not do
- It does not approve or decline anything. There is no return action in the engine: it only tells a person.
- It does not email the customer. A customer email "about the order" is possible with
send_customer_email@1andkind: "order", but not as a reminder to the merchant. - Other live return columns you can test instead of the status:
current.return.ageDays,.daysSinceApproved,.daysSinceReceived,.resolution,.source,.hasRefund. For example, "approved but never received after 10 days" is a wait onreturn.approved@1and a check oncurrent.return.status eq APPROVED.
Create it
With the Admin MCP:
get_automation_guidewithtopic: "triggers", then"live-values".validate_automation_definition. Fix every finding.test_automationwithentity: { "type": "Order", "id": "<an order that has a return>" }. An order with no return yet has nothing to test on.create_automation_draftwithname: "Return waiting too long".- Tell the merchant to approve it in the dashboard.
With the SDK:
const check = await admin.validateAutomationDefinition(storeId, { definition });
if (!check.ok) throw new Error(JSON.stringify(check.errors));
const draft = await admin.createAutomation(storeId, {
name: 'Return waiting too long',
definition,
});What the merchant sees
A draft in Settings, then Automations. Once on, every new return request starts a run that sits WAITING for 3 days. If the return is still unanswered, the store's managers get a notice such as "Return R-1042 has waited 3 days". Otherwise the run ends SUCCEEDED and nobody is bothered.
Abandoned cart reminder with a live check
An automation that waits after a cart goes idle, re-checks that it is still abandoned, then sends a library email to the shopper. A validated definition using a wait step and a live current.cart value.
Hold risky first orders for review
An automation that puts a new customer's large first order on hold, tags it and notifies the managers, so nothing ships until a person releases it. A validated definition using a guarded action.