Automated stock trading with AI: integrating Alpaca and Google Sheets
Ready for 3.0What this workflow does
This workflow has 14 nodes and runs on a schedule (every day at 16:00). Along the way it connects Google Sheets. It also calls paper-api.alpaca.markets over HTTP.
How it runs
Trigger: On a schedule (every day at 16:00).
- Alpaca-get-account-info (HTTP Request): calls paper-api.alpaca.markets
- write_account_balace_today (Google Sheets): append or update
- read_sentiments_score_today (Google Sheets): uses Google Sheets
- filter_top_sentiment_score (Code): runs custom JavaScript code
- Alpaca_get_open_positions (HTTP Request): calls paper-api.alpaca.markets
- create_positions_to_close_and_positions_two_open (Code): runs custom JavaScript code
- positions_to_close (Split Out): splits a list into separate items
- positions_to_open (Split Out): splits a list into separate items
- Alpaca-post-order-sell (HTTP Request): calls an HTTP API (DELETE)
- Wait: waits 2 minutes
…plus 3 more steps. See the full node list below.
Services it uses
HTTP calls to: paper-api.alpaca.markets
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (7)
- HTTP Request
n8n-nodes-base.httpRequest - Code
n8n-nodes-base.code - Google Sheets
n8n-nodes-base.googleSheets - Split Out
n8n-nodes-base.splitOut - Merge
n8n-nodes-base.merge - Wait
n8n-nodes-base.wait - Schedule Trigger
n8n-nodes-base.scheduleTrigger
From the author
Description Transform your investment strategy with a fully automated, AI-driven trading bot. This workflow bridges the gap between AI-powered market insights and real-world trading by executing buy and sell orders directly through the Alpaca paper trading…