compsci_ai_herk/build n8n ai agents - 8 hr course/_subsections/lesson-02.org
2025-07-16 21:38:17 +03:00

2.5 KiB
Executable file

Lesson 02 | n8n foundations (workflows, variables, etc)

Notes

  • n8n lets you automate anything

templates

  • n8n
  • nate herk

credentials

  • in order to use any api you usually need some kind of credentials

workflow

node structure

  • every node has three main parts

    • input
    • configuration

      • credentials
    • output

adding new credentials

open ai
  • go to Dashboard
  • select API keys
  • key: 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
add the api key
  • in n8n
  • go to the tool (message a model)
  • go to "credential to connect with"
  • select "create new credential"
  • enter the API key
  • in the upper left hand corner where it says "Open AI" you can rename that to whatever you want, ie the api key name
change the Model used
  • go to 'from list' in the Model section
  • pick GPT-4.1-MINI

test it

  • add something to prompt tell me a joke
  • click execute and see the results

output panel has 3 options

  • schema
  • table
  • json

connect the output with another tool

get the set Edit field
  • click on the + button
  • in the search bar, enter 'set' and pick the Edit Fields node
modify the node
  • click 'Fields to Set'
  • type in a name for the variable
  • from the Input panel drag the paprt you want to 'value'

trigger types

  • manual trigger
  • chat trigger

using chat trigger

  • go to 'message a model' node
  • delete whatever is in the prompt field
  • drag chatInput to the prompt field

templates

n8n company

  • http://n8n.com
  • go to Product->Templates
  • choose tiktok clone template

set up telegram account

API Key
7944661605:AAFko2fVauPj_iNALgNf-WDr9wUrVEGDTzs
bot username
on_tutorial_nate_clone_bot
bot name
n8n-herk-tutorial-tiktok-clone