- Activepieces: A powerful no-code automation platform that enables multi-step workflows with triggers, conditional routing, and app integrations—without writing a single line of code.
- Dappier: A platform connecting LLMs and automation tools to real-time, rights-cleared data from trusted sources, specializing in domains like stock market, finance, and news. It delivers enriched, prompt-ready data, empowering AI with verified and up-to-date information.
- OpenAI: A leading provider of advanced AI models capable of natural language understanding, contextual reasoning, and content generation. It enables intelligent, human-like interactions and supports a wide range of applications across various domains.
- Gmail: Email-based interaction point that triggers this automation and serves as the delivery channel for the final investment report.
⚙️ Starting with Setup in Activepieces
To get started, head over to Activepieces and create a new flow. This bot will trigger when a new email is received in your Gmail inbox, analyze the query using AI, fetch real-time financial data from Dappier, and send a full investment report via email.Step 1: Set the Trigger – New Email in Gmail
Search for the Gmail piece and choose the New Email trigger. Configure the following:- Authentication: Connect your Gmail account.
- Label: Set to
INBOXto monitor all incoming messages. - Category: Leave it empty to include all categories.
Step 2: Determine Relevance – Is It a Stock Query?
Add a new OpenAI action immediately after the trigger. Configure it as follows:- Model:
chatgpt-4o-latest - Prompt:
- Max Tokens: 2048
- Temperature: 0.1
🔀 Conditional Routing & Ticker Extraction
Step 3: Add a Router to Branch Logic
Use the Router to evaluate the result from the previous OpenAI step. Configure two branches:-
Branch Name:
Stock Analysis-
Condition:
-
Condition:
-
Branch Name:
Otherwise- This fallback branch will do nothing or exit the flow if the email isn’t related to a stock query.
Step 4: Extract the Stock Ticker Symbol
Under theStock Analysis branch, add a new OpenAI action.
Configure it as follows:
- Model:
chatgpt-4o-latest - Prompt:
- Max Tokens: 2048
- Temperature: 0.1
AAPL from “Tell me about Apple”).
📊 Real-Time Financial Data Retrieval using Dappier
With the extracted stock ticker, we’ll now gather structured financial insights using Dappier’s real-time models. For each query below, make sure to use theReal Time Data action from the Dappier piece.
Step 5: Get Company Overview
Add a Dappier action and selectReal Time Data.
Use the following query:
Step 6: Get Financial Performance Metrics
Add another Dappier action (again usingReal Time Data) and enter:
Step 7: Competitive Benchmarking
Add a third Dappier action (also usingReal Time Data) with the query:
📈 Real-Time Stock Snapshot & Market News
We’ll now use Dappier’s specialized Stock Market Data action to retrieve detailed market-level insights and the latest categorized financial news.Step 8: Get Real-Time Stock Snapshot
Add a Dappier action and selectStock Market Data.
Use the following query:
Step 9: Get Categorized Financial News
Add another Dappier action (also usingStock Market Data) with the following query:
🧠 Generate Investment Report with OpenAI
Now that we’ve collected all the required data—company profile, financial performance, peer benchmarking, real-time stock snapshot, and categorized news—we’ll synthesize everything into a polished, readable investment report using OpenAI.Step 10: Compile the Full Report
Add an OpenAI action and configure it with the following:- Model:
chatgpt-4o-latest - Prompt:
📤 Delivering the Report via Gmail
Now that the investment report is generated, let’s send it back to the original sender as a formatted HTML email using Gmail.Step 11: Send the Email
Add a Gmail action and chooseSend Email.
Configure the email fields as follows:
- To:
- Subject:
- Body:
-
Body Type:
HTML - CC/BCC/Reply-To: Leave these empty unless needed.
-
Draft: Set to
falseto send the email immediately.
🌟 Highlights
This notebook has guided you through building a fully automated stock market analysis workflow using Activepieces, OpenAI, Dappier, and Gmail. You’ve seen how to classify queries, extract ticker symbols, fetch real-time financial data, generate detailed reports, and deliver them directly to email—all without writing a single line of backend code. Key tools utilized in this notebook include:- Activepieces: A powerful no-code automation platform that enables app-triggered workflows with conditional logic, AI actions, and app integrations.
- OpenAI: A leading provider of advanced AI models used here to classify stock queries, extract ticker symbols, and generate investment reports in rich HTML format.
- Dappier: A platform connecting LLMs and automation tools to real-time, rights-cleared data from trusted sources, specializing in domains like stock market, finance, and news. It delivers enriched, prompt-ready data, empowering automations with verified and up-to-date information.
- Gmail: Serves as both the input trigger and output channel, making the workflow seamlessly email-driven.

