Security in Enterprise AI

2. Building Your First Workflow

2. Building Your First Workflow

Learn how to create a powerful financial research agent with custom prompts, user inputs, and dynamic outputs—all in one workflow.

In this hands-on session, you’ll build a financial analyst AI agent that processes SEC filings like 10-Ks and 10-Qs. You’ll learn how to start from a blank workflow, configure LLMs, define custom prompts, and design a user interface with file uploads, verbosity controls, and input instructions. By the end, your agent will be able to extract insights, cite references, search a knowledge base, and export results as PDF, Word, or Excel—automatically.

Summary

  • Create a StackAI workflow from scratch using the workflow builder

  • Upload a 10-Q or 10-K financial file via a file input node

  • Configure a large language model (e.g. Gemini) and connect it to the file input

  • Write a custom prompt for financial analysis with references and citations

  • Add user inputs for custom instructions and verbosity level (e.g. bullet points, deep analysis)

  • Build a structured form-based UI with inputs and dynamic outputs

  • Add a second LLM agent focused on Management Discussion & Analysis

  • Connect both analysts to a SharePoint knowledge base of past reports

  • Run and test the agent with live inputs and see model output in real time

  • Enable multiple outputs for different analytical focuses

  • Customize the UI with branding, SSO, and access controls

  • Export results in PDF, Word, Excel, or plain text formats

  • View usage in the Analytics tab and monitor real-time activity in the Manager view

  • Next step: Learn to use the Quick Start flow to build a GPT-style assistant in the following video

────────────────────────────────────────────────────────────────────────────────────

Course Overview

At Stack AI, our goal is to empower every customer to build AI agents with confidence. That’s why we’re introducing Stack AI Academy — a brand-new educational series built to support your journey.

Stack AI Academy provides a solid foundation for getting started with Stack AI, offering step-by-step courses that guide you through the platform and its capabilities.

Welcome to Stack AI Academy - Course #2 - Building Your First Workflow. In this course, we’ll show you how to build your first workflow, by creating an AI agent that analyzes 10-Q and 10-K documents.  

Read the blog to learn the basics of building AI agents in StackAI, and get prepared for more advanced courses.   

First Workflow: How to Build a 10-Q/10-K Document Analyzer 

To start building your workflow, drag a File node onto the canvas.

This node will allow you to upload your 10-Q and 10-K documents. 

Press “Click to upload”. Upload your 10-Q or 10-K document for analysis.

Now add an LLM from the drop down menu — choose Google Gemini. 

Choose Google Gemini 2.0 Flash. 

Connect the Files node to the LLM. 

Enter the following instructions into the instructions box. 

You are an Al assistant that analyzes 10k/10Q filings. Your job is to read the document and extract information from it.

• Respond in bullet points.

• Give citations for where in the document vou find each source

Write the following in the prompt box.

Drag an Output box onto the canvas and connect it to the LLM.

Now run the AI agent. The report will be returned into the box. 

You can check the raw output by clicking the sections in “Run progress”. 

Now let’s add some more inputs. Let’s add inputs for user instructions and verbosity. 

User instructions will steer the AI agent’s interpretation of the analysis, and the verbosity will instruct the AI agent how to write the report. 

Let’s write a new Prompt to account for these inputs. Enter the following text into the “Edit Prompt” box. 

Additional instructions 

<user_instructions> 

User Instructions 

</user_instructions>

Writing style:

‹style>

Type / to browse options...

</style>

Report to extract information from:

<report>

</report>

You extract and summarize information about financial statements:

Income Statement - Revenue, profit, expenses, net income (are they making or losing money?)

Balance Sheet - Assets, liabilities, shareholder equity (how strong is their financial position?)

Cash Flow Statement - Operating, investing, and financing cash flows (how well are they managing cash?)

Now we’ll add a Knowledge Base as a Tool. The Knowledge Base contains previous 10-Q and 10-K documents. If certain conditions are met, this will trigger the Knowledge Bases. 

In this case, we’ll choose a Knowledge Base that we’ve already saved in StackAI. 

Let’s go back to the canvas. Now we’re going to add another LLM to the workflow. To do this, simply select the Google LLM. Then copy it and paste it onto the canvas. It’s just a simple copy-paste. 

Connect the Verbosity input box and the Files input box to the new LLM. Do not connect the User Instruction box. 

Now add in User Instruction Box 2 for the new LLM. Connect it to the new LLM. 

Let’s edit the Prompt section of the new LLM. Replace User Instruction 1 with User Instruction 2. 

Change the instructions to the following:

Now let’s add a new Output box for the new LLM.

Go to the Export tab. 

Give your AI agent a name and a description. 

Update the Fields section to look like the following:

Now save your Interface.

It’s time to try out your AI agent! Fill in the user instructions, verbosity, and upload any necessary files.

 And voila — you have two reports based on the 10-Q/10-K documents. The first report gives a financial overview of the document.

And the second report is from the perspective of a management analyst.