The short answer
What is a trigger? In software, a trigger is a rule that starts work when a set time arrives or something happens. A schedule can start a weekly report, while an event can start work when a support ticket arrives. A condition adds a test, such as whether the ticket is urgent, so only relevant work goes ahead.
A trigger decides when to start. The actions that follow decide what gets done. Keeping those decisions separate helps you choose between a report delivered before a meeting and a response needed when something changes.
How does a trigger start a run?
A weekly report begins with a saved rule about time. An incoming support ticket begins with a change in another app. Software needs a way to notice the starting point, check any conditions and hand the work over.
- A schedule or an event supplies the starting point. That could be the start of the working day or a newly opened ticket.
- The system detects that point. It checks the time, receives a notice from another app or asks the app whether anything has changed.
- Any trigger conditions test what came in. A ticket marked urgent passes an urgency test, while a routine question doesn't.
- When the rule is satisfied, the system starts the actions attached to it. Each occasion when that work runs is called a run.
You can change either part of the rule. Moving a report to a different day changes its trigger, while changing the report's contents changes the work that follows.
When does a clock make sense?
A schedule fits work with a deadline: a report before a team meeting, for example. Scheduled work can recur at chosen times, whether or not anything new has arrived.
One scheduling tool is cron, which reads saved time rules and starts the specified work. The crontab time fields describe minutes, hours, days of the month, months and days of the week. You don't need to write those fields to understand the choice: a clock tells software when to look.
Choose a schedule when you need work at a set time, regardless of when the data changed.
How does software notice an event?
A new support ticket is an event. The app holding the ticket can send a notice when it arrives, or another system can check that app at intervals.
These methods are called push and polling. With push, the source app sends the notice without waiting for the receiving system to ask. With polling, software asks for data, then checks whether the returned items are new.
Polling needs a way to spot items it has already seen. One method compares each item's unique identifier, its ID, with saved IDs from earlier checks. A new ID starts work. An old one doesn't.
An event trigger can have a delay even though the rule says to act when something happens. Ask whether the link between apps receives notices or checks at set times, and whether that delay fits the work.
What does a condition add?
An urgency test narrows a ticket trigger. The event says a ticket arrived, and the condition says whether that ticket should start the work attached to the trigger.
Software runs the test on the data it has. A trigger condition can check a reply from a website, for example, and let work run only when that reply reports an error. Conditions can narrow scheduled checks as well as incoming events.
The condition needs data the trigger can provide. Before asking for an urgent-ticket rule, check which field marks urgency and whether the incoming notice includes it.
What can go wrong with the choice?
A report triggered by every new ticket would run whenever a ticket arrived, even if the team only wanted a digest before its meeting. That rule confuses the arrival of data with the deadline for using it.
The reverse choice has a cost too. A scheduled digest holds new tickets until the next check. If someone needs to reply sooner, shortening the report won't change the wait for its next run.
A condition can also exclude work you meant to include. In the urgent-ticket example, an empty urgency field won't match a test for urgent. Decide what should happen to unmarked tickets before relying on the filter.
Keep the starting rule separate from success. Starting the attached actions doesn't prove that a useful report arrived or that a customer received a reply. For a test, check the work itself as well as whether the trigger fired.
What would this look like in a support team?
Consider a made-up support team with a shared ticket queue. Its manager wants a digest before the team meeting and a draft reply when an urgent ticket arrives.
The digest uses a clock. At the scheduled time, the reporting work reads the queue and prepares the meeting notes. A day without urgent tickets can still belong in the digest, so urgency shouldn't decide whether that report starts.
The draft reply uses an event with a condition. A new ticket arrives, the condition checks its urgency field, and a matching ticket starts the drafting work. A routine ticket remains in the normal queue.
If the link between apps checks for new tickets at set times, the urgent ticket must wait for a check. The manager should compare that wait with the team's promised reply time before choosing how the apps connect.
How does Viktor use triggers?
A pipeline report lists potential deals and their progress. Invoice reconciliation compares invoice records with payments.
Viktor can run recurring work through scheduled tasks, including a pipeline report or an invoice reconciliation. He reads times in your own time zone unless you name another one, and confirms the schedule locally.
He can add a condition script, a small program that checks before each scheduled run and skips it when there's nothing to do.
With event triggers, one or more handlers run for each incoming event. A handler is the part that does the work: it can run Viktor with your instructions or run a program directly.
His event-trigger docs recommend events when a reaction needs to be quick. If periodic checking is enough, the docs say a scheduled task is usually cheaper because each event can start Viktor to process instructions.
His proactive check-ins also show how a schedule and a condition combine. A check-in is skipped when no new message he can see has arrived since the previous one.
Common questions
What are automation triggers?
They are rules that start a run of software. A rule can respond to an event, such as an incoming email, or to a schedule. Some systems also support manual triggers, such as pressing a button, which require someone to start the work at that moment.
Can an event trigger rely on a clock underneath?
Yes, a polling trigger checks another app at intervals to find new data. The business rule responds to an event, but the connection discovers that event during a timed check. Ask about the checking interval before treating an event trigger as immediate.
Is a condition a separate kind of trigger?
A condition is a test attached to a starting rule. A scheduled website check can require an error response before the attached work runs. Keeping the time rule and the test separate makes it easier to see whether work was due or was excluded.