LongCut logo

All you need to know about Triggers in n8n

By Ahmad | AI Automation

Summary

## Key takeaways - **Manual Trigger: For Testing & Quick Starts**: The manual trigger in n8n is ideal for testing workflows or individual nodes because it activates the workflow upon clicking a button, allowing for quick iteration and debugging. [02:17] - **Scheduled Triggers: Leverage ChatGPT for Cron Expressions**: For scheduled triggers, instead of deciphering complex cron syntax, you can use ChatGPT to generate the correct expression by simply describing your desired schedule, making it more flexible and reliable. [05:54] - **Webhook Triggers: The Powerhouse for External Automation**: Webhook triggers are extremely powerful for running workflows externally, allowing them to be initiated from any website or even a mobile phone via a unique URL. [07:34] - **Form Triggers: Build and Test Custom Forms**: The form trigger allows you to quickly create and test forms with various field types like text, date, and dropdowns directly within n8n, with submissions triggering the workflow. [08:31] - **App-Specific Triggers: Automate with Google Sheets & Airtable**: Many applications like Google Sheets and Airtable offer specific triggers, such as 'on row added' or 'on row updated,' enabling direct automation based on data changes within those apps. [12:49]

Topics Covered

  • Manual Triggers: Your Workflow's Essential Testing Tool
  • Why You Don't Need to Understand Cron Expressions
  • Webhooks: The External Gateway to Your Automations
  • How to Simplify Large Automations with Sub-Workflows
  • App-Specific Triggers: Integrate Workflow with Your Tools

Full Transcript

Hello everyone and welcome to another

lesson. I'm very happy to have you here

with me today. Today we are going to

delve deep inside uh and it end and

we're going to go over triggers. Now

triggers are very important as they are

the first step in your in your

workflows. So we're going to check out

what types of triggers we can make and

explain more about that. But before I

start, I'd like to point your attention

to my store. Here you will find all of

the workflows that I've worked on in N8N

and also in make as well. If you want to

take advantage of that, uh you can

download them and you can reuse them,

use them in your automations and you can

even tweak them and resell them. I have

also beginners course for both make and

and

8N. They are a great way to start or if

you're switching from one another, you

can take those beginners course and uh

proceed uh with a with a much stronger

base. Okay, as I say, basics the basics

are the most important thing. So, you

should have a solid uh base background

for before you start. That being said, I

will put a link of this store in the

description

below. So, let's go back to N8N and

let's start with clicking this uh orange

button on the top right says create

workflow. So, here we have add your

first step. So, this is exactly what a

trigger is. A trigger is a first step.

So if I click on this, it tells me what

trigger what triggers this workflow. So

what starts this workflow? So always

keep in mind that a trigger is a way

that starts your automation. You need a

way to start the automation whether it's

manual, whether it's uh uh from an

external source, whether it's on

schedule chat

form, whatever, whatever that is. And

today we're going to go over those. So

let's start with the first one. So

trigger manually. What this does is it

runs the workflow on clicking a button

in N8N. Good for getting started

quickly. Perfect. So if we click on

that, we'll see

this. Now a trigger always has this

round corners on the left side. So this

tells you that this is this is how it

starts. And you can see it doesn't have

a connector. This is a connector. It

doesn't have a connector on this side.

It has a lightning bolt. So this means

that it's a trigger.

Okay. Uh so when clicking test workflow,

so when you click this button test

workflow or this

button, the workflow will run and you

will see this green check mark in one

item. that means that this has started.

Okay. Now a this types of trigger a

manual trigger cannot you cannot

activate your workflow with a manual

trigger. The reason why is that a manual

trigger needs to be uh needs to be

triggered like manually as the word

says. So you need to click a button for

it to start. So this is why you cannot

activate it. Okay. So that being said,

the uh the manual trigger is a very good

way for you to test your workflow. So

you can have multiple triggers inside of

your workflow. And usually I have that I

usually have one manual and the other

types of triggers in my workflow. And I

use the manual if I ever want to test

the workflow or test a node by itself. I

can just uh connect it to that and uh

and we'll be done. Okay. So, this is the

manual trigger. Now, the trigger has

this start button, the activate and

deactivate, the delete button, and you

can rename, you can duplicate, and you

can uh test.

Okay. So, I'm going to tidy up the

workflow. So, this is the manual. Let's

check out what other types of triggers.

Now if you see if I click plus now here

it doesn't show me the triggers because

I already have a trigger but there's on

the on the bottom of this menu there is

this add another trigger. So you can add

multiple triggers. So the first one is

the trigger manually.

Okay. Now uh there's on app event. I

will skip this one. Get back to it in a

second. There's on schedule.

So the onschedule one as you can see it

has a stopwatch and has the same looks

of a trigger but has a stopwatch. So

what this does is um it's just run on

schedule. So if I double click on it

you'll have these rules. So you can have

seconds run each 30 seconds each 30

minutes each 30 days. You can each one

week each one month each 12 month. So

that's a year. So you can have what you

can do whatever you want. You can add

several rules as well. But the the cool

thing and the thing that I use most is

the custom. I don't like to use these

things a lot. I like to use the custom.

And the custom is using a cron

expression. So what is a chron

expression before you get scared and

close this video? Uh the cron expression

is is an easy one to do. Why is it easy?

Because I don't know. I don't understand

it. I go here and and I click chat GPT

and I enter here and I tell

it and I tell it, hey, can you write me

a chron

expression that

runs an

automation every day at 9:00 a.m. and

12 p.m. and 6

p.m. There you go. We wrote the uh

command chat GPT is now thinking. I

don't think it likes it that I'm not

logged in. Uh but let's wait and see

what it gives us. There you go. It gave

us the It gave us exactly what we need

to copy. Then we go back here and then

we paste. And that's it. That's it.

That's what you need to do. You don't

understand how you don't need to

understand how all of this work. Of

course, you can you can but uh the why I

use chrome is uh it's much more flexible

in terms of I can just say what I want

and uh chipd gives me the expression and

uh it's more reliable. I've tested the

other ones and sometimes they don't

trigger sometimes. not all the time and

the chrome one always works. So this is

why I use the chrome

one. Okay, so this is the schedule

trigger. Let's check out what other

triggers we have. So we have on web

hook. So uh we went through this

before. The web hook is uh I have a

lesson on that and I went I go into that

deeply in the course. Uh but yeah, the

web hook is a way to run your workflow

externally. Okay. So you have this URL.

You can trigger it from anywhere from

any website from even from your cell

phone just by going to this uh uh URL.

Uh you you can trigger your workflow. Of

course you use the production URL. Once

you activate, you need to use the

production and not the test one. Okay.

web hook is extremely important, is

extremely powerful. It runs most of my

workflow. I either use uh the schedule

or the web hook uh mostly.

Okay, now let's see what else do we

have. So we have unformed submission. So

once we have that once we click on that

uh so we can re rename our title uh

welcome for

example

description and then we can specify what

fields do we want first name

uh element text placeholder so we say

name

okay put your in

here. Put it as a required field.

Respond is workflow finishes or yeah,

when do you want to this response? So,

as soon as this node receives the form

submission or when the last node of the

workflow is executed. Yeah, we can keep

things as is. And if we go ahead and we

test the

workflow, there you go. It opens up a uh

a browser window. So this is test

version of your

site. Jack submit form submitted. And

then you have here if you click on that

you have here your

uh uh your data. Okay. You can put as

many form fields as you want. You have

text date drop-down file password

text area. So many things that you can

do. Of course, you can use Google forms

and you can use whatever other ways you

want or like even a form on your

website. You can use that. But this is

good for testing purposes. Now, be

careful also if you use the test URL,

the production URL. Once you activate

your automation, always use the

production one. All right. So, this is

the form.

Let's uh add another

one. So we add another

trigger. So execute on from another

workflow. Okay. So here is you define uh

that this is how uh if if you want if

you're in the case where you want

another

workflow to trigger this. Okay. So if

you if if you have another workflow uh

that is very big and you want to break

it into pieces, you can do this. You can

say okay this will be executed by

another

workflow

and and here you can put the input data.

Okay. Uh you can you can define the

inputs or you can put a JSON. Okay. Uh

or accept all data. So whatever data

that comes uh will will be will be here.

Okay. Uh so let's uh save this and let's

name this

triggers.

Okay. Uh let's now go ahead

and so let's chat is a very famous

one. So uh usually you use this chat one

whenever you're doing AI agent. So you

open the chat and then you can have the

chat. Hello

there. Bam. So it got submitted and here

you can see session ID, the action and

the chat input. So this is majorly used

whenever you're creating AI agents.

Okay. So uh yeah now there are other

ways as well. You can an error trigger.

We handle that as well. You can have an

email trigger but first you need to uh

uh this is a good one. You need to first

connect your email address using the

imap. So you you should have your own

uh email specific email. You can use

Gmail but this is more for uh specific

business emails.

Okay. Now I wanted to go over the

triggers that are on app. So these are

the triggers that relates to certain

apps. For

example, if we go to Google

Sheets, Google sheet has three triggers.

Okay. Unrow add, unroll update, unrow

added or updated. So, this triggers

whenever uh there's a new row updated.

Okay.

And of course every app uh you might

find that it has triggers right if you

go to air tableable and let's see if it

has a trigger a new air table event. So

every app for example might have a

trigger uh associated with that you can

start with. Okay. Uh so in terms of uh

which ones I use the most as I mentioned

before

uh I mainly mainly use the schedule the

web hook uh for most of my workflows. Uh

whenever the uh automation is quite big

I use execute by another

workflow. Uh and then

um yeah, I just wanted you to u to check

out this

one. Uh so this is this uh this gets

triggered by one of these nodes in

another workflow. Like in another

workflow, you can here you can choose

your workflow, right? Uh in another

workflow, you would have this and it

would point to this triggers in N8N.

Okay, probably I'm not going to find it

now because I need to refresh. But all

of your uh workflows are here and uh you

just need this to be in another workflow

and point to this one. Then whenever uh

in another workflow you reach this node

it activates then this workflow runs.

Okay, let me just test that for you guys

to uh to

see. I'm going to refresh.

I'm going to create a sample workflow

here. Let's do a manual

one. But first, I need to

uh yeah, let's uh trigger manually. Add

an edit

fields this to have a

variable. Then we can trigger the

workflow and

then yeah see you can find your workflow

here.

Uh yes consume all data run once and

then

uh this we don't need. Uh this would

wait for the sub workflow. This this

would wait for the sub workflow to

finish before it completes. Okay, but in

this case we don't need

that.

Uh yes, everything looks good from here.

So let's save. And if

we

go if we go to our triggers

workflow and

uh delete all

these okay then let's

uh

Let's say test

workflow. Let's run

this. Bam. It ran. And let's test this.

Let's see what data

uh

Yeah, I just need to see the executions,

I

think. Let's run this again.

There you go. Now we have our data that

is executed from this one. We sent the

name Jack and then it uh just accepted

it. Okay. And we received it. This is

just for you guys. I wanted you guys to

see

uh how this would work.

Uh all right. So we went through a lot

of triggers today. Uh of course there's

a lot more because they're tied to the

app per app basis. So a lot of the apps

the that are included inside of N810

might have triggers. You can use that as

well app specific triggers. But the

general triggers that you would use are

uh those ones here. Uh if I move these

here. Yeah, those one here are the

general ones that you could use and

utilize in your workflows. Okay,

triggers are very important. Uh they're

the step one of your workflow. They are

crucial to starting your workflow.

They're crucial to testing your

workflows and automations. I hope this

video was beneficial to you guys and you

would also utilize other types of

triggers in your workflow moving

forward. Uh don't forget to check out

the link in the description below. I

hope you liked this video. If you did,

please give it a like. Uh that will help

the channel. Also, subscribe if you want

to see more videos. And I'm going to see

you in the next video. Thank you for

watching.

Loading...

Loading video analysis...