{"name":"Insurance Verification Bot","nodes":[{"id":"schedule","type":"n8n-nodes-base.scheduleTrigger","name":"Daily Verification Run","position":[250,300],"parameters":{"rule":{"interval":[{"field":"cronExpression","expression":"0 6 * * *"}]}}},{"id":"fetchAppts","type":"n8n-nodes-base.httpRequest","name":"Get Upcoming Appointments","position":[450,300],"parameters":{"url":"={{$env.PMS_API_URL}}/appointments","method":"GET","queryParameters":{"days_ahead":3,"needs_verification":true}}},{"id":"loop","type":"n8n-nodes-base.splitInBatches","name":"Process Each Patient","position":[650,300],"parameters":{"batchSize":1}},{"id":"queryPayer","type":"n8n-nodes-base.httpRequest","name":"Query Insurance Payer","position":[850,300],"parameters":{"url":"={{$env.CLEARINGHOUSE_URL}}/eligibility","method":"POST","body":{"member_id":"={{$json.policy_number}}","payer_id":"={{$json.payer_id}}","dob":"={{$json.patient_dob}}","procedure_codes":"={{$json.cpt_codes}}"}}},{"id":"evaluate","type":"n8n-nodes-base.openAi","name":"AI Evaluate Coverage","position":[1050,300],"parameters":{"model":"gpt-4o-mini","prompt":"Analyze this insurance eligibility response. Is the patient covered for the requested procedures? What is the copay? Any authorization required? Return JSON: {covered: bool, copay: string, deductible_remaining: string, auth_required: bool, notes: string}\n\nResponse: {{$json}}"}},{"id":"flagIssues","type":"n8n-nodes-base.if","name":"Coverage Issues?","position":[1250,300],"parameters":{"conditions":{"boolean":[{"value1":"={{$json.covered}}","value2":false}]}}},{"id":"alertStaff","type":"n8n-nodes-base.slack","name":"Alert Billing Team","position":[1450,200],"parameters":{"channel":"#billing-alerts","text":"Coverage issue for {{$json.patient_name}} on {{$json.appointment_date}}: {{$json.notes}}"}},{"id":"logResult","type":"n8n-nodes-base.httpRequest","name":"Log Verification","position":[1450,400],"parameters":{"url":"={{$env.PMS_API_URL}}/verifications","method":"POST"}}],"connections":{"Daily Verification Run":{"main":[[{"node":"Get Upcoming Appointments","type":"main","index":0}]]},"Get Upcoming Appointments":{"main":[[{"node":"Process Each Patient","type":"main","index":0}]]},"Process Each Patient":{"main":[[{"node":"Query Insurance Payer","type":"main","index":0}]]},"Query Insurance Payer":{"main":[[{"node":"AI Evaluate Coverage","type":"main","index":0}]]},"AI Evaluate Coverage":{"main":[[{"node":"Coverage Issues?","type":"main","index":0}]]},"Coverage Issues?":{"main":[[{"node":"Alert Billing Team","type":"main","index":0}],[{"node":"Log Verification","type":"main","index":0}]]}}}