Skip to main content

Manage portfolio assets via webhook with Google Sheets and real-time totals

Workflow preview

Workflow preview
100%
Manage portfolio assets via webhook with Google Sheets and real-time totals preview
Open on n8n.io

1. Workflow Overview

Webhook Based Portfolio Manager (n8n + Google Sheets + API) This workflow turns your n8n instance into a portfolio management API using a webhook and Google Sheets. You can add, update or delete as...

Best for

  • Crypto Trading automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.set, n8n-nodes-base.if, n8n-nodes-base.switch, n8n-nodes-base.googlesheets, n8n-nodes-base.respondtowebhook, n8n-nodes-base.merge, n8n-nodes-base.code

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by WeblineIndia.

Original n8n.io source

1.1 Workflow description

Title
Manage portfolio assets via webhook with Google Sheets and real-time totals
Workflow name
Manage portfolio assets via webhook with Google Sheets and real-time totals

Webhook-Based Portfolio Manager (n8n + Google Sheets + API)

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.

Quick Implementation Steps

  1. Import the workflow into your n8n account
  2. Connect your Google Sheets OAuth2 credentials
  3. Ensure your sheet has columns: Asset, Amount, Price, Value
  4. Activate the workflow
  5. Send a POST request to the webhook with:
{
 "asset": "BTC",
 "amount": 2,
 "price": 30000,
 "action": "add"
}

What This Workflow Does

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:

  • Add a new asset
  • Update an existing asset
  • Delete an asset

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.

Who It's For

  • Developers building financial dashboards or APIs
  • Traders tracking portfolios via automation
  • No-code/low-code users using n8n + Google Sheets
  • Anyone wanting a lightweight portfolio backend without a database

Requirements

To use this workflow, you need:

  • n8n account (self-hosted or cloud)
  • Google account with access to Google Sheets
  • Configured Google Sheets OAuth2 credentials in n8n
  • A Google Sheet with STRICT required columns:
  • Asset
  • Amount
  • Price
  • Value
  • Basic knowledge of API requests (POST)

How It Works & Setup Instructions

1. Webhook Trigger

  • Node: Portfolio Webhook Trigger
  • Accepts POST requests
  • Entry point for all operations

2. Normalize Input Data

  • Converts:
  • asset → uppercase
  • amount, price → numbers
  • Calculates:
  • value = amount × price

3. Validate Input

  • Node: Validate Amount & Price
  • Ensures:
  • amount ≥ 0
  • price ≥ 0
  • value ≥ 0
Error Path: Invalid Amount/Price

If validation fails:

{
 "error": "value of amount or price is not correct it should be in positive number"
}

4. Route by Action

  • Node: Route by Action (Add/Update/Delete)
  • Supported values:
  • add
  • update
  • delete
Error Path: Missing Action
{
 "error": "action field is required, add key in json called action and in value add, update or delete."
}
Error Path: Invalid Action Value
{
 "error": "action should contains only one of these three values ['add', 'update', 'delete']."
}

ADD Operation

Flow:
  1. Check Asset Exists (Add)
  2. Asset Exists? (Add)
Error Path: Asset Already Exists
{
 "error": "Asset: BTC is already in your portfolio"
}
Success:
  • Node: Add New Asset
  • Appends row to Google Sheets

UPDATE Operation

Flow:
  1. Update Existing Asset
  2. Asset Found?
Error Path: Asset Not Found (Update)
{
 "error": "Asset: BTC is not found in your portfolio"
}
Success:
  • Updates matching row using Asset column

DELETE Operation

Flow:
  1. Check Asset Exists (Delete)
  2. Asset Found? (Delete)
Error Path: Asset Not Found (Delete)
{
 "error": "Asset: BTC is not found in your portfolio"
}
Success:
  • Node: Delete Asset Row
  • Removes row using row index

Portfolio Calculation

After any operation:

  1. Combine All Operation Outputs
  2. Fetch Full Portfolio
  3. Calculate Portfolio Value
Logic:
  • Iterates through all rows
  • Calculates:
  • totalPortfolioValue = sum of all values

Final Response

Returns:

{
 "message": "Asset: BTC is added, now your total portfolio value is: $60000",
 "Assets": [...]
}

How To Customize Nodes

  • Webhook Path
  • Change endpoint in Portfolio Webhook Trigger
  • Sheet Name / ID
  • Modify in all Google Sheets nodes
  • Validation Rules
  • Update conditions in Validate Amount & Price
  • Response Format
  • Customize JSON in Final Response to User
  • Matching Logic
  • Change matching column (default: Asset)

Add-ons (Enhancements)

You can extend this workflow with:

  • Email notifications after transactions
  • Real-time price API integration
  • AI-based investment insights
  • Dashboard using tools like Retool or Power BI
  • Slack/Telegram alerts
  • Transaction history logging

Use Case Examples

  1. Personal crypto portfolio tracker
  2. Stock portfolio API backend
  3. Admin panel for investment tracking
  4. Automated trading journal
  5. SaaS MVP for portfolio management

And many more depending on your use case.

Troubleshooting Guide

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

Need Help?

If you need help with:

  • Setting up this workflow
  • Customizing features
  • Adding integrations (AI, APIs, dashboards)
  • Building similar automation systems

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.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Portfolio Webhook Trigger

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 2 - Normalize Input Data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Validate Amount & Price

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 4 - Route by Action (Add/Update/Delete)

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.4

Block 5 - Add New Asset

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 6 - Error: Asset Already Exists

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.5

Block 7 - Update Existing Asset

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 8 - Asset Found?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 9 - Error: Asset Not Found

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.5

Block 10 - Delete Asset Row

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 11 - Error: Asset Not Found1

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.5

Block 12 - Error: Invalid Amount/Price

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.5

Block 13 - Error: Missing Action

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.5

Block 14 - Error: Invalid Action Value

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.5

Block 15 - Combine All Operation Outputs

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 16 - Fetch Full Portfolio

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 17 - Calculate Portfolio Value

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 18 - Final Response to User

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.5

Block 19 - Check Asset Exists (Add)

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 20 - Asset Exists? (Add)

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 21 - Check Asset Exists (Delete)

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 22 - Asset Found? (Delete)

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 23 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 27 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Manage portfolio assets via webhook with Google Sheets and real-time totals
Complexity advanced
Nodes 27
Categories Crypto Trading
Author WeblineIndia
Published 25 Apr 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15278/15278.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Manage portfolio assets via webhook with Google Sheets and real-time totals do?

Webhook Based Portfolio Manager (n8n + Google Sheets + API) This workflow turns your n8n instance into a portfolio management API using a webhook and Google Sheets. You can add, update or delete as...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Crypto Trading use case.