Introducing LLMs into Workflows

Introduction to Workflow Automation with n8n

James Chapman

AI Curriculum Manager, DataCamp

Fixed rules vs. language understanding

 

  • Rule-based nodes: same input, same output, every time

rules.png

 

  • LLMs: same input, slightly different output each time

llms.png

Introduction to Workflow Automation with n8n

When to use each

 

rules_vs_llms.png

 

  • LLMs → summarizing, drafting, interpreting messy input

 

  • Rule-based → calculations, formatting, yes/no decisions

 

→ If a rule can handle it, use the rule

Introduction to Workflow Automation with n8n

New node: AI Agent

agent_config.png

agent_subnode.png

  • The Agent node sends a prompt to a language model and returns the response
  • Think of the Agent as the orchestrator and the Chat Model as the engine
Introduction to Workflow Automation with n8n
Introduction to Workflow Automation with n8n

The Agent's output

  • The Agent returns a text field → use it downstream like any other node output
  • Pass it to Edit Fields, branch with If, or chain into more nodes

agent_outputs.jpg

Introduction to Workflow Automation with n8n

Let's practice!

Introduction to Workflow Automation with n8n

Preparing Video For Download...