AAurora Workflows
Get started
Documentation

Trigger Reference

Built-in triggers that fire workflow executions

Overview

A trigger is attached to a workflow and fires the workflow execution when a specific event occurs. A workflow can have multiple triggers; each independent trigger invocation starts a new execution cycle (subject to the configured WorkflowTriggerStrategy).

All triggers implement IWorkflowTaskTriggerBase and share the same common properties described in the Core API section.

OneTimeTrigger

OneTimeTrigger

Fires exactly once immediately when the workflow starts. Ideal for one-shot automation scripts.

Output: none (the trigger itself does not emit a value).

Configuration: none required.

TimedTrigger

TimedTrigger

Fires the workflow repeatedly at a fixed interval. An optional random tolerance can be applied to avoid thundering-herd patterns when many workflows share the same interval.

Output: DateTimeOffset – the timestamp at which the trigger fired.

PropertyTypeDescription
Intervalint (ms)The base interval between executions in milliseconds.
Toleranceint (ms)Maximum random jitter added or subtracted from the interval. Set to 0 for a fixed interval.

CronTrigger

CronTrigger

Fires the workflow on a schedule defined by a Quartz.NET cron expression. The expression format uses six or seven fields (seconds, minutes, hours, day-of-month, month, day-of-week, and optional year).

Output: DateTimeOffset – the scheduled fire time.

PropertyTypeDescription
CronExpressionstringA valid Quartz.NET cron expression. Default: 0/10 0/1 * 1/1 * ? * (every 10 seconds).

Cron Expression Examples

ExpressionFires
0 0 2 * * ?Daily at 02:00:00
0 0/5 * * * ?Every 5 minutes
0 0 9 ? * MON-FRIWeekdays at 09:00
0 0 0 1 * ?First day of every month at midnight

FileTrigger

FileTrigger

Fires when a file or directory event is detected by a FileSystemWatcher. You can subscribe to any combination of create, change, delete, and rename events.

Outputs:

  • FileSystemEventArgs (default) – the raw event args from FileSystemWatcher.
  • FileInfo – a FileInfo object for the affected file.
  • string (key: FilePath) – the full path of the affected file.
PropertyTypeDescription
PathstringThe directory to watch.
FilterstringFile name filter pattern, e.g. *.csv. Defaults to all files.
NotifyFiltersNotifyFiltersTypes of changes to watch for. Default: LastWrite | FileName | DirectoryName.
IncludeSubdirectoriesboolMonitor subdirectories recursively.
OnCreateEventEnabledboolSubscribe to file creation events.
OnChangeEventEnabledboolSubscribe to file change events.
OnDeleteEventEnabledboolSubscribe to file deletion events.
OnRenamedEventEnabledboolSubscribe to file rename events.

HttpListenerTrigger

HttpListenerTrigger

Starts an HTTP listener and fires the workflow each time an HTTP request is received on the configured prefixes. Useful for building simple webhook receivers or HTTP-triggered automation.

Output: HttpListenerContext – the full request/response context. Use ReadStringFromRequestTask or ReadQueryStringFromRequestTask to read request data, and WriteStringToResponseTask to write a response.

PropertyTypeDescription
PrefixesstringSemicolon or comma-separated URL prefixes, e.g. http://localhost:8080/;. Must end with /.
Note: On Windows, registering non-localhost prefixes requires elevated privileges or a URL ACL configured with netsh http add urlacl.

Adding a Custom Trigger

Implement IWorkflowTaskTriggerBase (or extend WorkflowTaskTriggerBase) and register the trigger on the workflow:

await workflow.AddTriggerAsync(new MyCustomTrigger { Name = "My Trigger" });

Custom triggers are described in more detail in Writing Custom Tasks.