AI crew to automate fundamental stock analysis - Q&A workflow
How it works:
Using a Crew of AI agents (Senior Researcher, Visionary, and Senior Editor), this crew will automatically determine the right questions to ask to produce a detailed fundamental stock analysis.
This application has two components: a front-end and a Stock Q&A engine.
The front end is the team of agents automatically figuring out the questions to ask, and the back-end part is the ability to answer those questions with the SEC 10K data.
This template implements the Stock Q&A engine.
For the front-end of the application, you can choose one of two options:
- using CrewAI with the Replit environment (code approach)
- fully visual approach with n8n template (AI-powered automated stock analysis)
Setup steps:
- Use first workflow in template to upsert a company annual report PDF (such as from SEC 10K filling)
- Get URL for Webhook in second workflow template
CrewAI front-end: Youtube overview video
- Fork this AI Agent environment Crew Agent Environment
- Set the webhook URL into N8N_WEBHOOK_URL variable
- Set OpenAI_API_KEY variable
n8n AI Crew for Fundamental Stock Analysis - QA Workflow
This n8n workflow leverages AI to automate the process of querying and analyzing financial documents for fundamental stock analysis. It allows users to upload financial reports (e.g., PDF, DOCX) to Google Drive, which are then processed, embedded, and stored in a Qdrant vector database. Users can then ask natural language questions about the documents via a chat interface, and the workflow will retrieve relevant information and provide answers using an OpenAI Chat Model.
What it does
This workflow automates the following steps:
- Triggers on Manual Execution or Webhook: The workflow can be initiated manually for testing or via an external webhook, allowing for integration with other systems.
- Uploads Document to Google Drive: A "Sticky Note" indicates that the user should manually upload documents to Google Drive for processing.
- Loads Binary Document Input: It retrieves the uploaded document as binary data.
- Splits Text into Chunks: The document's text content is broken down into smaller, manageable chunks using a Recursive Character Text Splitter. This is crucial for efficient embedding and retrieval.
- Generates Embeddings with OpenAI: Each text chunk is converted into a numerical vector (embedding) using OpenAI's embedding model.
- Stores Embeddings in Qdrant Vector Store: These embeddings are then stored in a Qdrant vector database, making them searchable and retrievable based on semantic similarity.
- Triggers on Chat Message Received: The primary interaction point for users is a chat interface, which triggers the AI Question and Answer chain when a new message is received.
- Retrieves Relevant Information: Based on the user's chat query, the workflow uses a Vector Store Retriever to find the most semantically similar document chunks from the Qdrant database.
- Answers Questions with OpenAI Chat Model: The retrieved chunks are then fed into an OpenAI Chat Model, which generates a natural language answer to the user's question, leveraging the context from the financial documents.
- Responds to Webhook: The final answer from the AI model is sent back as a response to the initial webhook, allowing the integrating system to display the answer to the user.
Prerequisites/Requirements
- n8n Instance: A running instance of n8n.
- Google Drive Account: For storing and accessing financial documents.
- OpenAI API Key: Required for the OpenAI Chat Model and Embeddings OpenAI nodes.
- Qdrant Instance: A running Qdrant vector database instance for storing document embeddings.
- LangChain Nodes: Ensure the
@n8n/n8n-nodes-langchainpackage is installed in your n8n instance.
Setup/Usage
- Import the Workflow: Import the provided JSON into your n8n instance.
- Configure Credentials:
- Google Drive: Set up your Google Drive OAuth2 credentials.
- OpenAI: Configure your OpenAI API Key credential.
- Qdrant: Set up your Qdrant API credentials (host, API key if applicable).
- Upload Documents: Manually upload your financial documents (e.g., PDF annual reports, earnings call transcripts) to a designated folder in your Google Drive account. The "Google Drive" node in the workflow should be configured to point to these documents.
- Initialize Vector Store:
- Execute the workflow once (you can trigger the "Manual Trigger" node) to process the documents from Google Drive, generate embeddings, and populate your Qdrant vector store. This step is crucial for the AI to have data to analyze.
- Interact via Chat:
- Activate the workflow.
- Use the "When chat message received" node (or an external system integrated with the Webhook trigger) to send natural language questions about your uploaded financial documents.
- The workflow will process your query, retrieve relevant information, and respond with an AI-generated answer.
Related Templates
Automate Dutch Public Procurement Data Collection with TenderNed
TenderNed Public Procurement What This Workflow Does This workflow automates the collection of public procurement data from TenderNed (the official Dutch tender platform). It: Fetches the latest tender publications from the TenderNed API Retrieves detailed information in both XML and JSON formats for each tender Parses and extracts key information like organization names, titles, descriptions, and reference numbers Filters results based on your custom criteria Stores the data in a database for easy querying and analysis Setup Instructions This template comes with sticky notes providing step-by-step instructions in Dutch and various query options you can customize. Prerequisites TenderNed API Access - Register at TenderNed for API credentials Configuration Steps Set up TenderNed credentials: Add HTTP Basic Auth credentials with your TenderNed API username and password Apply these credentials to the three HTTP Request nodes: "Tenderned Publicaties" "Haal XML Details" "Haal JSON Details" Customize filters: Modify the "Filter op ..." node to match your specific requirements Examples: specific organizations, contract values, regions, etc. How It Works Step 1: Trigger The workflow can be triggered either manually for testing or automatically on a daily schedule. Step 2: Fetch Publications Makes an API call to TenderNed to retrieve a list of recent publications (up to 100 per request). Step 3: Process & Split Extracts the tender array from the response and splits it into individual items for processing. Step 4: Fetch Details For each tender, the workflow makes two parallel API calls: XML endpoint - Retrieves the complete tender documentation in XML format JSON endpoint - Fetches metadata including reference numbers and keywords Step 5: Parse & Merge Parses the XML data and merges it with the JSON metadata and batch information into a single data structure. Step 6: Extract Fields Maps the raw API data to clean, structured fields including: Publication ID and date Organization name Tender title and description Reference numbers (kenmerk, TED number) Step 7: Filter Applies your custom filter criteria to focus on relevant tenders only. Step 8: Store Inserts the processed data into your database for storage and future analysis. Customization Tips Modify API Parameters In the "Tenderned Publicaties" node, you can adjust: offset: Starting position for pagination size: Number of results per request (max 100) Add query parameters for date ranges, status filters, etc. Add More Fields Extend the "Splits Alle Velden" node to extract additional fields from the XML/JSON data, such as: Contract value estimates Deadline dates CPV codes (procurement classification) Contact information Integrate Notifications Add a Slack, Email, or Discord node after the filter to get notified about new matching tenders. Incremental Updates Modify the workflow to only fetch new tenders by: Storing the last execution timestamp Adding date filters to the API query Only processing publications newer than the last run Troubleshooting No data returned? Verify your TenderNed API credentials are correct Check that you have setup youre filter proper Need help setting this up or interested in a complete tender analysis solution? Get in touch 🔗 LinkedIn – Wessel Bulte
🎓 How to transform unstructured email data into structured format with AI agent
This workflow automates the process of extracting structured, usable information from unstructured email messages across multiple platforms. It connects directly to Gmail, Outlook, and IMAP accounts, retrieves incoming emails, and sends their content to an AI-powered parsing agent built on OpenAI GPT models. The AI agent analyzes each email, identifies relevant details, and returns a clean JSON structure containing key fields: From – sender’s email address To – recipient’s email address Subject – email subject line Summary – short AI-generated summary of the email body The extracted information is then automatically inserted into an n8n Data Table, creating a structured database of email metadata and summaries ready for indexing, reporting, or integration with other tools. --- Key Benefits ✅ Full Automation: Eliminates manual reading and data entry from incoming emails. ✅ Multi-Source Integration: Handles data from different email providers seamlessly. ✅ AI-Driven Accuracy: Uses advanced language models to interpret complex or unformatted content. ✅ Structured Storage: Creates a standardized, query-ready dataset from previously unstructured text. ✅ Time Efficiency: Processes emails in real time, improving productivity and response speed. *✅ Scalability: Easily extendable to handle additional sources or extract more data fields. --- How it works This workflow automates the transformation of unstructured email data into a structured, queryable format. It operates through a series of connected steps: Email Triggering: The workflow is initiated by one of three different email triggers (Gmail, Microsoft Outlook, or a generic IMAP account), which constantly monitor for new incoming emails. AI-Powered Parsing & Structuring: When a new email is detected, its raw, unstructured content is passed to a central "Parsing Agent." This agent uses a specified OpenAI language model to intelligently analyze the email text. Data Extraction & Standardization: Following a predefined system prompt, the AI agent extracts key information from the email, such as the sender, recipient, subject, and a generated summary. It then forces the output into a strict JSON structure using a "Structured Output Parser" node, ensuring data consistency. Data Storage: Finally, the clean, structured data (the from, to, subject, and summarize fields) is inserted as a new row into a specified n8n Data Table, creating a searchable and reportable database of email information. --- Set up steps To implement this workflow, follow these configuration steps: Prepare the Data Table: Create a new Data Table within n8n. Define the columns with the following names and string type: From, To, Subject, and Summary. Configure Email Credentials: Set up the credential connections for the email services you wish to use (Gmail OAuth2, Microsoft Outlook OAuth2, and/or IMAP). Ensure the accounts have the necessary permissions to read emails. Configure AI Model Credentials: Set up the OpenAI API credential with a valid API key. The workflow is configured to use the model, but this can be changed in the respective nodes if needed. Connect the Nodes: The workflow canvas is already correctly wired. Visually confirm that the email triggers are connected to the "Parsing Agent," which is connected to the "Insert row" (Data Table) node. Also, ensure the "OpenAI Chat Model" and "Structured Output Parser" are connected to the "Parsing Agent" as its AI model and output parser, respectively. Activate the Workflow: Save the workflow and toggle the "Active" switch to ON. The triggers will begin polling for new emails according to their schedule (e.g., every minute), and the automation will start processing incoming messages. --- Need help customizing? Contact me for consulting and support or add me on Linkedin.
Synchronizing WooCommerce inventory and creating products with Google Gemini AI and BrowserAct
Synchronize WooCommerce Inventory & Create Products with Gemini AI & BrowserAct This sophisticated n8n template automates WooCommerce inventory management by scraping supplier data, updating existing products, and intelligently creating new ones with AI-formatted descriptions. This workflow is essential for e-commerce operators, dropshippers, and inventory managers who need to ensure their product pricing and stock levels are synchronized with multiple third-party suppliers, minimizing overselling and maximizing profit. --- Self-Hosted Only This Workflow uses a community contribution and is designed and tested for self-hosted n8n instances only. --- How it works The workflow is typically run by a Schedule Trigger (though a Manual Trigger is also shown) to check stock automatically. It reads a list of suppliers and their inventory page URLs from a central Google Sheet. The workflow loops through each supplier: A BrowserAct node scrapes the current stock and price data from the supplier's inventory page. A Code node parses this bulk data into individual product items. It then loops through each individual product found. The workflow checks WooCommerce to see if the product already exists based on its name. If the product exists: It proceeds to update the existing product's price and stock quantity. If the product DOES NOT exist: An If node checks if the missing product's category matches a predefined type (optional filtering). If it passes the filter, a second BrowserAct workflow scrapes detailed product attributes from a dedicated product page (e.g., DigiKey). An AI Agent (Gemini) transforms these attributes into a specific, styled HTML table for the product description. Finally, the product is created in WooCommerce with all scraped details and the AI-generated description. Error Handling: Multiple Slack nodes are configured to alert your team immediately if any scraping task fails or if the product update/creation process encounters an issue. Note: This workflow does not support image uploads for new products. To enable this functionality, you must modify both the n8n and BrowserAct workflows. --- Requirements BrowserAct API account for web scraping BrowserAct n8n Community Node -> (n8n Nodes BrowserAct) BrowserAct templates named “WooCommerce Inventory & Stock Synchronization” and “WooCommerce Product Data Reconciliation” Google Sheets credentials for the supplier list WooCommerce credentials for product management Google Gemini account for the AI Agent Slack credentials for error alerts --- Need Help? How to Find Your BrowseAct API Key & Workflow ID How to Connect n8n to Browseract How to Use & Customize BrowserAct Templates How to Use the BrowserAct N8N Community Node --- Workflow Guidance and Showcase STOP Overselling! Auto-Sync WooCommerce Inventory from ANY Supplier