- A NetSuite scheduled script finds inbound email/custom-record rows that need processing.
- NetSuite sends email metadata, body text, and optional file content to an Erstan OCR agent.
- Erstan extracts and validates the quote/order request.
- NetSuite polls for a structured result.
- NetSuite creates a pending quote/estimate or alerts a user when required fields are missing.
Recommended agent setup
Create or install a published OCR quote-intake agent. Recommended form fields:
The agent should be instructed to return JSON. A practical output contract is shown below.
Discover the OCR lane
Use the agent detail endpoint to confirm the lane ID, input schema, and attachment support.defaultLaneId, NetSuite can omit laneId when starting a run. If the agent has multiple lanes, send the selected lane ID in the run request.
POST with email body only
Use this shape when there is no attachment, or when the email body contains enough detail.POST with optional attachment
Useattachments when NetSuite has an attached PDF, image, spreadsheet, or email body export. Each attachment needs name, type, and base64.
input or metadata.
Poll until complete
Expected structured result
For automation, configure the OCR agent to return a single JSON object infinalResponse.
NetSuite scheduled script outline
UseidempotencyKey to make retries safe. A good key is the source custom record ID plus the attachment ID or last modified timestamp.
completed, NetSuite can:
This keeps the risky decisions visible while still automating the expensive OCR, parsing, and matching work.