Quick overview
This workflow collects a user-selected financial life event through an n8n Form, retrieves account and market data, runs a Monte Carlo stress test, and uses Anthropic Claude to generate and email a personalized financial report.
How it works
- Receives a form submission that specifies the life event to test (buy a house, lose a job, or both) and the simulation horizon and parameters.
- Fetches linked account balances and recent transactions from a Plaid-style account-aggregator API and fetches historical market return statistics from a market-data API.
- Calculates a financial baseline (net worth, estimated monthly income/expenses, and emergency-fund coverage) and packages the life-event and market inputs for simulation.
- Runs 1,000 Monte Carlo month-by-month simulations applying the selected event’s cash-flow shocks and random market returns, then summarizes percentiles and shortfall probability.
- Sends the simulation results to Anthropic Claude to produce a JSON risk narrative, risk level, and three recommendations, then formats a complete plain-text report.
- Sends the digital twin report by SMTP email with the computed risk level in the subject line.
Setup
- Add Anthropic credentials and select the Claude model in the Anthropic Chat Model node used by the AI agent.
- Configure the account-aggregator HTTP request with your Plaid (or equivalent) client ID, secret, and access token, and adjust the endpoint/response mapping if your provider differs.
- Add your market-data API key in the Authorization header and update the market-data endpoint to return mean and standard deviation of monthly returns.
- Set up SMTP credentials and replace the from/to email addresses used to send the final report.
- Activate the workflow and use the n8n Form URL to submit an event scenario and run a simulation.