Mission Objective

You've written the Job Description for your first AI worker. Now, before you send them out into the field, you need to pack their backpack. By the end of this session, you will understand the Workflow Node Types (the actual blocks in Foundry), know when to use each type of block, understand Variables—how to pass data between blocks, and complete a "Component Selection Matrix" for your agent.

Think about going on a hike: Do you need a GPS? (Tool: Web Search) Do you need a map of this specific trail? (Knowledge: Your company files) Do you need a calculator for measuring distances? (Tool: Python Code) Do you need a walkie-talkie to call base camp? (Tool: Email/Teams)

An AI agent is the same. You must decide: What brain does it need? (Model) What tools does it need? (Actions it can take) What knowledge does it need? (Files it can read)

But there's more! You also need to think about HOW the expedition unfolds. What if there's a fork in the trail? What if you need to ask a guide for directions? What if you need to repeat a section? This is where Workflow Nodes come in.

Key Takeaways:

  • Understand the Workflow Node Types (the actual blocks in Foundry)
  • Know when to use each type of block
  • Understand Variables—how to pass data between blocks
  • Complete a "Component Selection Matrix" for your agent

The Gear List (Components)

In Foundry, when you build a workflow, you're connecting nodes together. Each node is a block that does something specific. Let's learn them all:

Invoke Agent Node

Calls an agent to do its job and returns the output. Use whenever you need an AI to think or act. Example: You have a "YouTube Title Generator" agent. You add an "Invoke Agent" node, select that agent, and give it an input (the user's topic). It returns 5 title ideas. Configure: Agent (which agent to call), Input Message (what text to send), Output Variable (where to store the response).

Data Transformation (Set Variable)

Creates, modifies, or combines data. Use to: capture the user's initial input, combine outputs from multiple agents, prepare data for the next step. Example: Your workflow has Title Generator and Description Generator. You use Set Variable to create "combined_output" that concatenates both. The Hiking Metaphor: This is like writing notes in your expedition logbook.

Logic: If/Then/Else

If a condition is true, go one way. Else, go another. The Hiking Metaphor: "If it's raining, take the short route. Else, take the scenic route." Example: After generating a title, ask the user "Do you approve?" If "yes", send email. If not, loop back and regenerate.

Logic: Go To

Jump to a different point in the workflow. The Hiking Metaphor: "Go back to the trailhead and try again." Use this to create loops for iterative refinement until the user is satisfied.

Logic: For Each

Repeat an action for every item in a list. The Hiking Metaphor: "Check every water bottle in your pack." Use for processing lists of items like emails, products, or customers.

Basic Chat: Send Message / Ask a Question

Send Message displays text to the user (no response expected). Ask a Question displays text and WAITS for the user to respond, saving the response to a variable. Use Ask a Question for Human-in-the-Loop approval. Example: "Do you approve? (Type 'yes' to proceed)" saves to variable "approval_input".

Understanding Variables

Variables are the backpack where you store information as you move through the workflow. There are two scopes: System Variables (built-in information from Foundry) like System.LastMessage.Text (the user's last message) and System.Conversation.Id (the unique ID of this chat). Local Variables are ones you create, like Local.user_input.

Example Flow: 1. User sends "Create a video about AI agents." 2. Set Variable: Local.user_input = System.LastMessage.Text 3. Invoke Agent (Title Generator): Input = Local.user_input, Output = Local.title_output 4. Invoke Agent (Description Generator): Input = Local.user_input, Output = Local.desc_output 5. Set Variable: Local.combined = Local.title_output + Local.desc_output 6. Invoke Agent (Editor): Input = Local.combined

Real Example—The YouTube Workflow: Goal is to generate a YouTube title and description, get user approval, and send it by email. The flow: Start → Set Variable (user_input) → Invoke Agent (Title Gen) → Invoke Agent (Desc Gen) → Set Variable (combined) → Invoke Agent (Editor) → Ask Question (Do you approve?) → If/Then/Else (Is it "yes"?) → YES path: Set Variable (email_prompt) → Invoke Agent (Email Agent) → End. NO path: Set Variable (updated_input) → Go To: Title Gen (Loop!)

Key Insights: The If/Then/Else checks the user's approval. If "No", the Go To creates a loop back to regeneration. Variables carry data between agents throughout the workflow.

Key Points to Remember:

  • Workflows are built from Nodes—each node does one thing
  • Invoke Agent is your main workhorse—it calls an AI
  • Variables pass data between nodes like a backpack
  • Logic nodes (If/Else, Go To) let you create smart flows with branching and loops
  • Ask a Question enables Human-in-the-Loop approval

The Trail Map (The YouTube Workflow Example)

1 START: User enters a video topic
2 SET VARIABLE: Capture user_input = System.LastMessage.Text
3 INVOKE AGENT: Title Generator receives user_input, outputs title_output
4 INVOKE AGENT: Description Generator receives user_input, outputs desc_output
5 SET VARIABLE: combined = title_output + desc_output
6 INVOKE AGENT: Editor receives combined, outputs edited_output
7 ASK QUESTION: "Do you approve?" saves to approval_input
8 IF/THEN/ELSE: If approval_input = "yes" → Email Agent → End. Else → Go To Title Generator (loop)

Field Notes: The Component Selection Matrix

For the agent you defined in Session 1, fill out the Component Selection Matrix to determine its full configuration.

  1. MODEL: Does your agent need high reasoning (GPT-4) or fast/simple (Phi-3)?
  2. KNOWLEDGE: Does it need to read your company files? If yes, which ones?
  3. TOOLS: Does it need web search? Email? Calculator?
  4. LOGIC: Will it need user approval (Ask a Question)? Will it need loops (Go To)?
  5. Map out your workflow using the node types: Where do you need Set Variable? Where do you need If/Then/Else?

Ranger's Warnings (Common Pitfalls)

Variable Scope Confusion

Did you set a variable BEFORE you try to use it? Local.customer_name doesn't exist until an agent extracts it! Always Set Variable before referencing it.

The Broken Chain

Every YES and NO path must connect somewhere. Don't leave dead ends—if the email is spam, what happens? Define it!

Forgetting System.LastMessage.Text

The most common mistake is not capturing the user's initial input. Use Set Variable immediately after Start to save System.LastMessage.Text to a Local variable.

Pro Tips

Variables are your memory—name them clearly like Local.user_input, Local.title_output, Local.approval_response.

The Ask a Question node is essential for Human-in-the-Loop. The workflow PAUSES until the user responds.