See llms.txt for all machine-readable content.
This workflow turns your n8n instance into a portfolio management API using a webhook and Google Sheets. You can add, update or delete assets via a simple POST request and it automatically calculates your total portfolio value in real-time.
Asset, Amount, Price, Value{
"asset": "BTC",
"amount": 2,
"price": 30000,
"action": "add"
}
This workflow acts as a REST-like API for managing investment portfolios using n8n. It receives data via a webhook, processes it and performs operations on a Google Sheet.
It supports three core operations:
Each request is validated to ensure correctness before execution. The workflow also prevents duplicate entries and invalid operations.
After performing any action, it fetches the full portfolio, calculates the total portfolio value and returns a structured JSON response with updated data.
To use this workflow, you need:
AssetAmountPriceValueasset → uppercaseamount, price → numbersvalue = amount × priceamount ≥ 0price ≥ 0value ≥ 0If validation fails:
{
"error": "value of amount or price is not correct it should be in positive number"
}
addupdatedelete{
"error": "action field is required, add key in json called action and in value add, update or delete."
}
{
"error": "action should contains only one of these three values ['add', 'update', 'delete']."
}
{
"error": "Asset: BTC is already in your portfolio"
}
{
"error": "Asset: BTC is not found in your portfolio"
}
Asset column{
"error": "Asset: BTC is not found in your portfolio"
}
After any operation:
totalPortfolioValue = sum of all valuesReturns:
{
"message": "Asset: BTC is added, now your total portfolio value is: $60000",
"Assets": [...]
}
Asset)You can extend this workflow with:
And many more depending on your use case.
| Issue | Possible Cause | Solution |
|---|---|---|
| Webhook not working | Workflow not active | Activate workflow in n8n |
| Invalid amount/price error | Negative or missing values | Ensure positive numbers |
| Asset not updating | Asset not found in sheet | Check exact asset name |
| Duplicate asset error | Asset already exists | Use update instead of add |
| Delete not working | Row not found | Verify asset exists |
| Empty response | Merge or calculation issue | Check node connections |
If you need help with:
Reach out to n8n workflow developers at WeblineIndia for expert assistance.
We specialize in building scalable n8n workflows, automation systems and custom integrations tailored to your business needs.