Templates / Automated stock trading with AI: integrating Alpaca and Google Sheets

Automated stock trading with AI: integrating Alpaca and Google Sheets

Ready for 3.0

by Raz Hadas ✓ · 32,721 views · created 2025-07-06 · Crypto Trading

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What 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).

  1. Alpaca-get-account-info (HTTP Request): calls paper-api.alpaca.markets
  2. write_account_balace_today (Google Sheets): append or update
  3. read_sentiments_score_today (Google Sheets): uses Google Sheets
  4. filter_top_sentiment_score (Code): runs custom JavaScript code
  5. Alpaca_get_open_positions (HTTP Request): calls paper-api.alpaca.markets
  6. create_positions_to_close_and_positions_two_open (Code): runs custom JavaScript code
  7. positions_to_close (Split Out): splits a list into separate items
  8. positions_to_open (Split Out): splits a list into separate items
  9. Alpaca-post-order-sell (HTTP Request): calls an HTTP API (DELETE)
  10. Wait: waits 2 minutes

…plus 3 more steps. See the full node list below.

Services it uses

Google Sheets

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)

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…

Excerpt from Raz Hadas's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.