Quick overview
This workflow receives an overdue-invoice collection request via webhook, enriches it with customer history, calls an AI endpoint to generate ranked collection actions, executes the primary action, logs the activity to an AR/CRM system, and returns a full collection plan and audit trail.
How it works
- Receives an accounts-receivable collection request via a POST webhook with invoice, customer, and overdue details.
- Validates required fields, assigns a severity tier based on days overdue and balance, and prepares a customer context payload.
- Calls an external HTTP endpoint to fetch the customer’s payment history and risk indicators.
- Sends the enriched context to an external AI HTTP endpoint to generate a ranked list of personalized collection actions.
- Calls an external HTTP endpoint to execute the primary recommended action (for example sending an email, creating a task, or initiating a call).
- Logs the collection activity by calling an external AR/CRM HTTP endpoint.
- Compiles the AI recommendations and execution results into a collection plan with status codes and next steps, then returns it in the webhook response.
Setup
- Configure the webhook endpoint URL (path:
/ar-collection) in the system that submits overdue invoice/collection requests.
- Replace the placeholder HTTP URLs (currently
httpbin.org) with your real customer-history, AI action-generation, action-execution, and AR/CRM logging endpoints.
- If your endpoints require authentication, add the required credentials/headers (for example API keys or OAuth tokens) to the HTTP request steps.
- Ensure the webhook payload includes
invoiceId, customerId, email, amount, and optionally daysOverdue and other context fields used for severity and action generation.