NetSuite Approvals in Teams
Asks each approver in Teams, writes their decision back into NetSuite as them, and keeps an audit trail.
When NetSuite posts an approval event to the agent's webhook
Passes in: record_type, record_id, next_approver, pending_since, state
Read the record, its approval history and its attachment list
Remembers: record, history, attachments
Repeat for each approval level · until record.state in ['Approved', 'Rejected'] (usually 1-4 levels)
Find who approves next, and their Teams account
Remembers: approver, teams_user
Ask the approver in Teams to approve, reject or comment
Decides: approve · reject · comment
If approved
Record the approval in NetSuite, as the approver
If rejected
Record the rejection with the reason, then tell the requester in Teams
If comment
Add the comment in NetSuite and notify the requester in Teams
Moves on when step 3 re-reads the record and finds a new approver.
Tell the requester the final outcome in Teams and close every open card
Write the audit entry: each level, who decided, where, and the NetSuite system note
