End-to-End Credit Report Interaction Flow (Creditsafe)
End-to-End Credit Report Interaction Flow (Creditsafe)
sequenceDiagram
autonumber
actor U as User
participant D as Dynamics Account Form
participant DR as Dynamics Results table
participant CP as Custom Page (Modal)
participant PA as Power Automate
participant R as Ruby HTTP Service (Windows Server)
participant P as Creditsafe Pipeline (Ruby)
participant CS as Creditsafe Connect API
participant SP as SharePoint
U->>D: Click "Get Credit Report"
D->>CP: Open modal (prefill Name/Country/RegNo)
U->>CP: Click "Search"
CP->>PA: Invoke Power Automate trigger
PA->>R: Call Ruby HTTP layer
R->>P: Invoke Creditsafe Pipeline (search) job
P->>CS: GET /v1/companies?countries=...®No=...&name=...
CS-->>P: 5 matches
P-->>DR: persist 5 normalized matches (with connectIDs)
DR-->>CP: Output Results
U->>CP: Select company
U->>CP: Click "Download Credit Report"
CP->>PA: Invoke Power Automate trigger (with connectid)
PA->>R: Call Ruby HTTP layer
R->>P: Invoke Creditsafe Pipeline (credit report) job
P->>CS: GET /v1/companies/{connectId} (Accept: application/json+pdf)
CS-->>P: 200 report JSON (+pdf payload)
R->>SP: Upload PDF to SharePoint (Graph/REST)
SP-->>R: 201 Created (sharePointUrl)
R-->>P: 200 summary + sharePointUrl
P->>D: Update Account fields (score, limit, connectId, lastChecked, reportUrl)
This section describes the end-to-end interaction flow for searching for a company and retrieving a credit report from Creditsafe, initiated by a user within Dynamics.
The flow is designed to:
- require explicit user intent for credit-impacting actions
- decouple the UI from third-party API behaviour
- execute external API calls asynchronously
- persist results for audit, traceability, and downstream consumption
1. User Initiation & Context Capture
The process begins when a user selects “Get Credit Report” from a Dynamics Account form.
- Dynamics opens a custom modal page, pre-populated with known account context (for example, company name, country, and registration number).
- No external API calls are made at this stage.
2. Company Search Execution
When the user clicks “Search” within the modal:
- The custom page invokes a Power Automate flow, passing the search parameters.
- Power Automate calls the Ruby HTTP service hosted on Windows Server.
- The HTTP service asynchronously triggers the Creditsafe pipeline in search mode.
- The pipeline invokes the Creditsafe company search endpoint using the supplied criteria.
Creditsafe may return multiple matching companies for a given search.
3. Search Result Handling & Persistence
- The Creditsafe pipeline normalises the search results.
- Each match, including its associated
connectId, is persisted to a Dynamics results table. - No credit report is requested during this stage.
The modal retrieves the persisted results from Dynamics and presents them to the user for selection.
This design:
- avoids returning raw provider responses directly to the UI
- ensures search results are auditable and traceable
- allows the user to explicitly select the correct legal entity
4. Explicit Credit Report Request
Once the user selects a company and clicks “Download Credit Report”:
- The custom page invokes a second Power Automate flow, passing the selected
connectId. - Power Automate calls the Ruby HTTP service.
- The HTTP service triggers the Creditsafe pipeline in credit report mode.
Searching for a company and requesting a credit report are treated as distinct actions to ensure credit-impacting calls are only executed with explicit user intent.
5. Credit Report Retrieval & Document Handling
The Creditsafe pipeline:
- calls the Creditsafe company report endpoint using the selected
connectId - requests both structured JSON data and the PDF report payload
On receipt of the response:
- the PDF is uploaded to SharePoint
- SharePoint returns a document URL
- the pipeline assembles a summary of key credit attributes
6. Account Update & Result Availability
Following successful report retrieval:
- The Dynamics Account record is updated with:
- key credit attributes (e.g. score, credit limit)
- the selected
connectId - the date and time of the credit check
- the SharePoint URL of the stored PDF report
At this point:
- the credit report is available to users
- no further external API calls are required
- an audit trail exists across Dynamics and SharePoint
7. Architectural Characteristics
This interaction flow exhibits the following architectural characteristics:
-
Asynchronous execution The UI does not wait for third-party API calls to complete; long-running work executes independently.
-
Explicit intent enforcement Company searches and credit report requests are separate user actions.
-
Provider isolation Dynamics, Power Automate, and the UI contain no Creditsafe-specific logic.
-
Persistence-first design External data is persisted before being exposed to users or downstream systems.
-
Auditability and traceability Correlation identifiers link user actions, pipeline executions, external API calls, and persisted artefacts.