Automations
An Automation binds a trigger to an action: every time the trigger emits a value, the action runs. Under the hood it is a managed, long-running continuous task with a first-class lifecycle — start, stop, run history, and drift detection — so you don’t have to wire up and babysit that continuous task yourself.
Typical uses:
- A trigger watches an inbox → the action processes each new email.
- A trigger listens for webhook events → the action handles each incoming payload.
- A trigger polls a data source → the action processes each new record.
Trigger and action templates
Section titled “Trigger and action templates”Automations connect two task templates, each marked with a role:
- A Trigger template is a continuous template that produces a stream of values. It ends in a single exit node — the point where it hands each value off to whatever comes next. On its own, a trigger’s output goes nowhere; an automation gives it a destination.
- An Action template is an ordinary task template that runs once per value the trigger emits. It is invoked by reference, exactly like a sub task.
Templates are marked as Trigger or Action by their role, and the wizard only offers valid, enabled templates of the matching role.
Creating an automation
Section titled “Creating an automation”Open the automation wizard and work through its steps:
- Trigger — pick the trigger template and fill in its input (the same form you would fill in to start that template as a task).
- Action — pick the action template. Requence checks whether the trigger’s output type satisfies the action’s input type.
- Mapping — shown only when the types don’t match. Supply a small TypeScript mapping function that converts the trigger’s output into the action’s input (see below).
- Confirm — give the automation a name and review the summary.
Finish with Create (save it idle) or Create & Start (save it and start running immediately).
The mapping function
Section titled “The mapping function”When the trigger’s output shape already satisfies the action’s input, no mapping is needed and the wizard skips the Mapping step. When the shapes differ, you write a function that adapts one to the other:
(input: TriggerOutput): ActionInput => { // build the action's input from the trigger's output return { /* ... */ }}The editor is pre-seeded with the concrete TriggerOutput and ActionInput types (and any schemas they reference), so you get full autocomplete and type-checking while you write the mapping.
Lifecycle
Section titled “Lifecycle”An automation is always in one of four states:
| Status | Meaning |
|---|---|
| Idle | Saved but not running |
| Running | Its continuous task is live, invoking the action on every trigger emission |
| Stopped | Was running and has since stopped — by you, or because the task ended on its own |
| Failed | The underlying task failed |
Start and stop an automation from its row in the list or from the wizard. Each run is a real task, so you can open and inspect it like any other task. The run history shows the current run plus every previous run, with stop and error reasons.
One bad action run won’t stop the automation
Section titled “One bad action run won’t stop the automation”If a single action run errors, the failure is caught and routed aside — it does not bring down the continuous task. The automation keeps reacting to subsequent trigger emissions. By default the failure is simply logged.
Keeping automations up to date
Section titled “Keeping automations up to date”An automation captures a snapshot of the trigger and action templates as they were when you created it. If you later edit either template, the automation keeps running against the version it captured. Cosmetic edits (like moving a node on the canvas) are ignored; only structural changes count.
When a template the automation was built from has meaningfully changed — or was disabled, deleted, had its role changed, or developed errors — the automation is flagged Outdated (a badge on its row, and a banner in the wizard). To adopt the current templates, open it and choose Replace & Start: this re-snapshots the live templates, stops the stale run, and starts a fresh one.