Hi,
I want to create a workflow using Langgraph. This would be basically a subgraph With checks in different steps and then determining which step to go to based on the users response.
But I’m confused as to how to implement it the best possible way.
What I’m trying to do : Create a Collections Agent(not necessarily an agent. Mostly a workflow like a state machine i guess)
What does the workflow look like :
I just wanna see the entire langgraoh implementation so that i can see how the flow can be setup in langgraph.
The flow would be something like this for the Collections Agent :
Step 1 : Check if the customer is Struggling to pay by asking them why they can’t pay
- YES : Passed to human agent if they are vulnerable customer (eg:- dog died, lost job, etc)
- NO: Move to Next Step 2
Step 2 : Check if they Have Arrears > 0 ?
- YES : Move to Next Step 3
- NO: Refer to Human Agent (Reply to customer : You’re not currently in arrears. Do you estimate being unable to pay your upcoming statement?)
Step 3 : Has Customer Provided Reason ?
- YES : Move to next step 4
- NO : Ask the customer for reason like “I can see you’ve got X in arrears. What happened that makes you unable to pay?” and then move to next step once they give reason
Step 4 : If reason is less severe + its a one-off incident
- YES : Move to next step 5
- NO : Refer to human agent
Step 5 : Reply to customer like “I can see you’ve got X in arrears. Before paying this off, are you and will you stay up to date with your priority bills?”
- YES : Move to next Step 6
- NO : Move to Step 5.1
Step 5.1 : Reply to customer like : “We’re sorry to hear you’re facing difficulty. Bills take priority. Are you already in touch with a DMC for this?”
- YES : Move to Step 5.1.1
- NO : Move to Step 5.1.2
Step 5.1.1 : Reply to customer like “Please confirm your reference number.”
Check if it Is a valid number ?
- YES : Check if there’s a previous BS in last 6 months ?
- NO : Refer to human Agent
- YES : We’ll give you a 30-day breathing space so you can catch up.
- NO : Refer to human agent
Step 5.1.2 : Reply to customer like “You need to contact a DMC. We’ll give you a 30-day breathing space for this. Please contact them. Thanks!”
Step 6 : Ask customer like “Do you expect you’ll be able to pay by your next payment due and make your regular payment?”
- YES : Move to Next Step 7
- NO : Move to Next Step 6.1
Step 6.1 : Reply to customer like “We can help you set up a payment plan. Approximatively how many months would you say you’d need to pay these arrears?”
- If greater than 6 months : Refer to human with a suggestion for Hardship
- If less than 3 months : Refer to human with a suggestion for a 3-month PTP
- If between 3 and 6 months :Ask customer like “At the end of this period, do you expect to be able to clear your arrears and return to the minimum payment on your plan?”
- YES : Refer to human with a suggestion for Forbearance Non-Re-Age
- NO : Refer to human with a suggestion for Forbearance Re-Age
Step 7 : Check if there’s been Previous PTP’s in last 6 months?
- YES : Refer to human agent
- NO : Move to next step 8
Step 8 : Do the Account Checks
- FAIL : Refer to human agent
- PASS : Move to next step 9
Step 9 : Reply to customer like “I’ll set up a PTP for you. Confirm terms?”
- YES : 1 month PTP
- NO : Refer to human agent
Please help me suggest the best possible solution for this.
