Stop using Zapier, Make, n8n
Summary
TLDRIn this video, the presenter passionately discusses 'Trigger,' a technical tool likened to Zapier, which they believe is superior for businesses and side projects. They critique no-code platforms like Zapier and N8n for their limitations and technical issues, highlighting Trigger's advantages, such as detailed workflow visualization, automatic retries for failed tasks, and the ability to use TypeScript with GitHub Copilot for streamlined coding. The presenter also emphasizes the benefits of serverless computing, concurrency control, and the flexibility of using any preferred IDE with Trigger.
Takeaways
- π The speaker expresses a strong affection for the product 'Trigger' and wishes to see its success due to its utility.
- π 'Trigger' is positioned as a technical alternative to 'Zapier', offering a more integrated approach to workflow automation.
- π οΈ The script discusses the gap between 'no-code' platforms like 'Zapier' and 'N8N' and coding-based solutions, highlighting the limitations of both.
- πΎ The speaker criticizes 'Zapier' for its clunky interface and the difficulty in editing workflows, as well as 'N8N' for its lack of intuitive error handling.
- π 'Trigger' is praised for its ability to host code, provide detailed run logs, and visualize workflow activity and failures.
- π 'Trigger' offers features like automatic retries for failed tasks, which is a significant advantage over 'no-code' alternatives.
- π₯οΈ The script emphasizes the importance of using an IDE with 'Trigger', allowing for a more personalized and efficient development experience.
- π 'Trigger' supports features like concurrency control and idempotency keys, which are crucial for handling tasks involving money and ensuring data integrity.
- π The integration of 'TypeScript' with 'Trigger' is highlighted as a significant advantage, providing developers with real-time feedback and reducing errors.
- π€ The use of 'GitHub Copilot' with 'TypeScript' in 'Trigger' workflows is showcased, demonstrating how it can suggest and auto-complete code, saving time and effort.
- π The benefits of serverless computing with 'Trigger', such as cost-effectiveness and the ability to run tasks indefinitely without managing infrastructure, are explained.
Q & A
What is the main problem the video aims to address regarding business automations?
-The main problem addressed is the gap between no-code platforms like Zapier and coding solutions, which creates difficulties in managing business automations due to the lack of flexibility and visibility in no-code platforms and the complexity of coding solutions.
What does the speaker dislike about Zapier?
-The speaker dislikes Zapier's clunky interface, slow loading times, and the difficulty in editing workflows, which often requires refreshing the page and redoing the workflow steps.
What is the issue with no-code platforms like N8N according to the speaker?
-The issue with no-code platforms like N8N is that they can be fast to set up but lack the flexibility and sophistication of coding solutions, leading to roadblocks when trying to customize or integrate with certain APIs.
How does the speaker describe Trigger in relation to Zapier?
-The speaker describes Trigger as the technical version of Zapier, offering built-in integrations and a more sophisticated approach to workflow management compared to no-code platforms.
What is the advantage of using Trigger over no-code platforms like N8N?
-Trigger allows for more sophisticated workflow management with the ability to write and deploy code, handle retries for failed tasks, and provide better visibility and reporting on workflow performance.
What is the benefit of using TypeScript with Trigger according to the video?
-TypeScript with Trigger provides benefits such as type checking, which helps prevent errors by showing what properties and methods exist on objects, making coding more efficient and less error-prone.
How does Trigger handle tasks that need to run indefinitely or for a long time?
-Trigger can run tasks for a long time without incurring high costs associated with serverless environments, as it can shut down and rewake the task when needed.
What is the significance of using an IDE with Trigger?
-Using an IDE with Trigger allows for a better development experience, as developers can choose their preferred environment and take advantage of features like GitHub Copilot for code suggestions.
How does Trigger address the issue of concurrency in workflows?
-Trigger handles concurrency by ensuring that tasks do not write to the database simultaneously, using concurrency keys to manage tasks that should only execute once for a given value.
What is the role of GitHub Copilot in the context of using Trigger?
-GitHub Copilot assists developers by providing code suggestions and automatically writing code based on comments, making the development process faster and more efficient.
Why does the speaker recommend learning something more sophisticated than no-code platforms?
-The speaker recommends learning more sophisticated tools because they offer greater flexibility, better error handling, and the ability to manage complex integrations and workflows that no-code platforms may struggle with.
Outlines
π€ Introduction to Trigger and Its Necessity
The speaker begins by expressing their admiration for Trigger, a product they deeply enjoy and believe in. They clarify that they are not affiliated with the company but genuinely want to see it succeed. The speaker emphasizes the rarity of finding a product so essential that its absence would be highly inconvenient, using the iPhone as an example of a product that, while replaceable, is deeply integrated into many people's lives. They also mention that Trigger is surprisingly easy to use despite its technical appearance. The main problem addressed is the gap between no-code platforms like Zapier and coding platforms, which require technical knowledge and server setup. The speaker highlights the inefficiencies and frustrations of using Zapier and the limitations of no-code solutions, setting the stage for the introduction of Trigger as a solution to these issues.
π Trigger as a Technical Zapier with Built-in Integrations
The speaker describes Trigger as the 'technical version of Zapier' and explains its advantages over other automation tools. Trigger comes with built-in integrations for various services like Open AI, Mailgun, Twilio, and more, which simplifies the process compared to setting up APIs manually. The speaker appreciates the Notion integration and mentions that Trigger is backed by Superbase, allowing for easy integration with many tools without dealing with APIs directly. They also discuss the benefits of Trigger's workflow deployment options, either on their servers or self-hosted, and its ability to handle retries for failed tasks, a feature lacking in no-code alternatives like Zapier and N8n.
π οΈ The Advantages of Coding with Trigger and TypeScript
The speaker delves into the technical aspects of using Trigger, highlighting the benefits of writing workflows in TypeScript, a superset of JavaScript. They demonstrate how TypeScript's type-checking feature can prevent errors and improve the coding experience by providing real-time feedback on object properties and methods. The speaker also appreciates the flexibility of using any preferred Integrated Development Environment (IDE) with Trigger and the integration with GitHub Copilot, which assists in writing code more efficiently. They emphasize the importance of being able to see and test workflows, a feature not available in no-code tools, and the ability to deploy changes to production without disrupting existing processes.
π Exploring Trigger's Serverless Benefits and Concurrency Control
The speaker discusses the benefits of serverless computing with Trigger, such as the ability to run tasks concurrently without managing infrastructure. They also explain the importance of idempotency and concurrency keys in financial transactions to prevent double charges or errors. The speaker provides a detailed example of how Trigger handles these scenarios, ensuring that operations are processed only once and not simultaneously, which would be a complex challenge to solve in a no-code environment. They also mention the cost-effectiveness of Trigger compared to serverless environments like AWS Lambda, which can incur high costs for keeping servers open.
π Conclusion: Trigger's Superiority Over No-Code Tools
In conclusion, the speaker reiterates the superiority of Trigger over no-code tools like N8n and Zapier, particularly in terms of visibility into workflow data, testing flexibility, and the ability to manage complex tasks that no-code tools cannot handle. They emphasize the unique advantages of Trigger, such as the use of TypeScript, GitHub Copilot integration, and the inherent support for concurrency and idempotency, which are not available in no-code alternatives. The speaker ends by expressing their enthusiasm for Trigger and looks forward to the next video.
Mindmap
Keywords
π‘Trigger
π‘No-code
π‘Zapier
π‘Make (n8n)
π‘Workflow
π‘TypeScript
π‘IDE (Integrated Development Environment)
π‘GitHub Copilot
π‘Serverless Computing
π‘Concurrency
π‘Idempotency
Highlights
Introduction to Trigger, a product the speaker highly appreciates and wishes to see succeed.
The speaker's emotional attachment to products like Trigger and iPhone, emphasizing the importance of product reliability.
The dichotomy between no-code platforms like Zapier and coding solutions, highlighting the ease of use versus flexibility.
Criticisms of Zapier's clunkiness and the limitations of no-code platforms like N8N.
The challenges of editing workflows in no-code platforms and the technical difficulties encountered.
The limitations of no-code platforms when dealing with specialized or unusual API integrations.
The introduction of Trigger as a technical solution akin to Zapier but with more advanced features.
Trigger's integration capabilities with various tools and its backing by Superbase for extended functionality.
The operational benefits of Trigger, including its ability to automatically retry failed tasks.
The visualization and monitoring features of Trigger that provide insights into workflow performance.
The ease of transitioning from development to production with Trigger, avoiding common deployment pitfalls.
The advantages of using TypeScript with Trigger for better code management and error prevention.
The flexibility of choosing an IDE when working with Trigger, enhancing the development experience.
The integration of GitHub Copilot with Trigger, streamlining the coding process with AI suggestions.
Trigger's serverless architecture, offering concurrency and itmpotency without the need for manual infrastructure management.
The speaker's personal testimony on the transformative impact of using TypeScript, Trigger, and GitHub Copilot in their workflow.
Conclusion summarizing the benefits of Trigger over no-code tools and traditional coding environments.
Transcripts
welcome back to the internet guys and
today I'm going to be showing you
trigger which I freaking love and before
I get into this I just want to say in no
way am I affiliated with trigger apart
from that I do want to see them succeed
because I just really love this product
and if they went away I would well I
wouldn't contemplate
uh but my point is that you rarely find
a product where if it went away you
would be really pissed like if the
iPhone went away I just buy a pixel you
know it's not that hard but if trigger
went away I seriously don't know what I
would do and don't worry guys because I
know it looks a little bit technical but
I'm going to explain why it's actually
extremely easy to use but before we get
into that I'm going to talk about the
problem the problem that we actually
have to solve because a lot of
businesses and side projects they run in
either two places okay so a lot of your
automations and business logic as it's
called is going to run on either
somewhere like zappier make n an one of
these code platforms I'll show you my n
right here and the other way to do it is
to basically just write all your code
have it run on a server somewhere or in
the back end of your website and there
is a Ocean between those two
options cuz one of them is super easy
you drag and drop and then the other you
literally have to know how to code and
you have to do all this stuff and know
how to set up a server it's a massive
difference and they also have a lot of
their problems like in their own so
first of all zaper is clunky I have a
video where I was talking about how you
should use n an and I trash zapier I
still hate zapier so uh you can just try
zapier for yourself if you don't uh if
you won't take my word for it N is a lot
better but I just want to show you I
mean this is my n i I built a decent
amount in here and if we just load this
up I mean first of
all it takes forever to load and then
this is my workflow and dude there are
so many problems when it comes to
editing I made that video last time a
little bit uh preemptively because when
it comes to actually like editing your
workflow you have to go you have to test
each step individually so you hit test
step and then you pin the previous data
but I kept getting this problem where
I'd hit test and it wouldn't work and
you can't just like you have to refresh
the page and then you have to redo the
whole workflow and it becomes a massive
pain in the ass to use and that's just
the problem because it's no code it's
very like uh abstracted and you're
always going to Fig problems um where
you just can't solve it and it takes a
ton of time the other thing with no code
is I found that yeah it's pretty it's
pretty fast if I want to add like a web
hook I mean there it is that's an
endpoint I'll click out of it but there
it is that's our endpoint and then we
can like customize the URL but and now
it's not even working I can't oh geez
dude um although it's good to actually
like build things with no code um and
it's kind of fast you end up up getting
stuck at a lot of places where you just
can't do something that you could in a
more sophisticated environment like you
basically just like any of these things
I'll probably get hung up and because
it's an in like a UI interface like if
we go to this part where I have to get
the company access token because it's a
weird API they have a really weird way
of like requesting the data oh no all
right my light died but I'm back they
have a really weird way of requesting
the data and it ends up being a problem
because in order to get this like all
correct you can't just copy from their
documentation like the fetch request you
can't just copy and paste because there
no code you have to fiddle around for
like 3 hours until you fix it where in a
more sophisticated environment it might
take 10 minutes to get it set up Pro
probably less so that's kind of the
downside of no code and why I recommend
kind of learning something a little bit
more sophisticated but
then then we come over to something more
sophisticated and again we have a
problem I mean first of all this is a
JavaScript document which I'll talk
about in a second but let's just go to
let's just go to the uh logs here and
I'm just going to show you what the
actual problem is because this this is
what you get when you're looking when
you're running basically code on a
server you get a log section here where
they just give you a bunch of red lines
and a bunch of black and white lines and
yeah you can output data to it but it
gives you zero context into how well
things are working how fast they're
executing you have to literally like
build a separate product to actually
figure out what's going on here and it
just becomes a massive pain in the ass
so that's why I say there's a
Ocean between something like this and
something like this which are both bad
and uh I mean there's just been no
solution until I started using trigger
so let's get into it now first of all
the definition of trigger as defined by
the co-founder or CEO or whoever he is
it's described as the technical version
of zapier which I totally agree and I
totally love um quick example so with
zapier you get a lot of Integrations and
Trigger has this stuff built in for you
so you get open AI mail gun twilio
resend whatever you actually need like
all this stuff and amazingly they have a
notion integration which I like using
notion you can integrate with WS air
table you can basically integrate with
whatever you need and by the way they're
also backed by superpa base so you can
integrate with a lot of these different
tools without having to like mess around
with apis on your own but we should
explain a little bit more about what
trigger dodev actually is and how it
works because I'm sure you're confused I
was extremely confused for a long time
so essentially what they do is they
allow you to write your workflows and
then deploy them to their servers or you
can self-host it which is more
complexity than I actually want um and
then they handle all this kind of stuff
that's like such a pain in the ass to
deal with on like a typical server or
even an N so let's say you're making a
call to a like open
API open AI their API I mean a lot of
the time your call is just going to fail
it's like when you're talking to chat
jbt and it just doesn't respond it just
shows an error you have to actually like
copy your message and paste it again and
that's a problem if you're relying on
that workflow to actually serve your
customers so with trigger dodev they're
going to automatically retry failed
tasks and naan just doesn't have that it
fails and then you're out of luck I
mean if it fails like you better you
better uh have a way to know about it so
what trigger doev does is it host your
code it allows you to actually look at
all of your runs so I'm going to pull up
my trigger and if I just go to my
current project then something really
cool is here so first of all we can see
every single task that I have set up and
we can see like a map of all the
activity and failures and all that stuff
but the cool thing is if we look at the
Run logs it's actually going to show you
exactly what the workflow is doing so
it's going to show you okay yes it
started on the Chron chronological uh
schedule and then it ran and here's the
output all right I'll try to give a a
little bit of a a better example cuz
this right here this is a fat ass
workflow and basically what it's going
to do is it's going to break down the
whole workflow for you so you get all as
much like reporting and visualization
into what's happening same with same
thing with like uhan which doesn't have
this you you have no idea to tell like
to tell how long something's taking and
with this you can literally see like
okay this step took 885 milliseconds cuz
I was calling an API and then this uh
API called to uh open
AI yeah anyways this one uh getting the
cost of the call that was only you know
100 milliseconds and you can actually
see all this data which becomes so
valuable the other thing about trigger
uh the like n an or zapier can't handle
is if you're running a business on it
well you're going to deploy your product
and if you get customers your customers
are going to want your product to work
obviously right and you're going to want
to change things but as you change
things you're going to break things and
typically in a in a typical like
Enterprise business you're GNA have or
any business you're going to have a
development and then you're going to
have a production um kind of staging and
with trigger. da you can easily like get
like everything started on your computer
locally test everything out and then
when it's ready to go you deploy it to
the servers so that the customers can
actually use it so you basically like
prevent yourself from shooting yourself
in the foot I mean with an an if I want
to make a little change here and I
accidentally make a mistake I'm going to
have to and okay and I make a mistake
and then I press save on accident I
haven't changed anything I don't think
and it wants me to save but if I press
save that could something up in the
back end and I have no idea so that's
why trigger that di is so strong but
there's one thing that does tend to be
pretty nice about an an and zapier and
and all these kind of things and I mean
let let's try to put together a demo
here so if we just go refresh location
so we'll test this so we'll hit test
step this is a cron trigger it supposed
to fire every 20 hours so let's test
that and then I'll pin this data so we
can use it in the next step and then
I'll come to list locations and what
we're going to do here is oh wait
actually these are uncoupled I'll I'll
test this one CU I want to get some
fresh data and then for this one if you
can see we're using uh data from the
last step in this in this step right
here okay so all I need to do is I go
from refresh token so I'm going to grab
that refresh token just drop it in there
and boom we're good to go obviously I I
don't want to do that um but yeah all
you do is you drag and drop from one
step to the other and that's why no code
is so easy but I'm going to show you
something that I recently started using
and it's it's been
insane if you're not a developer you
might be screaming right now don't worry
don't worry I will I will make this
simple and easy um let's let's let's
let's get an example going here so this
is my trigger dodev code and don't worry
it's it's not hard to code um this is my
trigger. Dev code and it's written in
typescript typescript is a type of
JavaScript it's actually a superet of
JavaScript so you have JavaScript and
then you have typescript so you can
write everything in in typescript and it
gets compiled to JavaScript which means
it can run basically anywhere so the
advantage of typescript I'm going to
show that right now because what we're
doing in this workflow here is we're
using a
stripe uh the stripe integration to
charge a customer and this can actually
be a bit of a pain in the ass all right
and by the way if I wanted to do this in
no code I don't even know if I could I
mean it's like a specialized use case
and anything that's not remotely normal
is going to be a pain in the ass and no
code so anyways what we're doing is
we're creating a payment intent
and after that after we create that
payment intent then we also want to get
the default payment method off of the
customer all right and the cool thing
about this is look at this long ass line
of code I I don't know what this is I
don't know like why it looks like this
right but what we can do is we can say
say uh payment method we'll just Define
a new variable and we'll say that's
going to be
await um maybe we don't have to wait it
it's going to
be uh stripe or it's going to be our
payment
intent Dot and then if I tried to do
like payment method
here I mean first of all I spelled this
wrong so that's going to that's going to
be an issue but but
wait all right it was a bad example
because payments attend exist but if I
if I try to do type and I hover it over
it it's going to tell me it says TS
typescript property type does not exist
on this type of object because this is
the object that we're we're creating and
it's saying this type does not exist
which is so useful because when
you're normally coding you dude it's
like so hard to guess because literally
you would be looking at stripe
documentation you'd be coming back here
you'd be like okay is it type info and
then it's still not going to work it's
going to say no it doesn't exist and if
you were just doing JavaScript you would
compile this you would run it or you
wouldn't compile it but you would just
run it and you would get an error and uh
that's not going to happen with Ty
script it's literally going to tell you
exactly what exists and what doesn't
it's basically like drag and drop
editing
um and and let me try to break down just
another example here so if we go over to
my call recording workflow so this is
the workflow that handles a phone call
being finished and then the call
recording being dropped to my task and
this is extremely useful this is
something you can Define in typescript
it's called an interface or I believe I
can change this type and it's the same
no never mind um but essentially this is
going to tell your code in your program
like or actually it's going to tell
typescript what your payload is going to
look like like what the data you're
dealing with is going to look like so if
we go down to somewhere where I'm using
let's go like location ID so if we go
down to this and if I said okay payload
do location ID and I tried to use that
it's going to tell me right now that
location ID does not exist on the
payload that I sent in it has to be
location ID and this is such an enormous
timesaver and also an enormous just
benefit to your entire life that uh I
mean it it basically makes coding like
no code I mean there's still a bit of a
learning curve but really like I I would
be I would be a week back in my
development process um if I wasn't using
typescript so that brings us on to our
second benefit of uh trigger and
basically it's that you get to pick your
your own IDE I mean an IDE if you're not
sure is a uh an integrated development
environment so I'm using Zed you could
also use VSS code is extremely popular
you could use Vim you could use
text edit and here we are with that same
uh stripe uh workflow that we were just
looking at in text edit I mean you could
use this it's terrible it it's
horrible I mean you would never want to
do this but you could I mean the the
benefit of doing that is just amazing
like you can actually use whatever
program you want to edit your workflow
and it just make it just makes for such
a better development experience um but
the other thing about using your own IDE
is let me remind myself is co-pilot you
may have heard about GitHub co-pilot and
how their some lawsuit is happening
because they're using other people's
code to train a robot that replaces them
and I just want to say I love
co-pilot and this is one of the biggest
benefits of trigger is that you can
actually work with co-pilot to build
your your execution programs so let's
just uh let's just get a really good
example so okay so to demonstrate this
we're back in our stripe charge workflow
now what I used to have here is that if
the payment failed it would basically
just wait a day and then it would return
um but we could actually automate the
way that it charges customers so if
they're payment fails the first day
it'll wait one day and then it'll charge
them again and let's actually just get
rid of this I want to basically make it
so that it waits one day and then it
tries to charge them again then a couple
days so I'm just going to write that out
in comments so we'll say if payment
fails uh wait for a day and Retreat I
mean is there anything else to that um
if payment fails wait for a
day no
payment failed wait for a day and then
we'll say um
um add tag failed payment and then we'll
say and that tag by the way I'll show
you is uh really useful in trigger I
mean it's I don't know if it's useful
yet but it it'll kind of show you like
what your runs are so I can see okay so
these message here are from Facebook and
social and there social messages so that
way I can basically break down my runs
when I'm going to the bug later on um
but say payment failed wait for a day
add tag failed payment and
then one other benefit of trigger that I
just thought of is you can run tasks for
like I don't know indefinitely like a
really long time so if I say wait for a
day it's fine it's going to pick up in a
day whereas if you were using something
like a AWS Lambda or something else like
a serverless environment you would be
getting charged a million dollars to let
it run for a day because they're keeping
the server open for you whereas here
they have a way to shut it down and then
uh rewake it up when it's ready so
anyways um we're going to confirm the
payment and then
attempt
to charge again so let's see how this
goes I haven't I mean I've done this a
couple times but we have co-pilot you've
probably seen co-pilot in the background
when I start to type something it's
going to give me a
suggestion dude all right so there we go
so it's saying basically if I press tab
I can accept that change all right so
we'll go payment failed uh wait for a
day so we'll go boom it look at this
it's looking at these comments and it's
doing exactly what I want so I'm like
I'm like freaking just dying over here
just like bro I've been working for 12
hours and I don't know what to type and
then I press enter and it just types
exactly what I need and then we'll go
await charge again and this is going to
be a bit of a challenge because it's a
bit further up but let's say
um we'll just do a
wait or no we'll
do const try try again and look at this
dude it's literally filling in that
entire same line from up above that we
were just using it used the same payment
intent id that we had and if I press
enter then it'll will'll pull in the
exact same values that we needed and
then I can press tab again to accept
that and we have the exact same l i mean
this is a weird example because I'm
literally could have copy pasted the
line but it's writing it for you without
you having to know the actual syntax you
just write comments and then it writes
the code for you while you basically sit
there and press Tab and uh that is the
absolute best thing about I mean co-
pilot is amazing and then I just
I just want to give one more example
because with typescript co-pilot Works
amazing because basically I'm
trying to call this function right here
and you have to like organize it in a
specific way so that it actually
functions properly and this can be kind
of a pain in the ass you have to keep
switching back and say okay what what
type of object does this one need and
with typescript you can basically just
go okay so I want to I know I want to
send the type so it's going to be that
and then the code is going to be that
yep yep and then I mean then we're going
to Define our Q or we'll just do an in
potency key and boom I mean there's a
little bit of a formatting error here
but dude it's absolutely insane it
literally writes code for you like
copilot is one of those products that
you just never get bored of like every
day you have that moment where you just
like oh tab tab tab and you write like
two minutes of code in five seconds is
amazing so I love co- pallet and
I mean biggest thing is you get to use
co- pallot and typescripts with um
trigger so then the last thing is
serverless I'll bundle this from uh with
the last benefit serverless Computing
and concurrency and let's also say cu's
and
uh okay so I'm going to bundle all this
together but basically if we go back
back I mean I'll just I'll just scroll
through this so you can see but you can
run jobs all at the same time you don't
have to worry about setting up a server
and managing infrastructure and all this
stuff because that's a pain in
the ass um and then there's a couple
things called concurrency and itm
potency and when you're dealing with
things like charges and like money itm
potency is extremely important because
if someone refreshes the page and every
time they refresh the page you're
sending data to your server to charge
them or to give them money
you don't want it to just work every
single time they refresh their page so
typically you'll have some type of itm
potency where you'll refresh the page
once it'll send that special value to
the server and then the server every
time it gets it from then on will know
okay we've already process this that's
it imp potency that means that and
otherwise dude it's such a pain in the
ass you have to like create like a whole
table in your database to store all this
stuff to measure to manage it and with
trigger you don't they literally include
it if we come back here we're passing in
the so this is when it actually like
charges the customer or this is when we
adjust the balance of the customer this
is a good example we're passing in an
itm potency key so that means when we're
adjusting this balance we only want it
to happen once with this uh payment
intent which is like a stripe charge uh
value so we only want that to happen
once and then the concurrency key
basically this is sick because
if we look at our adjust balance method
okay we're pulling out we're pulling out
the company balance so we're looking in
the database we're saying okay uh yeah
wait where's it going to be
company um select balance okay so we're
selecting the balance so we're pulling
out the balance and then I'm doing a
couple things in between and then I'm
updating that balance with the new
amount so the new balance is going to be
the past balance plus the the the change
and then eventually here we're upserting
or we're updating that one record with
the New Balance but there could be a
scenario
where okay so there could be a scenario
where you're reading the balance right
here and the balance is $100 at start
and then task two right here is reading
the balance a millisecond after and it
also sees
$100 but then when the first task goes
to write it's saying minus $50 so a $50
charge it's going to write 150 right or
no it's going to write 50 good thing
that looks like a dollar sign so it's
going to write $50 to the database but
then task number two is adding $50 and
it also saw 100 at the start so it's
going to write 100 + 150 so you're
basically giving the customer a free $50
in this scenario and you have to like
figure out how to solve this and the
great thing about trigger is that stuff
is solved for you it's not going to
wrate to the database at the same time
because we're using a where the oh we're
using
a a concurrency key right here which is
the company ID so for the same company
for the same balance value it can't
write at the same time we have a limit
of one and yeah I mean uh this video is
already really long but hopefully that
kind of helps you expl uh understand
what trigger is and how it works and why
it's so good I know I talked
about a lot about typescript and and
co-pilot which are amazing but
the reality is you don't get these
benefits when you use a no code tool
like n or zapier or make and you also
don't get these benefits I mean you
don't get the benefits of actually
seeing into your workflow seeing what
the data looks like and testing them um
whenever you want with like an actual
server it's it's way more of a pain in
the ass so anyways triggers is
awesome um yeah I'll see you in the next
video I guess
Browse More Related Video
My Top 5 VSCode Extensions for React and NextJS!
I tried the Apple Vision Pro as a Developer - VS Code in VR!
How to create PERFECT RESUME with zero skills for IT Job Application π | Resume format for Freshers
makerday ft chris 09/07
En QUE SUPERA Claude 3.5 Sonnet a ChatGPT?
Access Perplexity API In n8n To Scrape Live Website Data Through HTTP Request Authorization π€
5.0 / 5 (0 votes)