Prompt
Prompt template for combining email input and uploaded document content.
---EMAIL---
{input}
---
---UPLOADED DOCUMENTS CONTENT---
{context}
---
This workflow extracts and organizes key information from emails and attached files, utilizes AI to process and structure the data, and outputs the results as a CSV file for easy analysis and reporting. Ideal for automating email data management and integration with spreadsheets.
Collect Email Inputs and Attachments
Gathers email content and uploaded files as the starting point for processing.Retrieve and Aggregate File & URL Content
Extracts content from attached files and specified URLs to include as context for further processing.Analyze and Organize Data with AI Agent
Uses an AI agent to review, summarize, and organize the email and related document data, leveraging chat history and contextual information.Generate Structured Data Output
Transforms the organized data into a structured format using AI, preparing it for export.Export Results to CSV
Outputs the structured data as a CSV file, making it easy to access, analyze, and share.Below is a complete list of all prompts used in this flow to achieve its functionality. Prompts are the instructions given to the AI model to generate responses or perform actions. They guide the AI in understanding user intent and generating relevant outputs.
Prompt template for combining email input and uploaded document content.
---EMAIL---
{input}
---
---UPLOADED DOCUMENTS CONTENT---
{context}
---
Agent prompt for managing and analyzing email-related data and communications.
You are an advanced AI assistant tasked with managing email-related data and email communications efficiently. Your role involves three main tasks: reviewing and organizing email data, extracting and structuring relevant data. you should give a big overview based on the emails and the attached file.
Prompt template for turning data into a detailed structured output.
turn the given data in to a structured output with as much detail as possible
---GENERAL INFORMATION---
{input}
---
---DATA FROM ATTACHED FILES---
{context}
---
Below is a complete list of all components used in this flow to achieve its functionality. Components are the building blocks of every AI Flow. They allow you to create complex interactions and automate tasks by connecting various functionalities. Each component serves a specific purpose, such as handling user input, processing data, or integrating with external services.
Flow description
This workflow is designed to automate the extraction, structuring, and management of data from emails and associated documents, such as file attachments and URLs. It leverages advanced language models and prompt engineering to process unstructured information and output structured summaries, making it particularly useful for tasks like email triage, customer support, or large-scale data extraction from communication channels.
The flow connects several components that handle user input, file and URL content retrieval, prompt construction, large language model (LLM) processing, agent-based reasoning, and structured data output. Its key benefits are scalability, automation, and the ability to handle complex or high-volume data extraction tasks with minimal manual intervention.
URL Retriever: The workflow can also retrieve content from specified URLs, parsing and chunking the information for downstream use. This is useful when emails reference external resources or knowledge bases.
Chat History: The system maintains a memory of the last 5 chat messages (up to 800 tokens), providing context for better understanding and continuity.
Prompt Templates: The workflow uses templates to dynamically construct prompts for the LLM and agent, incorporating:
These prompts are designed to maximize the LLM’s ability to understand and structure the incoming information.
Google Gemini LLM: The workflow uses Gemini 2.5 Flash for high-quality language understanding and generation, with temperature set to 0 for deterministic outputs.
Tool Calling Agent: An advanced agent receives the composed prompt, chat history, and tools (such as file/URL retrievers) to:
The agent is guided by a system message to focus on efficiency and data structuring.
Structured Output Generator: The agent’s response, along with additional context, is passed through another prompt and LLM (also Gemini) to produce a structured output. The required fields are:
CSV Output: The structured data is then exported as a CSV file, making it easy to process, analyze, or import into other systems.
Component | Role |
---|---|
Chat Input | Collects user messages and file attachments |
File Retriever | Extracts text from uploaded documents |
URL Retriever | Retrieves and processes content from specified URLs |
Chat History | Maintains recent message context |
Prompt Template | Dynamically builds prompts for LLM/agent |
Gemini LLM | Processes prompts and generates responses |
Tool Calling Agent | Orchestrates tools and LLMs for data extraction/structuring |
Structured Output Generator | Formats extracted info into a structured object |
CSV Output | Exports structured data to CSV format |
Chat Output | Displays agent’s response in chat |
This workflow dramatically reduces the time and effort required to extract actionable, structured data from emails and their attachments. It is highly scalable—capable of handling multiple messages and file types in bulk—and automates a process that would otherwise require significant human effort. By integrating advanced LLMs, tool agents, and prompt engineering, it ensures both high precision and adaptability, making it a powerful asset for businesses and organizations aiming to streamline their information processing pipelines.
We help companies like yours to develop smart chatbots, MCP Servers, AI tools or other types of AI automation to replace human in repetitive tasks in your organization.