Automated Field Investigation (FI) Assignment
Ready-made WorqHat template
Launch "Automated Field Investigation (FI) Assignment" as a workflow
Duplicate this recipe inside WorqHat to get the outlined triggers, nodes, and delivery logic preconfigured. Update credentials, recipients, and copy, then ship it to production.
- • All workflow nodes referenced in this guide
- • Structured JSON outputs for dashboards and mailers
- • Inline documentation for faster handoffs
Get started checklist
- 1. Duplicate the workflow template.
- 2. Connect your datasource and credentials.
- 3. Customize content and recipients.
Automated Field Investigation (FI) Assignment
This workflow automates FI dispatch for loan applications by:
- Accepting loan IDs + borrower addresses over REST
- Geocoding the address into precise coordinates and a shareable map link
- Fetching the next available field agent
- Sending the agent a WhatsApp brief with all details
- Updating the loan record with the assignment outcome
Operations teams get a deterministic, auditable FI pipeline instead of ad hoc assignments.
Previous State
Loan team receives an FI request → copies the address into Google Maps → finds an agent manually → shares details over chat → updates the loan record hours later.
The result: delays, inconsistent communication, and zero traceability.
Target State
- REST API trigger receives
loan_idandapplicant_address - Google Maps node geocodes the address
- Query Data fetches active field agents
- WhatsApp node dispatches the FI assignment instantly
- Update Data marks
fi_status = "Assigned"with agent details - Return State confirms success with a standard payload
Loan disbursal never waits for manual FI assignment again.
Workflow Breakdown
1. REST API Trigger
- Purpose: Start the workflow whenever an FI is requested for a loan.
- Inputs:
loan_id(string)applicant_address(string)
- Output: Structured payload ready for downstream nodes.
2. Google Maps (Geocode Address)
- Input:
{{rest-api-trigger.input.applicant_address}} - Purpose: Convert the borrower’s address into precise coordinates and a map link.
- Outputs:
latitudelongitudeformatted_addressmap_url
This ensures the field agent receives verified location data.
3. Query Data (Fetch Active Agents)
- Collection:
Field_Agents(or your equivalent) - Filter:
status == "active" - Limit:
1(simple version picks the first active agent; can be extended to nearest agent logic) - Purpose: Retrieve the agent profile that will handle this FI.
- Output: Array with agent contact info, e.g.,
phone,name,region.
4. Send WhatsApp (Notify Agent)
- To:
{{query-data.output.records[0].phone}} - Message template:
New FI Task Assigned
Loan ID: {{rest-api-trigger.input.loan_id}}
Address: {{google-maps.output.formatted_address}}
Map: {{google-maps.output.map_url}}
- Purpose: Deliver a complete briefing (loan ID + address + map link) to the assigned agent over WhatsApp.
- Output: Delivery status, message ID, timestamp.
5. Update Data (Loan Record)
- Collection:
Loans(or equivalent) - Selector:
loan_id == {{rest-api-trigger.input.loan_id}} - Updates:
fi_status = "Assigned"fi_agent = {{query-data.output.records[0].name}}fi_location = {{google-maps.output.formatted_address}}
- Purpose: Persist the assignment so downstream systems know FI is in progress.
6. Return State (Final Response)
- Payload example:
{
"status": "success",
"message": "FI assigned and agent notified.",
"loan_id": "{{rest-api-trigger.input.loan_id}}",
"assigned_agent": "{{query-data.output.records[0].name}}"
}- Purpose: Provide a consistent response to the caller or orchestrator.
Conditional Logic & Branching
None required. The workflow is linear: Trigger → Maps → Query → WhatsApp → Update → Return.
(Optional future guards could include address validation failures or “no active agent” fallbacks.)
Data Flow & Transformations
- REST API Trigger → Google Maps: Raw text address becomes coordinates + formatted address + map URL.
- Google Maps → Query Data: Coordinates can later support nearest-agent logic.
- Query Data → WhatsApp + Update: Agent details are used for messaging and persisted status.
- Return State: Summarizes the final assignment.
Primary transformation: applicant_address (string) → structured geodata (lat/lng + map URL) → FI assignment record.
Integration Requirements
- Google Maps API: Geocoding + map link generation (API key required).
- WhatsApp Business API: Outbound messaging (token or webhook secret).
- Database access: WorqHat collection(s) for
Field_AgentsandLoans.
Rate limits:
- Respect Google Maps geocode quotas.
- WhatsApp daily/hourly send limits apply.
Recommended Extensions
- Add distance calculation to route the nearest agent automatically.
- Add fallback logic if no agents are active (queue, escalation).
- Log agent acknowledgment responses for full FI lifecycle tracking.
- Mirror notifications to Slack/Email for regional supervisors.
Next Steps
- Create/verify
Field_AgentsandLoanscollections with the required fields. - Configure Google Maps and WhatsApp credentials inside WorqHat.
- Wire the REST API trigger to your loan origination system.
- Turn on the workflow and monitor Return State logs for assignments.
👉 Install this template in WorqHat and automate your FI dispatch end-to-end.
