Skip to content

Document collection

A loan or onboarding case needs several documents. Ask the customer for them, wait until your document portal reports each upload, send reminders when the customer is late, and have a back-office person verify each document. Move the case on only when every document is verified.

Your document portal tells NuacemOne about uploads with a business event, and the customer is messaged through an MCP tool on your messaging service.

  1. API / webhook: input fields caseRef, customerName, phone (phone), uploadLink, plus a documents list sent in the body. Duplicate key caseRef.
  2. MCP tool: send_whatsapp_template with to = input.phone, template = "documents_needed", list = join(input.documents, ", "), link = input.uploadLink.
  3. For each: list input.documents, call each item doc, run items in parallel (up to 5 at a time), if an item fails collect, store results as reviews. For each document:
    1. Wait for event upload: event document.uploaded, correlation keys caseRef, only events where event.documentType == doc, time out after 48h.
      • received: go to step 3.4.
      • timeout: go to step 3.2.
    2. MCP tool: send_whatsapp_template with template = "document_reminder", document = doc.
    3. Wait for event: the same event and filter, time out after 72h.
      • received: go to step 3.4.
      • timeout: an Escalation to Onboarding with reason {{ input.customerName }} has not sent {{ doc }}, then back to step 3.3.
    4. Human task: role Document reviewer, instructions Check {{ doc }} for case {{ input.caseRef }}., SLA 8h, outcomes verified, rejected, form field note (text).
      • verified: the item ends here.
      • rejected: MCP tool send_whatsapp_template with template = "document_rejected", then back to step 3.3.
  4. MCP tool: your case system, tool mark_documents_complete, caseRef = input.caseRef.
  5. Audit checkpoint: evidence name documents_verified, evidence caseRef = input.caseRef, reviews = reviews.
  6. End: outcome documents_complete.

Each loop back passes through a Wait for event, which is what lets the builder accept it.

Start the case:

{
"input": {
"caseRef": "LN-24017",
"customerName": "Divya",
"phone": "+919800000000",
"uploadLink": "https://docs.example.com/u/LN-24017",
"documents": ["pan_card", "address_proof", "salary_slip"]
},
"correlation": {"caseRef": "LN-24017"}
}

Your portal sends one event per upload to POST https://api.nuacem.dev/workflow-api/public/v1/events:

{
"eventName": "document.uploaded",
"eventId": "upl-99120",
"correlation": {"caseRef": "LN-24017"},
"data": {"caseRef": "LN-24017", "documentType": "salary_slip", "fileId": "f-7731"}
}
  • For each waits for every document at the same time. Each item has its own wait, reminder and review, so a late salary slip does not hold up the review of the PAN card.
  • Wait for event uses the case reference to find the run and the Only events where filter to pick the right document.
  • The reminder goes once after 48 hours. After a further 72 hours a person is asked to follow up.
  • The Human task asks a reviewer to verify each document. A rejection tells the customer and waits for a new upload.
  • The run moves on only when every item has finished. The Audit checkpoint records the reviewers’ results.
  1. In Test workflow, start from the API trigger with the payload above and Hours as seconds. Point the MCP tools at sandbox servers.
  2. In Waiting on you, send document.uploaded for pan_card with caseRef and documentType in the data. A review task appears; mark it verified.
  3. Let salary_slip time out to see the reminder, then reject one document to see the loop.
  • One reviewer for the whole case: drop the per-item Human task and add one after the For each, with a form listing every document.
  • Built-in forms (beta): use a Collect form for details that are not files. Test it end to end in the test window first.
  • Call when late (beta): replace the Escalation with an Outbound call by a voice agent.
  • Sequential checks: set the For each to run items one at a time when documents must be checked in order.