Sebastian/OptiLever
Templates by Sebastian/OptiLever
Iterative content refinement with GPT-4 multi-agent feedback system
Who's it for This workflow is designed for users who want to implement iterative AI-powered content improvement processes. It's ideal for content creators, marketers, product managers, and anyone who needs to refine ideas through multiple rounds of critique and enhancement until they meet quality standards. How it works The workflow creates a sophisticated feedback loop using three specialized AI agents that work together to continuously improve content. Starting with an initial input (like a product description), the system generates ideas and then enters a reasoning loop where: A Critic Agent analyzes the current output and identifies flaws or areas for improvement A Refiner Agent takes the original input plus the critic's feedback to create enhanced versions An Evaluator Agent assesses the refined output and determines if it meets the quality threshold The loop continues until either the evaluator determines the output is satisfactory or a maximum number of iterations is reached (configurable, default is 5 turns). How to set up Configure the initial AI agent to generate your starting content Set up the loop structure with "Reset Loop" enabled in the loop node options Configure three AI agents within the loop: Critic: Provide detailed analysis prompts for identifying improvements Refiner: Create prompts that incorporate feedback to enhance content Evaluator: Define quality criteria and decision-making logic Add Edit Fields nodes at the beginning and end of the loop to maintain data structure Include a Code node to track iteration count and loop control Set up the IF node to check exit conditions (max turns or completion status) Requirements n8n workflow environment Access to AI/LLM nodes (OpenAI, Anthropic, etc.) Basic understanding of JSON data structures Configured AI model credentials How to customize the workflow Customize the system prompts for each agent based on your specific use case. The critic should focus on your quality criteria, the refiner should understand your improvement goals, and the evaluator should have clear success metrics. Adjust the maximum iteration count in the code node and IF condition based on your complexity needs and token budget considerations.
Generate SWOT analysis reports with OpenAI, Google Sheets & APITemplate PDF Export
SWOT Analysis Generator That Produces PDF Reports In n8n Want to skip the manual work and instantly generate SWOT analyses for your business plans, investor decks, or strategy docs? 🚀 This workflow lets you automate the entire SWOT (Strengths, Weaknesses, Opportunities, Threats) process—using AI and no-code tools! Whether you're using this for yourself or creating documents for clients, this workflow will save you hours of time and help identify the key components of growing any business. Tools We’ll Be Using: OpenAI API: Powers AI-driven extraction and generation of SWOT sections, introductions, conclusions, and more. n8n: The no-code automation platform that orchestrates this workflow. Google Sheets: Stores your company data and report outputs (download the provided "SWOT Analysis" template and fill it out). APITemplate.io: Converts HTML reports into downloadable, multi-page PDFs. DeepSeek API (optional): An alternative to OpenAI for specific reasoning tasks. Gmail OAuth2: Sends the final report via email. If you’re building a business, doing client work, or just want faster strategic planning—this will save you HOURS. --- How It Works This n8n workflow transforms structured company data from a Google Sheet into a fully formatted, investor-grade SWOT report in both HTML and PDF formats. Here’s the process in a few high-level steps: Load Data: Pulls company information from the "Company Info Input" tab in the "SWOT Analysis" Google Sheet. AI Analysis: Uses AI (via OpenAI or DeepSeek) to categorize data into Strengths, Weaknesses, Opportunities, and Threats, and generates detailed narrative sections for each. Create Report Sections: Produces a strategic introduction, conclusion, table of contents, and title page using AI. Format and Combine: Converts all sections into styled HTML and merges them into a single document. Generate PDF: Converts the HTML into a polished, multi-page PDF using APITemplate.io. Save and Share: Saves the report back to Google Sheets and emails the PDF to a specified recipient. The result is a professional, investor-ready SWOT report with minimal manual effort, ready for sharing or review. --- Setup Steps Setting up this workflow typically takes 15-30 minutes, depending on your familiarity with the tools. Here’s what you’ll need to do: Configure Credentials: Set up API keys and OAuth2 credentials for Google Sheets, OpenAI, APITemplate.io, Gmail, and optionally DeepSeek. Prepare Your Google Sheet: Download the provided "SWOT Analysis" template, fill out the "Company Info Input" tab with your company data, and ensure it’s accessible. Import the Workflow: Copy the workflow JSON into your n8n instance and connect your credentials. Detailed instructions for each step, including credential setup and customization options, are available in the sticky notes within the workflow. Refer to these for step-by-step guidance. --- Benefits Efficiency: Automates the entire SWOT report generation process, saving hours of manual work. Professional Output: Delivers fully styled HTML and PDF reports with headings, paragraphs, and custom layouts. AI-Driven Insights: Ensures clarity and relevance in every section through targeted AI analysis. Seamless Sharing: Automatically saves reports to Google Sheets and emails them to stakeholders. This workflow is perfect for entrepreneurs, consultants, or strategists looking to streamline their SWOT analysis process and deliver high-quality, professional reports effortlessly.
Stock fundamental analysis & AI-powered reports with Mistral and AlphaVantage
Fundamental Analysis, Stock Analysis, and AI Integration in the Fundamental Analysis Tool --- Overview of the Tool The Fundamental Analysis Tool is an automated workflow designed to evaluate a stock’s fundamentals using financial data and AI-driven insights. Built in the n8n automation platform, it: Collects financial data for a user-specified stock from AlphaVantage. Processes and structures this data for analysis. Analyzes the data using the Mistral AI model to provide expert-level insights. Generates a visually appealing HTML report with charts and delivers it via email. The tool is triggered by a form where users input a stock symbol (e.g., "NVDA" for NVIDIA) and their email address. From there, it follows a three-stage process: data retrieval, data processing, and AI analysis with report generation. --- Fundamental Analysis: The Foundation Fundamental analysis involves evaluating a company’s intrinsic value by examining its financial health, competitive position, and market environment. This tool performs fundamental analysis by: Data Retrieval Data Types: Six types of data are retrieved via HTTP requests: Overview: General company details (e.g., sector, industry, market cap). Income Statement: Revenue, net income, and profitability metrics. Balance Sheet: Assets, liabilities, and equity. Cash Flow: Operating, investing, and financing cash flows. Earnings Calendar: Upcoming earnings events. Earnings: Historical earnings data (annual and quarterly). Key Metrics Analyzed The tool structures this data into 8 categories critical to fundamental analysis, as defined in the "Code1" node: Economic Moats & Competitive Advantage: Assesses sustainable advantages (e.g., R&D spending, gross profit). Financial Health & Profitability: Examines ROE, debt levels, and dividend yield. Valuation & Market Sentiment: Evaluates P/E ratio, PEG ratio, and book value. Management & Capital Allocation: Reviews market cap justification and cash allocation (e.g., R&D, buybacks). Industry & Risk Exposure: Analyzes revenue cyclicality and geopolitical risks. Key Metrics to Probe: Investigates net income trends and gross margins. Red Flags: Identifies risks like inventory issues or stock dilution. Final Checklist: Summarizes pricing power and risk/reward potential. These categories cover the core pillars of fundamental analysis, ensuring a holistic evaluation of the stock’s intrinsic value and risks. --- Stock Analysis: Tailored Insights The tool performs stock-specific analysis by focusing on the user-provided stock symbol. Here’s how it tailors the process: Input and Customization Form Submission: Users enter a stock symbol (e.g., "NVDA") and email via the "On Form Submission" node. Dynamic Data Fetching: The "Set Variables" node passes the stock symbol to the API calls, ensuring the analysis is specific to the chosen stock. Processing for Relevance Data Filtering: The workflow limits historical data to the last 5 years (via the "Limit" node), focusing on recent trends. Merging and Cleaning: The "Merge" and "Code2" nodes combine and refine the data, removing irrelevant fields (e.g., quarterly reports) and aggregating annual reports for consistency. Output The final report is titled with the stock’s name (e.g., "Fundamental Analysis - NVIDIA"), ensuring the analysis is clearly tied to the user’s chosen stock. This stock-specific approach makes the tool practical for investors analyzing individual companies rather than broad market trends. --- AI Integration: Expert-Level Insights The integration of AI (via the Mistral model or others) is what sets this tool apart, automating complex analysis and report generation. Here’s how AI is woven into the workflow: Data Preparation for AI Structuring: The "Code1" node organizes the raw data into a JSON schema aligned with the eight fundamental analysis categories. This structured data is fed into the AI for analysis. AI Analysis Node: "Basic LLM Chain" uses the Mistral AI model. Prompt: The AI is instructed to act as an "expert financial advisor with 50 years of experience" and answer specific questions for each category, such as: Economic Moats: "What sustainable competitive advantages protect the company’s margins?" Financial Health: "Is ROE driven by leverage or true profitability?" Red Flags: "Are supply chain issues a concern?" Output: The AI generates a JSON response with detailed insights, e.g.: json { "Economic Moats & Competitive Advantage": "NVIDIA’s leadership in GPU technology and strong R&D investment...", "Financial Health & Profitability": "ROE of 25% is exceptional, driven by profitability rather than leverage...", ... } Validation: An "Auto-fixing Output Parser" ensures the output adheres to the expected JSON schema, retrying if necessary. Report Enhancement HTML Generation: The "HTML" node creates an initial report with placeholders for the AI’s insights and Google Charts for visualizations (e.g., ROE trends, revenue growth). AI-Driven Refinement: The "Basic LLM Chain1" node uses Mistral again to enhance the HTML, adding: Styled tables (e.g., financial ratios). Charts (e.g., bar charts for valuation, line charts for revenue). Visual indicators (e.g., ✅ for positive trends, ⚠️ for risks). Mobile-responsive design with modern fonts (Inter or Roboto). This dual AI approach—one for analysis, one for presentation—ensures the output is both insightful and user-friendly. --- Strengths and Limitations Strengths Comprehensive: Covers all key aspects of fundamental analysis. AI-Powered: Automates expert-level insights and report design. User-Friendly: Delivers an interactive, visual report via email. Limitations Data Dependency: Relies on public data, so data quality and timeliness matter. AI Constraints: Insights depend on AI’s capabilities; it may miss nuanced human judgment. Disclaimer: The tool notes it’s not investment advice, so users should consult advisors. ---
Auto-extract & distribute video clips to multiple social platforms with Klap AI
--- Overview of the Workflow The automation process consists of four main steps: Get Longform: Retrieve the long-form video data (e.g., from Google Sheets). Analyze Longform: Use Clap to analyze the video and generate short clips. Produce Shorts: Export the generated clips. Publish Shorts: Update the status in Google Sheets and publish the clips to social media platforms. Each step is handled by specific nodes in n8n, a no-code automation tool, making the entire process accessible even if you’re not tech-savvy. The workflow is visually represented in the provided n8n screenshot, with nodes connected to show the flow of data and actions. --- Step 1: Get Longform Purpose Start the automation and retrieve the long-form video data. Tips Test the node with a sample row to ensure it retrieves the correct data. Use a consistent sheet structure to avoid errors in future runs. Why It Matters This step ensures the automation starts automatically and pulls the correct video for processing, saving you from manual intervention. --- Step 2: Analyze Longform Purpose Use Clap to analyze the long-form video and generate short clips. Tips Pin the Get Shorts Details Node: Right-click and pin it to retain data for testing across sessions. Test with a Sample Video: Run the workflow with a short video to verify Clap’s output. Why It Matters Clap’s AI identifies key moments and generates clips, saving hours of manual editing. The wait and status nodes ensure the workflow progresses only when ready. --- Step 3: Produce Shorts Purpose Export the generated clips for publishing. Tips Preview the clips after export to ensure quality. Adjust wait times based on export duration observed during testing. Why It Matters This step finalizes the clips, making them ready for publishing, with wait nodes preventing premature progression. --- Step 4: Publish Shorts Purpose Update the video’s status in Google Sheets and publish the clips to social media. Tips Add an If Node: Before updating, check if the status is already "done" to skip processed videos. Organize Clips: Use Google Sheets columns (e.g., "TikTok," "YouTube") to assign clips to platforms. Why It Matters This step automates publishing across multiple platforms and keeps your workflow organized by updating statuses. --- Additional Tips for Efficiency No-Code Simplicity: n8n’s drag-and-drop interface requires no coding—adjust nodes visually to suit your needs. Handle Processing Times: Use wait nodes to manage delays in analysis and export steps. Monetization Ideas: Offer this automation as a service to businesses or creators. Submit clips to platforms like "Wop" for earnings based on views. Testing: Run the workflow with a sample video, pinning nodes to retain data for debugging. --- Benefits of AI Automation Time Savings: Automate clipping and publishing, freeing you for creative tasks. Scalability: Produce 100+ shorts from one video, boosting reach. Consistency: Maintain a regular posting schedule effortlessly. Cost-Effective: Reduce reliance on manual editing or expensive tools. --- This workflow leverages n8n and Klap to streamline short-form content creation, making it ideal for content creators looking to maximize their long-form videos. If you need further clarification or help with specific nodes, let me know!
Automate Chinese to English translation in Google Slides with Openrouter AI
--- Overview of the n8n Workflow This n8n workflow automates the translation of text in Google Slides presentations from one language to another using AI. It retrieves a specified presentation from Google Drive, extracts text from the slides, translates it in batches, and updates the presentation with the translated text. The workflow includes sticky notes with setup instructions and guidance on editable fields, formatted in Markdown for clarity. --- Step-by-Step Execution of the Workflow Here’s how the workflow operates, node by node, based on the JSON and image descriptions: Manual Trigger Node: "When clicking ‘Execute workflow’" Function: Initiates the workflow when the user manually clicks "Execute workflow" in n8n. Search for Google Slides Presentation Node: "Google Drive" Function: Searches Google Drive for a presentation file. Retrieve Presentation Data Node: "Google Slides2" Function: Fetches the full presentation data from Google Slides. Extract Text from Slides Node: "Code" Function: Extracts text from the presentation using JavaScript. Split Text Array Node: "Split Out" Function: Breaks the extracted array into individual items. Process Text in Batches Node: "Loop Over Items" Function: Loops over the text items in batches for efficient processing. Translate Text with AI Node: "AI Agent" Function: Translates text from Chinese to English using an AI model. Provide AI Model Node: "OpenRouter Chat Model" Function: Supplies the AI language model for the "AI Agent". Replace Text in Slides Node: "Replace text" Function: Updates the Google Slides presentation with translated text. Delay Between Batches Node: "Wait" Function: Adds a delay to prevent overwhelming the system. --- Sticky Notes: Setup and Customization Guidance The workflow includes three sticky notes with Markdown formatting, providing essential instructions: --- How to Set Up the Workflow To use this workflow in n8n: Import the JSON: Copy the provided JSON into n8n to load the workflow. Configure Credentials: Google Drive: Set up OAuth2 credentials ("Google Drive Auth") with access to the folder containing your presentation. Google Slides: Set up OAuth2 credentials ("Google Slides Auth") with edit permissions for the presentation. OpenRouter: Create an account at openrouter.ai and add the API credentials to the "OpenRouter Chat Model" node. Customize the Google Drive Query: Update the "Google Drive" node’s queryString to match your presentation’s name or ID (default is "slides"). Test the Workflow: Click "Execute workflow" to run it manually and verify each step. --- Potential Customizations You can adapt the workflow for different needs: Change Language Pair: Modify the "AI Agent" node’s system message, e.g., replace "convert all of them into English" with "convert all of them into French" to translate Chinese to French. Use a Different AI Model: Replace the "OpenRouter Chat Model" node with another AI provider (e.g., OpenAI) by updating the node type and credentials. Expand Text Extraction: Edit the "Code" node’s JavaScript to extract text from tables or other elements, not just shapes. Adjust Batch Processing: Change the "Loop Over Items" node’s batchSize (e.g., to 10) or the "Wait" node’s amount (e.g., to 1 second) for performance tuning. Process Multiple Presentations: Remove the limit: 1 in the "Google Drive" node and add a loop to handle multiple files. --- Considerations and Improvements Error Handling: The workflow lacks explicit error handling. Add "If" nodes or error outputs to manage failures (e.g., if no presentation is found). Text Coverage: The "Code" node may miss text in non-shape elements (e.g., tables). Test with your presentation to confirm coverage. Performance: For large presentations, the 2-second wait per batch of 5 may slow things down. Adjust based on your needs and API limits. Permissions: Ensure your Google credentials have edit access to the presentation, or replacements will fail. --- Conclusion This n8n workflow efficiently automates the translation in Google Slides, leveraging Google Drive, Google Slides, and AI via OpenRouter. It’s well-documented with sticky notes and easy to set up with proper credentials. While robust for its purpose, it could benefit from error handling and broader text extraction. You can customize it for different languages, models, or file types by tweaking the relevant nodes as outlined. If you have a specific question or need help with a modification, let me know! OptiLever