Skip to content

Control when and how a Routine runs

A Trigger decides when a Routine starts. The Behavior settings decide whether an automatic Routine repeats, appears in the lookup header, stops after an error, or prevents later Routines from running.

Open Definer Options → Sources → [source] → Settings → Routines, then create or edit a Routine. Trigger choices are under Trigger. The other controls on this page are under Config → Behavior.

Choose how the Routine starts

Choose the Trigger by the outcome you want:

TriggerUse it when
AlwaysThe Routine should run automatically when the result first opens.
Page Has ElementThe Routine should run only when a particular page element exists.
URL ConditionThe Routine should run only on source pages whose URL matches your rule.
ManualThe Routine should wait until you select it from the lookup's Routines menu.

Trigger chooser for Manual, Always, Page Has Element, and URL Condition

Always

Choose Always when every result from this source needs the Routine. Use Run Frequency to decide whether it can repeat after the first open.

Page Has Element

Choose Page Has Element when a particular element is already present as the result opens and identifies the right kind of page.

Use the crosshair button in Selector to pick the element from the preview. The Trigger status below the fields shows whether the current preview matches.

URL Condition

Choose URL Condition when the source can open different kinds of pages. Choose the comparison under Condition, then enter the value under Pattern.

Choose the comparison that matches how specific your rule needs to be:

ComparisonUse it forExample pattern
Matches domainEvery page on one exact domainwww.example.com
Matches URLOne exact complete URLhttps://example.com/example.html
URL containsA recognizable part anywhere in the URL/search
URL starts withEvery URL below a fixed prefixhttps://example.com/docs/
URL ends withA shared ending, such as a file type.pdf
Matches patternA browser-style match pattern across pages or subdomains*://*.example.com/*
Matches regular expressionAn advanced regular-expression rule`example.(net

Use Current URL below the fields to compare your rule with the page in the preview. Prefer the simplest comparison that describes the pages you want.

Manual

Choose Manual for an action you need only on demand. A manual Routine does not run automatically. Open the Routines button in a lookup and select the Routine when you want to run it.

Choose how often it repeats

Run Frequency applies to automatic Routines:

Run FrequencyObservable behavior
OnceRuns only the first time that result is opened.
Every Time OpenedRuns whenever you open that result.
Every Open and NavigationRuns when you open the result and whenever its source page navigates to another page.

Check actions that can run twice

With Every Open and Navigation, a Click, Input, or Script that navigates can start the Routine from the beginning and repeat its actions. Use Once or Manual when repeating an action could submit a form or cause another unwanted change.

Timeline comparing when Once, Every Time Opened, and Every Open and Navigation run

Show the Routines menu

Enable Show Routine Button when you want an automatic Routine's progress and controls in the lookup header. The button appears for the current source when at least one automatic Routine has this option enabled.

Manual Routines are always available from this button, so the option is not shown for a Manual Trigger.

Handle errors and later Routines

Enable Stop on Error when later Steps depend on every earlier Step succeeding. When it is disabled, Definer can continue to later Steps after a Step fails.

Enable Skip Remaining Routines when this Routine should prevent later automatic Routines for the same result from running. The order in Definer Options → Sources → [source] → Settings → Routines therefore matters. Drag the Routines into the order in which you want Definer to consider them.

The switch beside each Routine controls whether it is enabled at all.

Save and verify the behavior

Select Save, then open a representative lookup for the source.

  • For an automatic Trigger, confirm that the Routine starts only when its condition matches.
  • For a Manual Trigger, open Routines and confirm that the Routine is ready to run.
  • If Show Routine Button is enabled, confirm that the button appears in the lookup header.

Use Test and troubleshoot Routines when a Trigger does not match the preview or a Routine starts more often than expected.