Skip to content
Examples / Document intake

Document intake.

Inspect captured documents, extract typed fields, surface missing evidence, and accept the result through an Action.

DriveDocumentExtraction candidateAccepted record

Inspect a path through the work.

Change the scenario to see the inputs, operations, and outcome. These are guided browser illustrations of repository reference products.

Document intake / agreement-003Guided example · sample data

Supplier agreement

Customer: Meridian Components
Amount: $2,500.00
Business status: approved

Evidence comes first.

The model-backed Function returns a defined result. Required fields must be supported by the document.

Producing a model result does not create an operational record.

Illustrative extraction · no document or model provider is called.Inspect extraction rules

What happens,
and why.

  1. 01

    Read the exact captured document and its normalization status.

  2. 02

    Route an unreadable document to an explicit failure outcome.

  3. 03

    Extract the customer, monetary amount, and business status.

  4. 04

    Keep the candidate and its receipt attached to the source evidence.

  5. 05

    Record the extraction through the declared acceptance Action.

When the conditions are no longer met.

Missing or ambiguous fields produce an explicit extraction failure. The model is instructed to use printed evidence rather than infer a value; the acceptance path remains separate from inference.

Inspect the implementation.

Process a captured document go
// Inspect captured documentdone_inspect_document := true_ = done_inspect_documentvar value_inspect_document module.Valueif done_inspect_document {value_inspect_document, err = module.Function("inspect_drive_document",module.MustObject(map[string]module.Value{"file_id":field(input,"file_id")}))if err != nil { return module.Value{},err }}// Route normalization outcomedone_route_normalization := (done_inspect_document)_ = done_route_normalizationselected_route_normalization := ""if done_route_normalization {selected_route_normalization = text(field(field(value_inspect_document,"value"),"normalization_status"))switch selected_route_normalization { case "normalized","failed": default: return module.Value{},fmt.Errorf("ExtractDriveDocument: unexpected route_normalization value %q", selected_route_normalization) }}// Extract normalized documentdone_extract_document := (selected_route_normalization == "normalized")_ = done_extract_documentvar value_extract_document module.Valueif done_extract_document {value_extract_document, err = module.Function("extract_drive_document",module.MustObject(map[string]module.Value{"file_id":field(input,"file_id")}))if err != nil { return module.Value{},err }}// Record extracted factsdone_record_extraction := (done_extract_document)_ = done_record_extractionif done_record_extraction {_,err = module.Action("RecordDriveExtraction",module.MustObject(map[string]module.Value{"amount":field(field(value_extract_document,"value"),"amount"),"customer":field(field(value_extract_document,"value"),"customer"),"document_status":field(field(value_extract_document,"value"),"document_status"),"extraction_status":field(field(value_extract_document,"value"),"extraction_status"),"failure_class":field(field(value_extract_document,"value"),"failure_class"),"file_id":field(input,"file_id")}),nil,target(field(field(value_extract_document,"evidence"),"candidate_receipt_id")))if err != nil { return module.Value{},err }}
Follow the developer learning path

The capabilities behind this example.

Bring us a process.
We'll build it with you.

A business process, the systems it touches, and the rules it needs to follow.