4 ready-to-build workflows

AI agent workflows for Microfinance & SHG group lending

Run centre meetings, collection reconciliation and repayment-stress early warning in the borrower's own language — with every credit decision, waiver and posting left to a human.

Each recipe below is expressed only in VegaDūta's real workflow building blocks — Trigger, Agent, Knowledge, Condition, Approval, Output, Tool (MCP), Voice, Device, Loop, Code and Parallel — so it maps 1:1 to something you can assemble in the Workflow designer. Consequential actions always pass a human Approval step.

1. Centre / SHG meeting reminders and attendance capture, in local language

Today: the field officer sits down at 8pm the night before with the branch register and her own phone, and calls or WhatsApps eight group leaders one at a time — some pick up, some don't, and she has no record of which. At the meeting she ticks names on a printed attendance sheet on a clipboard, folds it into her bag, and rides to the next centre. That evening (or Friday, if the week is bad) a branch assistant types twelve of those sheets into an Excel file, guessing at two names that smudged in the rain. Nobody notices that the Tuesday centre has not actually met for three weeks until the month-end MIS is pulled.

Trigger: Webhook (meeting calendar from the LMS) / scheduled run

How the workflow runs

  1. Trigger

    Tomorrow's centre meetings are listed. A scheduled Webhook trigger brings in the next day's centre/SHG meeting schedule. The LMS has no first-party connector — a Tool (MCP) node fetches the meeting calendar, the centre roster and each group's recorded language.

  2. Loop

    Fan out per centre. A Loop node iterates each centre so one cheap agent pass drafts that centre's reminder — a 40-centre branch is handled exactly like a 4-centre one, and the officer's evening of phone calls disappears.

  3. Agent

    Draft the reminder in the group's language. An economy-tier agent composes a short reminder — centre name, meeting place, time, what to bring (passbook, savings) — in the group's recorded language, grounded in the meeting SOP in a scoped Knowledge collection. It states facts only; it never mentions amounts due, penalties or any consequence of non-attendance.

  4. Output

    Send on WhatsApp + voice note. An Output node sends the text to the group leader on WhatsApp and, for low-literacy groups, an ElevenLabs/Sarvam voice note in the local language on the same thread — inside the permitted contact-hour window only, and logged per centre so 'did she get the reminder?' is answerable.

  5. Voice

    Capture attendance by voice at the centre. A Voice node lets the field officer dictate attendance and meeting notes in her own language, standing at the centre; Sarvam transcribes and the agent maps spoken names to member ids, marking anything uncertain rather than guessing. The clipboard sheet stops being the system of record.

  6. Code

    Band the centre's attendance. A Code node calls the society's own user-defined SpEL tool to label the meeting HEALTHY / WATCH / CRITICAL from the roster and present counts — deterministic arithmetic, no model involved, and the thresholds are the branch's own.

  7. Approval

    Officer confirms the register. An Approval node shows the mapped attendance register and its band back to the field officer for confirmation — the attendance record is an official document, so a human signs it off before anything is written.

  8. Output

    File the register + flag silent centres. On confirmation a Tool (MCP) node posts the register to the LMS, and centres that missed their meeting are listed for the branch manager the same day — not chased automatically, and not discovered at month-end.

Channels & connectors

  • Webhook
  • WhatsApp
  • Voice / Call
  • ElevenLabs (voice)
  • Sarvam (Indian languages)
  • Knowledge base
  • Approval / HITL
  • Tool (MCP → LMS)

Outcome

Every centre gets a same-language reminder the evening before without the officer making a single call, and the attendance register exists as structured, banded data before she gets home — instead of a clipboard sheet typed up on Friday.

Why it helps

The mechanism is timing and language, not persuasion: reminders reach the group leader on the channel they already use, in the language they actually speak, and attendance is captured by voice while the officer is still standing at the centre — so a centre that has stopped meeting surfaces within a day rather than in the month-end MIS.

Build spec

2 agents1 reminder drafter (runs once per centre via the Loop node) + 1 attendance mapper (runs once per meeting transcript). Loop / Voice / Code / Approval are workflow nodes. · Pattern: Loop fan-out for reminders → voice capture → mapper → SpEL banding in a Code node → human confirms the register

System prompt (paste-ready)

(Reminder drafter) Write ONE short meeting reminder for a microfinance centre/SHG group. You are given {centre_name, meeting_place, meeting_time, group_language, items_to_bring[]}. Write in group_language, at a primary-school reading level, under 40 words. State ONLY: which centre, where, when, what to bring. You must NOT mention any amount due, arrears, penalty, interest, or any consequence of not attending — this is a meeting reminder, not a collection message. Do not add greetings that name individual members. Return {text, tts_text} where tts_text is the same message written to be read aloud naturally.

Agent roles & model tiers

  • Reminder drafter (per centre) Economy tier, with a fallback model configured for provider outages — runs once per centre every meeting day, so this routing choice dominates total cost

    Compose one short, factual, local-language meeting reminder from the given fields. No amounts, no arrears, no consequences, no invented details. Return text + a read-aloud variant.
  • Attendance mapper (per meeting) Standard tier, fallback configured — matching real names out of noisy field-recorded speech is the one step that needs the reasoning

    From a Sarvam transcript of the officer's spoken attendance, map each spoken name to a member id in the supplied centre roster. Return {present[], absent[], unmatched[]}. If a spoken name is ambiguous or not clearly on the roster, put it in unmatched with the raw text — never guess a member id, and never mark someone present who was not clearly named.

MCP connectors

  • LMS / loan-management system — via Tool (MCP): fetch tomorrow's centre meeting calendar, the centre roster and each group's recorded language
  • LMS / loan-management system — via Tool (MCP): post the officer-confirmed attendance register, keyed to (centre id, meeting date)
  • WhatsApp — deliver the reminder text and the voice note to the group leader's existing thread
  • Sarvam — transcribe the officer's spoken attendance and render the reminder in the group's language

Built-in tools

  • knowledge_search (centre-meeting SOP, group roster and recorded language — scoped Knowledge collection)
  • http_request (read the meeting schedule; post the confirmed register)
  • user-defined tool `centre_attendance_band` (SpEL): input.rosterSize == 0 ? 'NO_ROSTER' : (input.presentCount * 100 / input.rosterSize >= 80 ? 'HEALTHY' : (input.presentCount * 100 / input.rosterSize >= 50 ? 'WATCH' : 'CRITICAL')) — a tenant-authored formula tool, not a script: it does arithmetic on the tool input and returns a label. The branch encodes ITS OWN attendance thresholds (a 12-member SHG and a 30-member JLG centre are judged differently) without a developer or a redeploy, and because it is deterministic the same counts always produce the same band. It only labels a meeting — it never touches a member's loan.

Guardrails

  • No credit decision, ever: this workflow schedules and records attendance only — it never approves, rejects, re-prices or disburses anything, and any credit judgement belongs to a human at an Approval node
  • Reminders are meeting notices, not collection messages — the drafter is forbidden from mentioning dues, arrears, penalties or consequences, and outbound sends respect the permitted contact-hour window, a per-group frequency cap and any opt-out already recorded
  • The attendance register is written only after the field officer confirms it at the Approval node; unmatched names stay unmatched rather than being guessed onto a member id
  • The `centre_attendance_band` SpEL tool classifies a meeting only — a CRITICAL band is a prompt for a human to look, never an action against a group or a member
  • The register post is idempotent per (centre id, meeting date) so a re-run never duplicates or overwrites a confirmed register

Cost strategy

Cost is N centres × (economy-tier drafter, hard token cap) + one standard-tier mapper per meeting actually held. The drafter is the high-volume step and must stay on the economy tier — a 40-word factual reminder from structured fields needs no reasoning budget — and a fallback model is configured so a provider outage degrades the tier rather than stopping tomorrow's reminders. The mapper is the genuinely hard step (noisy speech, real names) and is the only place the standard tier is justified. The SpEL banding costs nothing at all: it is arithmetic in a Code node, not a model call. Run the reminder loop in Parallel batches for wall-clock speed without changing per-centre cost.

Output & delivery

Loop drafts one cheap local-language reminder per centre → an Output node delivers it on WhatsApp as text plus an ElevenLabs/Sarvam voice note inside the contact-hour window → after the meeting a Voice node captures spoken attendance → the mapper matches names to member ids → a Code node applies the society's `centre_attendance_band` SpEL tool → the field officer confirms at the Approval node → a Tool (MCP) node files the register in the LMS and lists silent centres for the branch manager the same day.

2. Centre-collection reconciliation — variances prepared, never posted

Today: field officers come back to the branch between 5 and 7pm, each with a cash bag and a carbon-copy collection sheet. The cashier counts the cash, the operations assistant sits with three things open — the paper sheets, the LMS demand report printed that morning, and a calculator — and ticks lines until the totals agree. When ₹40 refuses to reconcile at 8:30pm, it gets 'adjusted' with a note in the margin, and the officer is told to check with the member tomorrow (which nobody tracks). The margin notes surface a year later in an internal audit as a finding.

Trigger: Webhook (collection sheet + LMS demand file, end of collection day)

How the workflow runs

  1. Trigger

    Day's collections close. A scheduled Webhook trigger fires when the day's centre collection sheets and the LMS demand/receipt file are available. Neither the LMS nor the core banking system has a first-party connector — both are read via Tool (MCP) nodes.

  2. Code

    Deterministic match first. A Code node does the arithmetic — per-centre and per-member match of demand vs collected vs cash-remitted — in plain code, replacing the calculator and the ticking. Money must never be totalled by a language model; the agent only explains what the code found.

  3. Code

    Band the variance with the branch's own rule. The same Code node applies the society's user-defined SpEL tool to label each unmatched line MATCHED / MINOR / ESCALATE against ITS OWN tolerance — the tolerance that used to live in the operations assistant's head is now an editable, auditable expression.

  4. Loop

    Explain each unmatched line. A Loop node runs a cheap agent over only the lines the Code node could not match — matched lines never touch a model at all.

  5. Agent

    Classify the variance. The agent returns strict JSON per unmatched line — likely cause (SHORT_COLLECTION / ADVANCE_PAID / WRONG_MEMBER_CREDITED / SHEET_ENTRY_ERROR / CASH_IN_TRANSIT / UNKNOWN), the evidence it used and what a human should check. It proposes; it never adjusts. This is the margin note, made structured and assigned an owner.

  6. Agent

    Roll up the day. A reducer agent produces the branch's evening reconciliation summary — total matched, total in variance, the centres driving it, and the check-list for tomorrow's field visit.

  7. Approval

    Branch manager approves every adjustment. An Approval node holds each proposed adjustment, waiver or re-credit individually for the branch manager — nothing touches a member's ledger, and no money moves, without an explicit human decision that is recorded against their name.

  8. Output

    Post approved entries + file the summary. A Tool (MCP) node posts only the approved entries to the LMS/core banking system and send_email files the signed reconciliation summary to the branch manager and internal audit; everything else stays a tracked open item instead of a margin note.

Channels & connectors

  • Webhook
  • Knowledge base
  • Approval / HITL
  • Tool (MCP → LMS / core banking)
  • Email
  • WhatsApp

Outcome

Every centre reconciles the same evening without a calculator and three printouts, each unmatched rupee has a named likely cause and an owner, and no ledger entry exists without a branch manager's recorded approval.

Why it helps

The mechanism is separation of duties made cheap: deterministic code does the arithmetic the assistant used to do by hand, a tenant-authored tolerance rule bands the exceptions, the model only explains them, and the human decision moves from 'reconcile forty centres' to 'approve the handful of variances' — which is what makes same-day reconciliation survivable and leaves an audit trail where the margin note used to be.

Build spec

2 agents1 variance explainer (runs once per unmatched line via the Loop node) + 1 reducer (runs once per branch-day). The matching arithmetic and the tolerance banding are Code nodes, not agents. · Pattern: Deterministic Code match + SpEL banding → map cheap agent over exceptions only → reduce → human approves each adjustment

System prompt (paste-ready)

(Variance explainer) Explain ONE unmatched collection line. You are given {centre_id, member_id, demand_amount, collected_amount, remitted_amount, variance_band, sheet_notes, recent_ledger_lines[]}. Return strict JSON {likely_cause (SHORT_COLLECTION|ADVANCE_PAID|WRONG_MEMBER_CREDITED|SHEET_ENTRY_ERROR|CASH_IN_TRANSIT|UNKNOWN), evidence, suggested_check, confidence (LOW|MED|HIGH)}. Do NOT compute or restate totals — the amounts given to you are authoritative and were computed in code. Do NOT propose a waiver, a write-off, an interest change or a ledger entry: your output is a hypothesis for a human to check. If the evidence does not support a cause, return UNKNOWN with confidence LOW rather than a plausible guess.

Agent roles & model tiers

  • Variance explainer (per unmatched line) Economy tier with a configured fallback model — runs once per exception, the volume step and therefore the cost lever

    Classify one unmatched line into schema-valid JSON with a likely cause, the evidence and a suggested human check. Never recompute money. Never propose a waiver or ledger entry. UNKNOWN beats a plausible guess.
  • Reducer (once per branch-day) Standard tier, fallback configured — one call a day, where synthesis and prioritisation actually earn the spend

    Aggregate the classified variances into an evening reconciliation summary: totals as supplied by the Code node, the centres driving the variance, the items needing a field check tomorrow, and anything repeating across days. Use only the supplied figures; never estimate or extrapolate.

MCP connectors

  • LMS / loan-management system — via Tool (MCP): fetch the day's demand and receipt file per centre
  • Core banking system — via Tool (MCP): fetch the branch cash-remittance entries for the collection date
  • LMS / core banking — via Tool (MCP): post ONLY the branch-manager-approved adjustment entries, keyed per line id
  • Email — deliver the signed reconciliation summary to the branch manager and internal audit

Built-in tools

  • knowledge_search (reconciliation SOP, variance-tolerance and escalation rules — scoped Knowledge collection)
  • http_request (pull demand/receipt/remittance files; post approved entries)
  • send_email (file the signed evening reconciliation summary for audit)
  • user-defined tool `variance_band` (SpEL): (input.variance < 0 ? -input.variance : input.variance) == 0 ? 'MATCHED' : ((input.variance < 0 ? -input.variance : input.variance) > input.escalateAbove ? 'ESCALATE' : 'MINOR') — a tenant-authored formula tool: it takes the absolute variance from the tool input and compares it to the branch's own threshold, also passed in. No API call, no loop, no code execution — just arithmetic and a ternary. The society changes its own tolerance in the tool definition rather than filing a change request, and because the same expression runs on every line the tolerance is applied identically at every branch. It labels a line; a human still approves any adjustment.

Guardrails

  • No credit decision and no money movement: the agents classify and summarise only — every adjustment, waiver, re-credit or write-off is approved individually by the branch manager at the Approval node before any ledger or banking system is touched
  • All arithmetic is done in a Code node (plus the deterministic `variance_band` SpEL tool); the model is explicitly forbidden from computing or restating amounts, so no total in this workflow was ever produced by a language model
  • The SpEL tool only bands a variance — an ESCALATE label routes a line to a human faster, it never authorises an adjustment, a waiver or a posting
  • Schema validation on every explainer output — a malformed or low-confidence line is escalated as an open item, never auto-classified into an adjustment
  • Posting is idempotent per (branch, collection date, line id) so a re-run cannot double-post an approved entry, and the full proposal-to-approval trail is retained for audit
  • Nothing in this workflow contacts a borrower — variance follow-up is a field-officer task; any borrower contact happens through the early-warning recipe under its contact-hour, frequency and opt-out rules

Cost strategy

Only unmatched lines reach a model, so the bill scales with the exception rate, not with book size: matched lines cost zero tokens, and the SpEL banding costs nothing because it is an expression, not a call. The explainer runs at exception volume and must be economy tier with a hard cap and a fallback model; exactly one standard-tier reduce runs per branch-day and is where the reasoning budget goes. If exception volume spikes, batch the explainer through a Parallel node — same per-line cost, better wall-clock.

Output & delivery

A Code node matches demand vs collected vs remitted deterministically and applies the branch's `variance_band` SpEL tool → the Loop maps a cheap explainer over unmatched lines only → the reducer produces one branch-day reconciliation summary → the branch manager approves each proposed adjustment individually at the Approval node → a Tool (MCP) node posts only approved entries to the LMS/core banking system and send_email files the summary for audit, leaving everything else as a tracked open item.

3. Loan-file document completeness pre-check before the credit officer's visit

Today: the group leader collects photocopies from ten members into a plastic folder over a week — Aadhaar, ration card, the group resolution, savings passbooks. The credit officer rides 40km on a two-wheeler for the appraisal visit, opens the folder in someone's courtyard, and finds one photocopy is a black rectangle, one member's address proof is her husband's, and the resolution page is unsigned. She notes it in a diary, rides back, and the group is told to try again next fortnight. Two of the ten members have found money elsewhere by then.

Trigger: WhatsApp / Webhook (documents submitted for a group loan application)

How the workflow runs

  1. Trigger

    Documents come in. A WhatsApp trigger catches photos of documents sent by the group leader or field officer — the same phone camera that already takes them — and a Webhook covers files pushed from the LOS. The LOS and eKYC provider have no first-party connector; they are reached via Webhook in and Tool (MCP) out.

  2. Knowledge

    Load the checklist for this product. A Knowledge node scoped to the lender's product policy supplies the exact document checklist for this loan product and group type — per member and per group — so completeness is judged against documented policy, not the model's memory or the officer's recall.

  3. Loop

    Check each submitted document. A Loop node runs a cheap vision-capable agent once per photo: is it the right document type, is it legible, is it signed/dated where required, does the name on it match the member record? The black-rectangle photocopy is caught the day it is sent, not in the courtyard.

  4. Agent

    Assemble the gap list. A second agent compares what was received against the checklist and produces a per-member gap list — missing, illegible, unsigned, name-mismatch — with a plain-language ask for each gap.

  5. Code

    Label the file's readiness. A Code node applies the lender's user-defined SpEL tool to turn the gap counts into a single readiness label the branch can sort on — the lender's own definition of 'ready enough to travel for', editable without a deployment.

  6. Condition

    File complete?. A Condition node branches: a complete file goes forward for the officer's visit; an incomplete one goes back for exactly the missing items — one clear request, not the fishing expedition a diary note turns into.

  7. Output

    Ask for the gaps in local language. An Output node sends the specific outstanding items to the group leader on WhatsApp, with a Sarvam/ElevenLabs voice note version so a low-literacy leader can act on it without finding someone to read it to her.

  8. Approval

    Officer confirms the file is visit-ready. An Approval node puts the completeness verdict in front of the credit officer — the agent asserts only that documents are present and legible; whether the file is fit to appraise, and every credit judgement that follows, is the human's call.

Channels & connectors

  • WhatsApp
  • Webhook
  • Knowledge base
  • Sarvam (Indian languages)
  • ElevenLabs (voice)
  • Approval / HITL
  • Tool (MCP → LOS / eKYC)

Outcome

The officer travels only to files that are actually complete, and the group gets one precise, understandable request for what is missing instead of a fortnight's delay and a second trip.

Why it helps

The mechanism is moving the completeness check off the field visit and into the week before it: presence, legibility and signature are objective, checkable facts a model can verify against a documented checklist — so the scarce, expensive thing (a 40km ride and the officer's credit judgement) is spent only where it can succeed.

Build spec

2 agents1 per-document checker (runs once per submitted photo via the Loop node) + 1 gap-list assembler (runs once per application). The checklist lives in a scoped Knowledge collection; the readiness label, the branch and the sign-off are workflow nodes. · Pattern: Loop map over documents → assemble gaps → SpEL readiness label → clarify once → human confirms visit-readiness

System prompt (paste-ready)

(Document checker) Inspect ONE submitted document image for a group-loan application. You are given the expected checklist entry {doc_type, must_be_signed, must_show_name, member_name} and the image. Return strict JSON {matches_expected_type (bool), legible (bool), signed_where_required (bool|null), name_on_document, name_matches (bool|null), issues[]}. Judge ONLY what is visible. Never transcribe or store a full identity number — report the last 4 characters at most. If the image is unclear, set legible=false with the reason; do not infer content you cannot read. You are checking that a document is present and readable — you are NOT assessing creditworthiness, income, or whether the loan should be granted.

Agent roles & model tiers

  • Document checker (per document) Economy tier with vision, fallback model configured — runs once per photo across every application, so it is the dominant cost line

    Verify one document image against its expected checklist entry: right type, legible, signed where required, name match. Strict JSON, visible evidence only, never a full identity number, no credit assessment.
  • Gap-list assembler (per application) Standard tier, fallback configured — reconciling thirty per-photo results against a product checklist is the one step worth the reasoning

    Compare the per-document results against the product's documented checklist for this group and produce a per-member gap list {member, missing[], illegible[], unsigned[], name_mismatch[]} plus one plain-language request per gap, written for a low-literacy reader. State completeness as a fact about documents only — never as a recommendation to lend.

MCP connectors

  • LOS / loan-origination system — via Tool (MCP): fetch the application, its member list and the product code
  • Core banking / member master — via Tool (MCP): fetch each member's recorded name and address for the name-match check
  • KYC / eKYC provider — via Tool (MCP): check whether a submitted identity document already has a valid verification on record
  • LOS — via Tool (MCP): attach the completeness report and the officer's visit-ready confirmation to the application
  • WhatsApp — receive document photos and send the single consolidated gap request
  • Sarvam — phrase the gap request in the group's language and voice it

Built-in tools

  • knowledge_search (per-product document checklist, group-formation policy — scoped Knowledge collection)
  • http_request (read application/member records; attach the completeness report to the file)
  • user-defined tool `file_readiness_label` (SpEL): input.missingCount + input.illegibleCount == 0 ? 'VISIT_READY' : (input.missingCount + input.illegibleCount <= input.oneMoreRoundThreshold ? 'ONE_MORE_ROUND' : 'NOT_READY') — a tenant-authored formula tool: field arithmetic plus a ternary over the tool input, nothing more. The lender sets its own threshold for what is worth travelling to, and branches sort their pipeline on a label everyone defines the same way. It describes a folder's paperwork state — it says nothing about the member and decides nothing about the loan.

Guardrails

  • No credit decision, ever: this workflow verifies that documents are present, legible and signed — it never scores, rates, approves, rejects, prices or recommends a loan, and the appraisal decision is the credit officer's alone at the Approval node
  • The `file_readiness_label` SpEL tool classifies paperwork completeness only — VISIT_READY means the folder is complete, never that the group is creditworthy
  • Identity data minimisation: the checker reports at most the last 4 characters of any identity number, never a full number, and document images are handled under the tenant's retention policy
  • Gaps are requested exactly once per round through a single consolidated message — no repeat chasing, contact-hour window respected, opt-out honoured, and the group leader can always ask for a human instead
  • Completeness is asserted only against the checklist in Knowledge — the model may not invent a required document or waive one, and an unclear image is reported as unclear rather than inferred

Cost strategy

The per-document checker is the volume step (a ten-member group file is easily thirty photos), so it stays on an economy vision tier with a hard cap, a downscaled image and a fallback model — this single routing choice sets the bill. Exactly one standard-tier assembler runs per application, where reconciling many results against the product checklist actually needs reasoning. Oversized and duplicate images are rejected in a Code node before they reach a model, and the readiness label is free SpEL arithmetic.

Output & delivery

Documents arrive on WhatsApp or via the LOS Webhook → the Loop checks each photo cheaply against the scoped Knowledge checklist → the assembler builds a per-member gap list with plain-language asks → a Code node applies the lender's `file_readiness_label` SpEL tool → the Condition node either sends one consolidated local-language request (text plus voice note) or passes the file forward → the credit officer confirms visit-readiness at the Approval node, and a Tool (MCP) node attaches the completeness report to the application in the LOS.

4. Early-warning on repayment stress → respectful, rule-bound outreach

Today: stress is invisible until the arrears report prints on the 1st. Then the branch manager takes the list home, and between 9 and 10pm rings members off his personal phone — because that is when they are home — and the tone hardens with each call. Two officers also call the same member the same evening because nobody logged the first call. A group leader is asked to 'talk to' a defaulting member. There is no record of who was contacted, when, or what was said, and the one member who genuinely wanted to pay ₹300 that week had no way to do it without travelling to the centre.

Trigger: Webhook (daily LMS repayment + attendance feed)

How the workflow runs

  1. Trigger

    Daily repayment feed lands. A scheduled Webhook trigger brings the day's repayment, attendance and centre-efficiency data from the LMS via a Tool (MCP) node — no first-party connector exists for it. Stress is looked at daily, not on the 1st.

  2. Code

    Compute the stress signals + bucket in code. A Code node computes the objective signals — days past due, consecutive missed meetings, trend in centre collection efficiency — deterministically, then applies the lender's user-defined SpEL `arrears_bucket` tool. Thresholds come from the lender's own policy expression, never from a model.

  3. Condition

    Contact eligibility gate. A Condition node filters BEFORE any drafting: is this member inside the permitted contact-hour window, under the per-borrower frequency cap, not opted out, and not in a legal or dispute hold? Anything failing the gate is excluded structurally — this is the node that makes 'two officers ringing at 9pm' impossible, and the model never gets a say in who may be contacted.

  4. Loop

    Draft one message per eligible member. A Loop node runs a cheap agent per eligible member to draft a short, factual, local-language message — the amount and date as supplied, the ways to pay, and an offer to speak to the field officer by name.

  5. Approval

    Field supervisor reviews the outreach batch. An Approval node puts the whole drafted batch in front of the field supervisor before a single message sends — tone, targeting and volume become one person's recorded responsibility instead of nobody's.

  6. Output

    Send on WhatsApp / voice, in language. Approved messages go out on WhatsApp with an ElevenLabs/Sarvam voice note for low-literacy members, and every send is logged with channel, timestamp and approver. A Razorpay UPI payment link is included so the member who wanted to pay ₹300 can, without a trip to the centre.

  7. Supervisor

    Escalate the pattern, not the person. A Supervisor node rolls the week's signals into a portfolio-stress briefing for the branch manager — which centres are drifting and why — as an early-warning input to a human review, never as an automatic action on any borrower.

Channels & connectors

  • Webhook
  • WhatsApp
  • SMS / Twilio
  • Voice / Call
  • ElevenLabs (voice)
  • Sarvam (Indian languages)
  • Razorpay (UPI)
  • Approval / HITL
  • Tool (MCP → LMS)

Outcome

Stress signals surface days earlier as a reviewed, supervisor-approved outreach batch in the borrower's language, every contact is inside the rules and logged, and the first touch carries a way to pay rather than a 9pm call from a personal phone.

Why it helps

The mechanism is earlier, calmer, rule-bound contact: deterministic code and the lender's own bucket rule find the signal, a hard eligibility gate decides who may be contacted at all, and a supervisor approves the batch — so the first touch is a factual reminder with a UPI link, at a permitted hour, once, with a record of it.

Build spec

2 agents1 message drafter (runs once per eligible member via the Loop node) + 1 portfolio-briefing agent behind the Supervisor node (weekly). Signal computation and bucketing are a Code node; eligibility is a Condition node. · Pattern: Code signals + SpEL bucket → hard eligibility gate → cheap per-member drafting → supervisor approves the batch → send + log

System prompt (paste-ready)

(Message drafter) Write ONE short repayment reminder for a microfinance borrower. You are given {member_name, group_name, amount_due, due_date, arrears_bucket, language, officer_name, pay_link}. Write in the member's language, under 45 words, at a primary-school reading level. Include: what is due and when (exactly as supplied — never recompute), that they can pay by the link or at the centre meeting, and that they can call {officer_name} if there is a difficulty. You must NOT: threaten, mention legal action, recovery agents, seizure, the group's liability, credit-bureau reporting, or any consequence; imply urgency beyond stating the date; contact anyone other than the borrower; or name any other member. Do not mention the arrears_bucket to the member — it is for routing only. Do not offer a waiver, a reschedule, a settlement or any change of terms — if the member raises difficulty, the reply is that the field officer will speak to them. Return {text, tts_text}.

Agent roles & model tiers

  • Message drafter (per eligible member) Economy tier with a configured fallback model — the high-volume step; a 45-word factual reminder from supplied fields needs no reasoning budget

    Draft one short, factual, local-language reminder from the supplied fields. Never recompute an amount. No threats, no consequences, no third parties, no terms changes, no bucket labels shown to the member. Text plus a read-aloud variant.
  • Portfolio-stress briefing (weekly, behind the Supervisor node) Standard tier, fallback configured — one call a week, trend synthesis for a human reviewer

    From the week's computed signals, brief the branch manager on which centres and groups are drifting, what the signals were, and what a human should look at. Report patterns only; never name an action to take against an individual borrower and never propose a credit or recovery decision.

MCP connectors

  • LMS — via Tool (MCP): fetch the daily repayment, days-past-due, attendance and centre-collection-efficiency feed
  • LMS — via Tool (MCP): write back a contact log entry per member (channel, timestamp, approver, message id)
  • WhatsApp / SMS / Voice — deliver the approved reminder on the member's reachable channel
  • Sarvam + ElevenLabs — render the reminder in the member's language and voice it for low-literacy members
  • Razorpay UPI — generate a per-member payment link ONLY; the workflow never initiates a debit and never moves money

Built-in tools

  • knowledge_search (collections code of conduct, contact-hour and frequency policy, escalation matrix — scoped Knowledge collection)
  • http_request (pull the daily feed; log every contact attempt)
  • user-defined tool `arrears_bucket` (SpEL): input.daysPastDue > 90 ? 'NPA_REVIEW' : (input.daysPastDue > 30 ? 'BUCKET_2' : (input.daysPastDue > 0 ? 'BUCKET_1' : 'CURRENT')) — a tenant-authored formula tool: it reads one field off the tool input and returns a label through nested ternaries. No API access, no loops, no code execution. Every lender defines its buckets differently and regulators expect those definitions to be explicit and stable, so encoding them as an expression the lender edits itself — rather than a constant buried in a service — is the honest fit. It CLASSIFIES only: an NPA_REVIEW label puts a file in front of a human, it never marks an account, changes a provision or decides anything about the member.

Guardrails

  • No credit or recovery decision, ever: the agents draft and summarise only — rescheduling, waivers, settlements, write-offs, bureau reporting, provisioning and any escalation are human decisions taken outside this workflow, and the outreach batch itself is approved by the field supervisor at the Approval node before anything sends
  • The `arrears_bucket` SpEL tool labels a file for routing and nothing else — it never marks an account NPA, never triggers an action against a borrower, and its output is never shown to the member
  • Collections conduct is enforced structurally, not by prompt alone: a Condition node blocks contact outside the permitted hour window, above the per-borrower frequency cap, for opted-out members, and for anyone under a legal or dispute hold — the model never decides who may be contacted
  • The drafter is prohibited from threats, legal or seizure language, consequence framing, third-party or co-member contact, and any mention of another member's dues; every sent message is logged with its timestamp, channel and approver for audit
  • Amounts and dates are passed through verbatim from the LMS feed — the model may not compute, round or restate a figure, and a Razorpay UPI link is an option offered to the borrower, never an auto-debit or any movement of money by the workflow
  • Opt-out is honoured immediately and permanently for outreach, and every message states how to reach the named field officer for a human conversation

Cost strategy

The drafter runs once per eligible member per cycle and is the whole cost story — keep it economy tier with a hard token cap and a fallback model, since the message is short, factual and template-shaped. Crucially, the eligibility Condition node and the free SpEL bucketing run BEFORE drafting, so ineligible and current members cost nothing at all. One standard-tier briefing per week behind the Supervisor node is the only premium spend; there is no per-borrower reasoning step anywhere in this recipe.

Output & delivery

A Code node computes stress signals deterministically and applies the lender's `arrears_bucket` SpEL tool → the eligibility gate removes anyone who may not be contacted → the Loop drafts one cheap local-language message per remaining member → the field supervisor approves the whole batch at the Approval node → an Output node sends WhatsApp text plus an ElevenLabs/Sarvam voice note with a Razorpay UPI link → every contact is logged back to the LMS, and a weekly Supervisor-node briefing gives the branch manager the portfolio pattern to act on.

Related industries

Build one of these in minutes

The sandbox gives you a live agent workspace — no account, no card. Or head back to the full catalogue and compare patterns across every industry.

See how VegaDūta compares to n8n, Dify and BotpressWhy VegaDūta's architectureEstimate your WhatsApp API costs