Back to Prompt Library
implementation
Build the application
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Build a Cross-Border Corporate Parent Consolidation Pipeline
Format
Code-aware
Lines
63
Sections
11
Linked challenge
Build a Cross-Border Corporate Parent Consolidation Pipeline
Prompt source
Original prompt text with formatting preserved for inspection.
63 lines
11 sections
No variables
1 code block
## Build
Query cross-border payment counterparties against the GLEIF API to identify ultimate accounting parents. Consolidate transaction exposures across child entities to calculate aggregate corporate family risk limits.
## User
Financial Risk Analyst
## Workflow
1. Ingest payment logs featuring diverse subsidiary counterparties and transaction values.
2. Query the GLEIF API to retrieve parent and ultimate accounting parent LEI relationships.
3. Aggregate transaction values grouped by the resolved ultimate parent entity identifier.
4. Export a corporate family exposure report comparing consolidated volumes against assigned risk limits.
## Interface
Exposure dashboard displaying child entities rolled up under their ultimate parent LEIs with aggregated volume metrics.
## Data
Generate synthetic transaction logs for corporate subsidiaries mapped to GLEIF Golden Copy hierarchy reference data.
Starter examples below are synthetic. They are not downloaded records.
## Source
[GLEIF API](https://www.gleif.org/en/lei-data/gleif-api)
Utilize GLEIF API corporate structures search to find parent and child relationships as described in source 0.
## Tools
mastra-ai, pandas, httpx.
Mastra AI provides deterministic workflow orchestration to chain external REST API hierarchy resolution steps with exposure aggregators.
Hosted language model for matching entity name variations and formatting hierarchical data arrays.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Queries GLEIF API parent search endpoint using subsidiary LEI parameters.
- Aggregates transaction values correctly across multiple subsidiary entities under the same parent.
- Generates a structured consolidation JSON artifact highlighting parent exposure against predefined thresholds.
## Starter Examples
```json
[
{
"input": {
"subsidiary_lei": "111100XYZ",
"transaction_amount": 50000,
"parent_risk_limit": 100000,
"existing_parent_exposure": 20000
},
"expected_output": {
"ultimate_parent_lei": "999900ABC",
"consolidated_amount": 70000,
"limit_breached": false,
"record_type": "Simplified synthetic app records, not complete official schema files"
}
},
{
"input": {
"subsidiary_lei": "222200XYZ",
"transaction_amount": 200000,
"parent_risk_limit": 100000,
"existing_parent_exposure": 50000
},
"expected_output": {
"ultimate_parent_lei": "999900ABC",
"consolidated_amount": 250000,
"limit_breached": true,
"record_type": "Simplified synthetic app records, not complete official schema files"
}
}
]
```
## Safety
Processes synthetic payment instructions only. No live banking systems, fund settlement rails, or real financial exposures are accessed.
Use mock external writes. Require human review before any real deployment.Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.