1. Opening Problem Statement
Meet Sarah, a cryptocurrency investor who diligently tracks her diverse crypto portfolio across various coins. Each hour, she manually checks prices on websites like CoinGecko and updates her portfolio values on Airtable. This process is time-consuming, prone to errors, and disrupts her focus on investment strategy. In fact, Sarah spends at least 2 hours daily just updating prices, risking outdated data and missed opportunities.
This workflow is tailored specifically for investors like Sarah who use Airtable as their portfolio tracker and rely on CoinGecko for real-time market data. It eliminates manual price updates, saving time and delivering accurate, up-to-date portfolio valuations automatically.
2. What This Automation Does
This n8n workflow runs every hour to automate your crypto portfolio updates seamlessly. Here’s what happens when the workflow runs:
- Pulls the list of crypto symbols from your Airtable portfolio.
- Fetches the current USD market price for each coin using the CoinGecko node.
- Updates each coin’s ‘Present Price’ field in Airtable with the latest data.
- Retrieves all present values from the portfolio in Airtable to calculate the total portfolio worth.
- Uses a Function node to sum all the present values of your crypto holdings to get your total portfolio value in USD.
- Appends this total portfolio value to a separate Airtable table for tracking historical value changes over time.
By using this workflow, you save hours of daily manual work and ensure your investment data is accurate and always fresh.
3. Prerequisites ⚙️
- n8n account with access to create workflows.
- Airtable account with two tables: ‘Portfolio’ (holding your crypto symbols and prices) and ‘Portfolio Value’ (to store aggregated portfolio values).
- Airtable API key with read/write permissions (credential setup needed in n8n).
- CoinGecko node access within n8n (no API key required as CoinGecko offers public API).
- Basic understanding of Airtable fields like ‘Symbol’, ‘Present Price’, and ‘Present Value’.
4. Step-by-Step Guide to Build the Workflow
Step 1: Set up the Trigger with the Cron Node (Hourly Updates)
In n8n, click + Add Node → search and select Cron node. Set Trigger Times to every hour. This ensures your portfolio updates occur hourly, keeping your data fresh.
Visual confirmation: you should see the Cron node with a clock icon and a label indicating the schedule.
Common Mistake: Not setting this to ‘every hour’ may cause irregular or unwanted update intervals.
Step 2: Fetch Your Portfolio Data from Airtable
Add an Airtable node named ‘Get Portfolio’ and configure it to:
- Select the operation list.
- Choose your Airtable application ID.
- Set table to ‘Portfolio’.
- In Additional Options, restrict fields to only Symbol to limit response size.
- Link your Airtable API Credentials.
Outcome: This node outputs an array of cryptocurrency symbols you hold.
Common Mistake: Forgetting to restrict fields may slow down the workflow due to large data.
Step 3: Get Current Coin Prices from CoinGecko
Add a CoinGecko node. Configure it to:
- Set operation to get.
- Use
={{$json["fields"]["Symbol"]}}to dynamically fetch coin IDs from Airtable’s Symbol field. - Enable options to get market_data and disable localization.
Expected output: Market data including current USD price for each cryptocurrency symbol.
Common Mistake: Not mapping the Symbol field correctly will cause errors or no data retrieval.
Step 4: Set Present Price and ID for Update
Insert a Set node to extract and format values for updating Airtable. Configure it to:
- Set ‘Present Price’ to
{{$json["market_data"]["current_price"]["usd"]}}. - Set ‘Id’ field to the record ID from ‘Get Portfolio’.
- Ensure keepOnlySet is enabled to send only these fields forward.
Common Mistake: Missing the ID value means Airtable cannot know which record to update.
Step 5: Update Individual Coin Prices in Airtable
Link an Airtable node named ‘Update Values’ to:
- Operation: update.
- ID: use expression from ‘Set’ node for record
{{$node["Set"].json["Id"]}}. - Fields to update: Present Price.
- Connect your Airtable API Credentials.
After running, each crypto in Airtable will have its current price updated automatically.
Common Mistake: Failing to select the correct record ID will overwrite wrong entries.
Step 6: Retrieve Current Portfolio Values for Total Calculation
Add another Airtable node called ‘Get Portfolio Values’ with:
- Operation: list.
- Table: Portfolio.
- Fields: include Present Value (representing quantity × price).
- Use your Airtable credentials.
This node gathers the current USD values of each portfolio coin.
Common Mistake: Omitting the ‘Present Value’ field will invalidate the total calculation.
Step 7: Sum the Portfolio Values with Function Node
Add a Function node named ‘Determine Total Value’. Enter the following JavaScript code:
var totalValues = 0;
items.forEach(sumValues);
function sumValues(value) {
totalValues += value.json.fields['Present Value'];
}
items = [{ json: {} }];
items[0].json['Portfolio Value (US$)'] = totalValues;
return items;
This code loops over all portfolio entries, sums the ‘Present Value’ fields, and sets it as ‘Portfolio Value (US$)’.
Common Mistake: Make sure field names match exactly (case sensitive).
Step 8: Append Total Portfolio Value to Airtable History
Finally, add an Airtable node called ‘Append Portfolio Value’. Configure it to:
- Operation: append.
- Table: Portfolio Value, a separate table to track overall portfolio worth over time.
- Fields: Portfolio Value (US$).
- Connect Airtable credentials.
Output: The current total portfolio value is stored, enabling historical tracking and analytics.
Common Mistake: Using ‘update’ here instead of ‘append’ would overwrite past data.
5. Customizations ✏️
- Change Update Frequency: In the ‘Run Top of Hour’ Cron node, adjust settings to run every 30 minutes or daily according to your preference.
- Add More Coin Data: Modify CoinGecko node options to include additional market data like volume or 24h change, then update ‘Set’ node accordingly.
- Filter Portfolio Coins: Add a filter node after ‘Get Portfolio’ to update prices only for coins above a certain value threshold.
- Store Currency in Another Field: Edit the ‘Set’ node to save prices in a different Airtable field, for example, ‘Price USD’ for clarity.
6. Troubleshooting 🔧
Problem: “Invalid CoinGecko coin ID” or no price data returned.
Cause: Mismatched or incorrect crypto symbols in Airtable.
Solution: Verify your ‘Symbol’ field uses CoinGecko-compatible IDs like ‘bitcoin’, ‘ethereum’. Avoid common ticker symbols like ‘BTC’ unless mapped correctly.
Problem: Airtable update node fails with “Record not found”.
Cause: Incorrect record ID passed from ‘Set’ node.
Solution: Ensure the ‘Id’ field in ‘Set’ matches the Airtable record ID exactly by inspecting output data in n8n.
Problem: Total portfolio value is zero after run.
Cause: The ‘Present Value’ field in Airtable is empty or misnamed.
Solution: Verify all portfolio entries have ‘Present Value’ populated and field names are case-sensitive.
7. Pre-Production Checklist ✅
- Confirm all Airtable API credentials are correct and have write access.
- Validate that CoinGecko IDs in portfolio match API requirements.
- Test workflow with a small number of coins to ensure accurate price fetching and updating.
- Check ‘Set’ node outputs for correct data formatting before updating Airtable.
- Simulate the full run and watch logs to catch any runtime errors.
8. Deployment Guide
Activate the workflow by toggling it on in your n8n dashboard. Monitor the first few hourly runs via the execution logs to ensure consistent data updates. If using self-hosted n8n, ensure your instance is up and running with internet access to reach CoinGecko and Airtable APIs.
Consider enabling alert nodes or connecting Slack/email notification nodes for failure alerts to keep your portfolio updated reliably.
9. FAQs
Q: Can I use another price data service besides CoinGecko here?
A: Yes, but you’d need to replace the CoinGecko node with an equivalent HTTP Request node querying a compatible API, adjusting the data extraction accordingly.
Q: Does this workflow consume Airtable API rate limits?
A: Yes, because it updates records hourly. Make sure your Airtable plan supports these operations within their API limits.
Q: Is my portfolio data secure during automation?
A: Your data remains within Airtable and n8n environments. Always secure your API keys and use HTTPS endpoints to prevent data leaks.
10. Conclusion
Congratulations! You’ve automated your crypto portfolio updates by integrating CoinGecko and Airtable through n8n. This workflow saves you hours of repetitive price lookups and manual entries, improving data accuracy and giving you real-time insights into your investments. Next, consider expanding your setup with notifications of significant price changes or integrating tax reporting automation based on your portfolio data.
By finishing this guide, you’ve taken a significant step toward smarter crypto investment management leveraging automated workflows.