Skip to content

Delayed order triage with approval queue

When an order is flagged late, the agent reads the order, shipment and customer records, looks up the shipping policy, and decides a severity and resolution with the evidence attached. Low risk cases run on their own and the rest wait in an approval queue before a ticket and customer email go out.

Ecommerce and resaleWorks with LangGraph · OpenAI Agents SDK+1Community example

What it does

  • Investigates each delayed order with the order, shipment and customer records prefetched
  • Retrieves the relevant shipping policy and cites document and page in the decision
  • Proposes severity, resolution and an optional customer message
  • Routes the decision through guardrails to auto execute or to the human approval queue
  • Opens a support ticket and, once approved, emails the customer a status update with a tracking link

Your approval boundaries

Creates drafts

These actions always wait for your yes:

  • Approving any decision the guardrails do not clear, before the ticket and customer email are sent

You decide what happens next.

More about this workflow

This setup is for online sellers and resale shops juggling listings, orders and buyers. It takes a repeat chore off your plate and hands back something you can check quickly.

First, it investigates each delayed order with the order, shipment and customer records prefetched. Next, it retrieves the relevant shipping policy and cites document and page in the decision. Then it proposes severity, resolution and an optional customer message. After that, it routes the decision through guardrails to auto execute or to the human approval queue. Finally, it opens a support ticket and, once approved, emails the customer a status update with a tracking link. It works with your store admin, shipping app, help desk and email, each on its own login with limited access.

You get the prep work done and waiting for you. The agent stops and asks for your yes before approving any decision the guardrails do not clear, before the ticket and customer email are sent, and says plainly if a step cannot be undone.

“queue the decision for human approval”
sandeshjung sandeshjung on GitHub · Oct 6, 2026
Before you startStore admin · Shipping app accessScoped permissionsLangGraph or OpenAI Agents SDK
Explore required tools and model recommendations

Tools and access

  • Shopify

    Handles the store admin part of this job. Grant read orders and products.

    API required: Yes. Needs a Shopify app with an access token and the admin scopes you approve.

  • ShipStation

    Handles the shipping app part of this job. Grant read order and shipment status.

    API required: Yes. Needs API credentials from your ShipStation account settings.

  • Zendesk

    Handles the help desk part of this job. Grant a limited agent seat that writes internal notes.

    API required: Yes. Needs an API token or OAuth client created by a Zendesk admin.

  • Gmail

    Handles the email part of this job. Grant read-only plus compose (drafts) scopes.

    API required: Yes. Needs a Google Cloud project with an OAuth app and the Gmail API turned on. The agent signs in through OAuth with only the scopes you pick.

Official links only. Not sponsored, no affiliate links.

Model recommendations

Best pick

Gemini 3.8 Flash

Built for agent workflows, with a free tier to test on.

$0.75 per million input tokens and $3.75 per million output tokens through December 31, 2026. $1.50 and $7.50 from January 1, 2027.

Google docs as of October 11, 2026

Cheaper backup

Gemini 3.5 Flash-Lite

Low cost for many listings at once.

$0.30 per million input tokens, $2.50 per million output tokens.

Google docs as of October 11, 2026

Our own picks. Not sponsored, no affiliate links.

Build your prompt

Add your details, then copy the prompt into your tool.

1Your details

Fill these in and the prompt updates as you type.

hours past the promised date

which severities need no human

2Your prompt

4 of 4 still empty
Fill these in before you run it: [DELAY THRESHOLD: hours past the promised date] [SHIPPING POLICY DOC] [AUTO APPROVE RULES: which severities need no human] [SUPPORT EMAIL SENDER] You are the Delayed order triage with approval queue agent. When an order is flagged late, the agent reads the order, shipment and customer records, looks up the shipping policy, and decides a severity and resolution with the evidence attached. Low risk cases run on their own and the rest wait in an approval queue before a ticket and customer email go out. Use only the details filled in above. If any [BRACKETED] item is still blank or unclear, stop and ask for it first. Do not guess. What you do on your own: - Investigates each delayed order with the order, shipment and customer records prefetched - Retrieves the relevant shipping policy and cites document and page in the decision - Proposes severity, resolution and an optional customer message - Routes the decision through guardrails to auto execute or to the human approval queue - Opens a support ticket and, once approved, emails the customer a status update with a tracking link What you must never do without a yes from a person: - Approving any decision the guardrails do not clear, before the ticket and customer email are sent Rules: - Before any step on the list above, stop and ask. Say in plain words what you want to do, who it affects, and whether it can be undone. - If something cannot be undone, say so first, in one short line. - Write drafts, not final actions. A person sends, pays, posts, or deletes. - Keep a short log of every action you took and every source you read. - If you are unsure, ask instead of guessing.
View run instructionsPaste into: LangGraph, OpenAI Agents SDK, n8n

Your answers stay in this browser only.

Run your workflow

Connect your tools with only the access this setup needs, then follow these steps.

Steps

Do these in order. Test on old data before it touches live work.

  1. 1Connect Shopify with its own login, not yours. Grant read orders and products.
  2. 2Connect ShipStation with its own login, not yours. Grant read order and shipment status.
  3. 3Connect Zendesk with its own login, not yours. Grant a limited agent seat that writes internal notes.
  4. 4Connect Gmail with its own login, not yours. Grant read-only plus compose (drafts) scopes.
  5. 5Paste the prompt where your harness takes instructions. See the note under the Copy button.
  6. 6Do a dry run on old or test data first. Check every draft and every stop point by hand before you let it near live work.
  7. 7Read its log after the first real run. Only widen access once a week of runs looks clean.

Safeguards and trust score

The score describes this example setup’s access, approval boundaries, ability to undo changes, and scope.

Access24 / 30

Writes drafts and notes inside your tools, nothing leaves on its own.

Human approval27 / 30

Waits for a yes on: approving any decision the guardrails do not clear, before the ticket and customer email are sent.

Undo and logs17 / 20

Leaves drafts you can throw away, with a record of what it made.

Scope16 / 20

Runs on its own login across 4 tools. Fewer connections means a smaller blast radius.

How to raise it

  • Human approval: Add a second named stop next to "approving any decision the guardrails do not clear, before the ticket and customer email are sent", so every step that leaves your hands waits for a yes, and have the confirm say plainly what cannot be undone +3
  • Scope: Cut it down from 4 connected tools to the 2 it needs most, each with its own limited login instead of your full account +2

Do all of these to reach 89, up from 84.

Want help getting there? Get an AI Trust Audit from Pixeldesigns

Reviewed by Trustcase (example setup). How scoring works

Embed badge

Show this trust score on your site or README. It links back here.

Trustcase trust score badge
Markdown
[![Trustcase trust score for Delayed order triage with approval queue](https://trustcase.dev/badge/delayed-order-triage-with-approval-queue.svg)](https://trustcase.dev/use-cases/delayed-order-triage-with-approval-queue)
HTML
<a href="https://trustcase.dev/use-cases/delayed-order-triage-with-approval-queue"><img src="https://trustcase.dev/badge/delayed-order-triage-with-approval-queue.svg" alt="Trustcase trust score for Delayed order triage with approval queue" height="20"></a>

Other workflows that use the same tools

  • Warranty replies that ask before they offer

    Support. A one person store has agents draft every customer email from the full thread and the order history. For a warranty problem the first reply only asks questions, and a hook blocks any draft that promises money or product until the owner approves that exact text.

  • Refund checker

    Support. Checks refund requests against your policy and lays out the facts.

  • Shop enquiry drafts with follow up dates

    Support. Every hour it reads new customer emails for a small shop, pulls that sender's orders, and saves a reply draft in the mailbox for the owner to send. It also tracks each enquiry and drafts a follow up when one goes quiet.