Delay Comms — Stage 2: the delay call request

When an item is late for the second or a further time, this automation raises a call request for Customer Service instead of sending the customer another message. Once a day it reads the delayed lines out of NetSuite, opens one request per order in Kustomer with the delayed items listed on it, and routes it to the trade team or the account management team. It then stamps those order lines as Stage 2 so the order's customer-facing message reads "Delayed" and the request is not raised again for the same slip. Nothing in it contacts the customer — a person makes the call.

Rules & IDs

Rule ID Rule Reading
LI-BL-CMS-005 Which delays are handled by a call Business logic
LI-BL-CMS-006 One request per order, every late item on it Business logic
LI-BL-CMS-007 Who the call lands with Business logic
LI-BL-CMS-008 Recording the call, and not asking twice Business logic
LI-BL-CMS-009 What stops, and what carries on Business logic

Project owner
Kim Hoang Nguyen
Developers
Yvonne Kotevski
Julian Ayoub
For department
Customer Service
Status
draft
Documented
created 2026-09-28 · updated 2026-09-28this registry entry
Script created / updated
created 2023-02-06 · updated 2026-06-15from GitHub
Verified against production
2026-09-28119f006 · 119f006 · 119f006 · 119f006 · 119f006 · 119f006 · 119f006
Systems touched
aws-lambdanetsuitekustomeraws-ses
Rules
Terms

Three readings of the same rules. Nothing is duplicated between them. Printing gives you the business reading followed by the diagrams.

What it does. Once a day it looks for order lines that are running late again, and for each order it raises a single call request for Customer Service, listing every late item on that order with what the customer was originally promised, what is now expected, what they were last told, and how many days late that is. It routes the request to whichever team owns that customer, and then records on each late line that a call has been scheduled. It does not write to the customer.

Why it exists. The first time an item slips the customer gets a message. The second time, a message is not enough — somebody has to ring them, because by then the conversation is about whether they still want the order. Doing that by hand means somebody reading a report and deciding who to call, which is the step that quietly stops happening in a busy week. When it goes wrong the cost is in two directions: a customer who is never called finds out their furniture is months late by noticing, and cancels; and a customer who is called twice about the same slip is told the company does not know what it has already said to them. The recording step matters as much as the call, because it is what makes the order's own status line read "Delayed" to everyone who looks at it afterwards.

Who it affects. Customer Service feels it first — the requests land in their queue and they make the calls. Trade customers are handled by a different team from retail customers, so both notice if the routing is wrong. The customer is affected but never contacted by the automation itself. Supply chain and anyone reading an order's status sees the consequence, because recording the call is what changes the message on the order line.

When it runs. Once a day on a schedule, at about half past one in the afternoon Sydney time — though the schedule itself sits outside the automation and has been read off its output rather than confirmed. A line becomes eligible through a saved search in NetSuite whose conditions have not been read, which is the largest gap in this entry: the threshold for "late enough", whether it is limited to overseas supply, and whether drop-ship lines are excluded are all properties of that search. What is established is that an order can come back roughly a month later when its expected date slips again.

How it decides.

  • It takes the late lines as a list and groups them by the order they belong to, so an order with four late items is one call request and not four.
  • Within an order it keeps one entry per item name, so the same item appearing twice does not appear twice on the request.
  • It finds or creates the customer in the service desk from the order's customer details, and if it cannot, it abandons that order and moves on to the next.
  • It reads that customer back to see whether they are a trade customer, and sends the request to the trade team if so and to the account management team otherwise.
  • It opens the request, attaches the list of late items to it, writes a note onto the sales order saying the request was raised, and stamps each late line as "call scheduled" together with the date the customer is now being told.
  • Every step is conditional on the one before it except the last: the stamp goes on even when the note onto the order failed.

Outcomes.

Outcome What the customer gets What the order gets
Request raised, everything recorded Nothing yet — a person calls them A note, and each late line stamped Stage 2 with the new date
Request raised, note onto the order failed Nothing yet — a person calls them Lines stamped Stage 2, but nothing on the order says why
Customer could not be found in the service desk Nothing Nothing. The order is skipped and named in the error email
Request could not be opened, or the item list could not be attached Nothing Nothing. The order is skipped and named in the error email
A row in the feed could not be read Nothing, for anybody Nothing, for anybody. The whole day's run is dropped and an error email is sent
Nothing was late Nothing Nothing, and no email at all

Which delays are handled by a call LI-BL-CMS-005

# If… Then… Because
1 A line appears in the delay feed It is a candidate for a call request The feed is the whole eligibility test. Nothing in the automation adds a condition of its own
2 The feed returns nothing The run ends, and no email is sent at all A quiet day and a broken feed look identical from outside. See DN-Q1
3 A row in the feed is missing a value the automation reads Every order in the run is dropped, and an error email is sent Deployed behaviour, not intent — defect DN-D4
4 The customer has not opted into marketing The request is raised anyway A call about a late order is service, not marketing
5 The customer cannot be found or created in the service desk That order is abandoned and named in the error email There is nowhere to raise the request against

One request per order, every late item on it LI-BL-CMS-006

# If… Then… Because
1 Several late lines belong to one order They become one request, listing each item One phone call covers the order. Four requests would mean four calls to the same person
2 Two rows name the same item, differing only in capitals The item is listed once The same product against two lines is one thing to talk about
3 Two rows name genuinely different items Both are listed, numbered, in the order the feed returned them The agent needs the whole picture before dialling
4 An item is listed It carries what was promised, what is now expected, what the customer was last told, and the days late Those four dates are what the conversation is about
5 The request is named It is named for the order, as "Stage 2: Delay Call Request" and the order number It is how the agent ties the request back to the order

Who the call lands with LI-BL-CMS-007

# If… Then… Because
1 The service desk holds the customer as trade The request goes to the trade team Trade customers have a different relationship and a different team holds it
2 The service desk holds any other customer type The request goes to the account management team It is the default owner of a retail delay conversation
3 The service desk holds no customer type at all The request goes to the account management team The default is applied rather than the order being held
4 The customer cannot be read back from the service desk The request goes to the account management team, and the run reports success Deployed behaviour, not intent — defect DN-D5. A trade customer is silently misrouted
5 The order's own customer type in the ERP says trade It makes no difference to routing Routing reads the service desk's view of the customer, never the order's

Recording the call, and not asking twice LI-BL-CMS-008

# If… Then… Because
1 The request and its item list were both created Each late line is stamped "call scheduled", and the date the customer is now being told is written onto it The stamp is what makes the order read "Delayed" to everyone else, and the date is the record of what was said
2 The same line slips again later It can come back for a new request The stored date is what a later run compares against, so a further slip is a new conversation
3 The line's identifier matches no line on the order Nothing is stamped, and the run still reports the lines as updated Deployed behaviour, not intent — defect DN-D1
4 The write into the ERP fails The run still reports it as updated, and the line keeps its old stage Deployed behaviour, not intent — defect DN-D1. The order is eligible again on the next run
5 The automation runs twice in one day over the same line Two requests are raised Nothing checks for an existing request. The only guard is the stamp, and it has not landed yet — defect DN-D6

What stops, and what carries on LI-BL-CMS-009

# If… Then… Because
1 The customer could not be resolved The order stops there — no request, no note, no stamp There is no customer to raise it against
2 The request could not be opened The order stops there — no note, no stamp A note and a stamp with no request would tell Customer Service nothing
3 The item list could not be attached The order stops there — no note, no stamp A request with no items is not actionable
4 The note onto the sales order failed The run carries on and stamps the lines anyway Deployed behaviour, not intent — defect DN-D3. The order looks as though nothing was raised
5 Any order in the run failed at any step An error email is sent, and no success email The two emails are exclusive: one failure anywhere replaces the whole summary
6 Every order succeeded A success email lists each order and each step against it It is the only record of what the run did, outside the systems themselves

Field registry

Every field this automation reads or writes, by the name it carries in the system — what it means, and what changes when it changes. Field ids are in the developer reading.

Inputs — what it reads

Values the automation looks at to make its decision. Change one of these and the decision changes.

FieldWhat it meansWhat it changesStatus
Internal IDSales Order The sales order the delayed lines sit on. The grouping key. Every row carrying the same value becomes one call request, so a wrong value here splits or merges requests. confirmed
Order NumberSales Order The order number a person quotes — the NetSuite document number, or the Shopify number for web orders. Printed into the conversation name, the note and the audit log. It is the only order identifier the agent making the call sees. confirmed
Line IDSales Order line Which line of the order is delayed. The only thing the line-item write matches on. A line id that does not match any line on the order is skipped silently, and that line is never stamped. confirmed
ProductSales Order line The item name as the customer would recognise it. Deduplicates the items on a request — two rows with the same name, differing only in case, become one item. Also the item list in the note and the audit log. confirmed
Expected Ship DateSales Order line When the line is currently expected to ship. Printed in the note, and written back as the new Delay Ship Date. It is therefore both what the agent is told and what suppresses the next request. confirmed
Delay Ship DateSales Order line The ship date last communicated to the customer about this line. Read as "last delay comm date" for the note, then overwritten with the current Expected Ship Date. The gap between the two is what a later run can compare, so this field is the brake on the request repeating. confirmed
Original Lead TimeSales Order line The ship date the customer was promised when they ordered. A date, not a number of days, despite the label. Printed in the note as the baseline the agent quotes. Written by LI-BL-ORD-001. confirmed
Days DelayedSales Order line How many days later than promised the line is now expected. Printed in the note. Whether it also gates eligibility is a property of the feed search, which has not been read — see DN-Q3. confirmed
Customer Internal IDCustomer The NetSuite customer behind the order. The key the customer-resolution service matches a Kustomer customer on. Without a resolved customer the request is abandoned. confirmed
Customer TypeCustomer What kind of customer this is — retail, trade, and so on. Passed to the customer-resolution service. Note that team routing does NOT read this field; it reads the type held in Kustomer instead. confirmed
needs confirmingKustomer customer needs confirming The single field that decides which team the call lands with. The exact value `trade` routes to Trade Enquiries; anything else, including a missing value or a failed read, routes to Account Management. needs confirming
Email AddressCustomer The customer's email address. Passed to the customer-resolution service, which uses it to find or create the Kustomer customer. confirmed
Customer PhoneCustomer The number the call will be made on. Passed to the customer-resolution service and held on the Kustomer customer. This is a call request, so a wrong number makes the whole request undeliverable. confirmed
Customer First NameCustomer The customer's first name. Passed to the customer-resolution service. confirmed
Customer Last NameCustomer The customer's last name. Passed to the customer-resolution service. confirmed
Name1Customer needs confirming Sent as the customer-resolution service's entity id. Its label is read, not its value, so a renamed entity changes what is sent. needs confirming
Customer Company NameCustomer The company on the customer record, where there is one. Passed to the customer-resolution service. The literal text "none", in any punctuation or casing, is treated as empty rather than as a company called None. confirmed
Customer Fax IDCustomer needs confirming Passed to the customer-resolution service, with the same "none" means empty handling as the company name. What this field is actually used for is not established — see DN-Q5. needs confirming
Customer Initial Contact ChannelCustomer needs confirming Passed to the customer-resolution service as a label. needs confirming
Customer Shopify StoreCustomer needs confirming Passed to the customer-resolution service as a single-element list of the label. needs confirming
Customer Application ApprovalCustomer needs confirming Passed to the customer-resolution service as the trade application approval, with "none" treated as empty. Not used for team routing. needs confirming
Customer Accepts MarketingCustomer Whether the customer has opted into marketing. Passed to the customer-resolution service. It does not gate this automation — a delay call request is raised regardless, because it is a service contact rather than marketing. confirmed
Customer Address Line 1 / Line 2 / City / State / ZipCustomer The customer's address, sent as one default shipping address. Passed to the customer-resolution service. The country is always sent as AU and the suburb always blank, whatever the order says; both are hard-coded. confirmed

Outputs — what it writes

Values the automation puts back. Everything downstream of this rule reads them, so a wrong value here travels.

FieldWhat it meansWhat it changesStatus
Delay Ship DateSales Order line The ship date last communicated to the customer about this line. Read as "last delay comm date" for the note, then overwritten with the current Expected Ship Date. The gap between the two is what a later run can compare, so this field is the brake on the request repeating. confirmed
Delay CommsSales Order line Which stage of delay communication has happened on this line. Set to value 2, Stage 2: Delay Call Scheduled. Read by the Item Stage automation to decide whether the customer-facing message says "Delayed", and by the delay reporting. Writing it is what records that the call was raised. confirmed