02Chapter 2 of 7
Free course5 min read

Wire the trigger.

Connect the event that kicks the automation off, a new email, a form, a clock. The trigger is the cue, not the hard part. This chapter shows you how to pick it and make it stick.


A trigger is the moment something happens that should kick the automation off, a new email lands, a form gets filled in, the clock hits 9 AM. That is it. The trigger is the cue. Everything else in this course is about what happens after the cue fires.

02.0

Why the trigger isn't the hard part

The chapters that come next are the hard ones. Picking the AI brain that reads a messy message, writing the instructions that keep it on script, deciding when a human should sign off before anything goes out , that is where most of the work lives. The trigger, by comparison, is usually a few clicks and one line of config.

But getting the trigger wrong wastes the rest of the automation. If the cue fires twice, the automation runs twice. If the cue never fires, the automation looks broken even though every other part of it is fine. If the cue fires three seconds late, nobody notices; if it fires three hours late, your customer noticed before you did. So this chapter is short, and the goal is small: make sure the cue you pick is the right shape for the work, and that it fires every time it should and no times it shouldn't.

We will keep one running example for the whole chapter, a small dental practice that takes new-patient intake forms on its website. When somebody fills the form out, three things need to happen: the front desk gets a notification, a patient record gets created in the practice management software, and a welcome email goes out with the first-visit paperwork. The automation in chapters 3 through 7 will handle all of that. This chapter just wires the event that starts it.

02.1

The four kinds of triggers

Almost every cue you will ever wire up falls into one of four shapes. It is worth learning the names because picking the wrong shape is the single most common way the trigger goes sideways.

The four kinds of triggers
Event, a tool tells your automation the moment something happens. The form software pings the automation as soon as the form is submitted. This is sometimes called a webhook (a way one tool can poke another tool when something happens).
Schedule, the clock fires the automation on a calendar. Every weekday at 9 AM. Every Monday morning. Every hour.
Manual, somebody on your team clicks a button to run the automation. Useful for one-off jobs and for testing.
Polling, the automation checks a tool every few minutes to see if something new has shown up. The tool is not telling your automation anything; your automation is asking, "anything new yet?" on a loop.

Event triggers are the cleanest when the tool supports them: the cue fires the instant the work shows up. Schedules are the cleanest when the work runs on the calendar rather than on something happening in the world. Manual triggers are mostly for testing and for the small number of jobs you want a human to start by hand. Polling is what you reach for when the source tool will not push events at you, so you have to keep asking. Polling introduces a delay, often 5 to 15 minutes, between the real event and the automation's response. In a dental practice that difference is a patient waiting without a confirmation. Use polling sparingly and always upgrade to an event trigger when the source tool eventually adds one.

Here is what an event trigger actually looks like on the inside of a tool you have probably already used. When the dental practice goes to wire its intake form, the screen in Typeform is no scarier than this, one URL field, one event picker, one save button.

What the webhook setup screen looks like in Typeform
●admin.typeform.com/form/new-patient-intake/connect/webhooks
Webhooks
Integrations
Webhook destination URL https://hooks.routework.io/t/dental-intake Event form_response Secret •••••••••••••••• (used to verify the request) Status Active [ Send test request ] [ Save ]
Every form vendor has a screen that looks roughly like this, paste the automation's URL in, pick the event, save. That is the whole wiring job.

The point of the screen is not the screen itself, every vendor moves the fields around, but the shape of what you are configuring. A URL the vendor will ping. An event you want to be pinged about. A way to prove the ping really came from the vendor. That third piece, the secret or signature, is what stops someone else from sending fake events to your automation's URL. Once you can find those three on any tool's settings page, you can wire any event trigger.

The four shapes are not equally good, they trade off across three things you care about. How fast does the cue land after the real event? How likely is the cue to fire when it should? And how much setup does the trigger need before it works? The grid below shows the rough shape of that trade-off.

Four trigger shapes, by trade-off
LatencyReliabilitySetup costBest for
Event (webhook)SecondsHighMediumForm / email / payment
ScheduleOn the dotHighLowDaily / weekly jobs
ManualInstantHuman-dependentLowTesting, one-offs
PollingMinutesMediumLowTools with no webhooks
Latency = how fast the cue lands. Reliability = how often it fires when it should. Setup cost = how much wiring it takes to get going.

For the dental practice, the work begins when a patient fills out the intake form on the website. That is something happening in the world, not something happening on the clock, so the right shape is an event trigger. The form software will ping the automation the moment the form is submitted, and the front desk gets the notification within seconds.

02.2

Picking the right trigger for your work

The most common decision you will make is between event and schedule. Most of the time the answer is obvious, but the obvious answer is not always right, so it is worth slowing down for one diagram.

Event or schedule?
YesNo
Does the work begin the moment something happens?
Use an event triggerwebhook from the source toolUse a schedulerun on a clock instead

The question to ask is whether the work is tied to a specific moment in the world. A new patient submitting a form is a specific moment, the work has to begin then, not at the next 9 AM check. A weekly report of how many new patients signed up last week is not tied to a specific moment, it can run on a schedule, and Monday morning is fine.

If the answer to the question is "yes, but the tool will not send us an event," you are stuck with polling. That is the third path. It is not a great path, polling is slower, noisier, and easier to break, but it is sometimes the only option a tool gives you. Polling also costs more: every check is a billable API call, whether or not anything new showed up. A polling trigger checking every 5 minutes makes 288 API calls a day, almost all of which return nothing. When you have the choice between an event and polling, always pick the event.

✱ Field note
Picking between event and schedule is not really about technology. It is about whether the work is tied to a moment in the world or to a date on the calendar. If you can answer that question, you have picked the trigger.
02.3

Making a trigger reliable

Once you have picked the shape, three small things turn a trigger from working into reliable. None of them are hard, but ignoring them is how the trigger goes from invisible to expensive.

The first is rate limits, a cap on how often you are allowed to call something before it blocks you. Most tools that send events have one. If the dental practice's form gets a sudden spike of submissions (a referral campaign, a Google Ad going live), the form software might send 200 events in 10 minutes. If the automation tries to handle all 200 by calling the practice management software back to back, the practice management software will hit its own rate limit and start refusing the calls. The cue fired correctly; the automation still broke, because the work downstream of the cue could not keep up.

Watch out
Rate limits on most business tools are quieter than they look. The tool does not always tell you it is rate-limiting you, it just starts returning errors that look like normal failures, and the automation retries them, which makes the rate-limit worse. If your automation suddenly stops working after a spike of activity, suspect the rate limit before you suspect the trigger.

The second is retries. Things fail. The internet has a bad five seconds, the form software hiccups, the receiving tool is briefly down. A trigger that fires once and gives up on the first failure will silently miss real work. A trigger that retries, waits a moment and tries again, two or three times, with a small gap between attempts, will catch most of those hiccups without anyone noticing.

The third is idempotency, which is a long word for a simple idea: running the same trigger twice should not do the work twice. If the form software, for any reason, sends the same submission to your automation twice (it does happen, usually on a retry from their side), you do not want two patient records, two welcome emails, and two notifications to the front desk. The fix is usually that the trigger carries a unique identifier, a submission ID, an email message ID, an invoice number, and the automation checks "have I already handled this one?" before doing the work. Store those IDs somewhere the automation can query quickly, a simple lookup table in your database is fine. The check adds less than a millisecond to each run and can prevent the kind of duplicate that takes an afternoon to untangle.

The configuration that wires all three of these in is small. Here is what the trigger spec for the dental practice ends up looking like once those pieces are filled in:

The trigger spec, all four reliability pieces wired in
intake-form-trigger.yamlyaml
1trigger:
2 source: typeform
3 event: form_response
4 form_id: new-patient-intake
5 
6 # Carry a unique id so the automation can detect duplicates
7 dedupe_key: response_id
8 
9 # If the cue fails to land, try again — but not forever
10 retries:
11 max_attempts: 3
12 backoff_seconds: [10, 30, 90]
13 
14 # Don't fire downstream actions faster than the practice
15 # management software can accept them
16 rate_limit:
17 per_minute: 30
Source + event
Names the tool sending the cue, the specific event to listen for, and which form. These three fields are what every event trigger needs, on every platform.
Dedupe key
The unique id the trigger carries so the automation can spot duplicates. If the same response_id arrives twice, the second run stops quietly.
Retries
If the cue fails to land, retry up to three times with growing gaps (10s, 30s, 90s). Catches network hiccups without flooding the next tool.
Rate limit
Caps how fast downstream actions fire so the practice management software does not get more calls than it can accept in a minute.

You do not need to write that file by hand on day one, most automation platforms expose these as fields you fill in or toggles you flip. But the four pieces, the source, the event, the unique identifier, and the retry policy, are the four pieces every reliable trigger has, on every platform, regardless of how the screen is laid out. If you cannot find where to set them in the tool you are using, the tool is probably hiding them under an "advanced" section, not skipping them. The retry policy in particular is often behind a disclosure like "error handling" or "failure behavior" — it is worth finding before the first real Monday morning failure.

02.4

Worked example: the dental intake form

Putting it all together for the dental practice. The website's intake form lives in a form-builder tool (Typeform, JotForm, Google Forms, same idea, same wiring). The automation needs to fire the instant a patient submits the form. That decision is settled: the work is tied to a moment in the world, the form software supports webhooks, so the trigger is an event.

Inside the form software, you find the section that says something like "webhooks" or "integrations," and you paste in the automation's URL. The form software will now poke that URL every time someone submits the form, with the submission's contents in the bundle. The automation hears the poke and starts running. That is the whole wiring job, give or take a test submission to make sure the cue actually lands.

The unique identifier the trigger carries is the form's response_id. Before the automation does anything else, it checks whether it has handled that ID before. If yes, it stops quietly. If no, it goes on to the next step in the loop, which is the model picking up the patient's answers and figuring out what to do with them, and that is chapter 3.

Zooming out, here is the whole intake flow that the trigger kicks off. The trigger is just the first hop. Each arrow is something crossing the gap between systems, and the only piece this chapter wires is the one on the left.

The dental intake flow, end to end
Typeformpatient hits submitpatient hits submitTriggerfires on eventfires on eventAI classifynew vs returningnew vs returningPractice mgmtpatient recordpatient recordSMS confirmto patientto patientraw form payloadstructured fieldspatient record idconfirmation
The trigger is the leftmost hop. Everything to the right of it is the next four chapters.

Read it left to right. Typeform hands the raw form payload to the trigger. The trigger cleans it up into named fields the automation can reason about. The AI step decides whether this patient is new or returning, which changes what happens next. The practice management software gets a patient record written, and the record id comes back so the last step, a confirmation SMS to the patient, can reference it. The whole chain is roughly four seconds end to end on a normal day. This chapter only wires the first arrow. Each of the other arrows is the subject of the chapters that follow — notice that none of them can work unless the first arrow is clean, complete, and arrives only once.

Before you move on, the test that matters: submit the form yourself, pretending to be a new patient. Watch the cue land. Submit it a second time with the same answers, and watch the automation recognise the duplicate and stop. If both of those work, the trigger is wired. The hard part, what happens after the cue fires, is the next four chapters.

KEY TAKEAWAYS
  1. A trigger is the cue that kicks the automation off, a form, an email, a clock, a click.
  2. There are four shapes: event, schedule, manual, polling. Almost every cue is one of those.
  3. Event triggers are best when the work begins the moment something happens. Schedules are best when the work runs on the calendar.
  4. If the source tool will not send you an event, polling is the fallback. Use it last.
  5. Carry a unique identifier on every trigger so the automation can spot duplicates.
  6. Add a retry with a small gap between attempts so a five-second hiccup does not cost you the work.
  7. Watch the rate limit. Trigger problems often look like downstream failures because the cue fired faster than the next tool could accept the work.

End · Chapter 2 of 7

Mark it complete and it’s ticked off on your route.

Rivet, the product security agent for software teams, free to start. Human-led pentests and design review when you need them. AI agents are our specialty.

or get a free Rivet scan

BASEDChicago, IL · remote

FIELD NOTES

ONE SHORT EMAIL A MONTH

© 2026 ROUTEWORK — ALL RIGHTS RESERVED

Claude and Mythos are trademarks of Anthropic. RouteWork is not affiliated with Anthropic.