Skip to main content
Version: 0.1.0

Workflow Triggers

Besides starting flows explicitly (API, SDK, admin console Run dialog), flows can start automatically when nodes change. Triggers are raisin:Trigger nodes in the functions workspace that reference a flow via function_flow.

Node-Event Triggers

A node-event trigger starts the referenced flow whenever a matching node event occurs — the primary way workflows are launched in production.

node_type: raisin:Trigger
properties:
name: on-article-published
title: On Article Published
trigger_type: node_event
enabled: true
config:
event_kinds: [Updated] # which events fire the trigger
filters:
workspaces: [default] # glob patterns
node_types: ["my:Article"]
# paths: ["/content/**"] # optional path globs
function_flow:
raisin:ref: /flows/publish-pipeline
raisin:workspace: functions
PropertyDescription
trigger_typenode_event
config.event_kindsAny of Created, Updated, Deleted, Published, Unpublished, Moved, Renamed
filters.workspacesWorkspace glob patterns
filters.pathsPath glob patterns (e.g. /content/**)
filters.node_typesNode type list (e.g. ["raisin:Page", "raisin:Asset"])
function_flowReference to the raisin:Flow node to start (node id or path)
enabledDefault true
priorityExecution priority (lower = higher priority)
note

Trigger nodes live under a folder in the functions workspace (the workspace root only allows folders) — e.g. /triggers/on-article-published.

The Trigger Context in the Flow

When a flow is started by a trigger, the triggering node's data is the flow input, and trigger metadata (event type, node path, actor, ...) is available under the trigger.* namespace:

- id: notify
node_type: raisin:FlowStep
properties:
function_ref: /lib/notify-author
arguments:
path: "{{ trigger.node_path }}"
event: "{{ trigger.event_type }}"

See Data & Templates.

Legacy: function_path

Triggers can alternatively reference a single function via function_path. This is deprecated — prefer function_flow, which gives you the full workflow toolbox (routing, retries, compensation, human tasks) even for single-step automations.

Scheduled Triggers

Schedule-based triggers run on a cron expression. The scheduler evaluates them periodically (every minute) and queues an execution for each match:

node_type: raisin:Trigger
properties:
name: daily-cleanup
title: Daily Cleanup
trigger_type: schedule
enabled: true
config:
cron_expression: "0 2 * * *" # 02:00 every day
function_path: /lib/cleanup-old-data

Supported cron syntax (5 fields: minute, hour, day, month, day-of-week):

PatternMeaning
*Any value
*/15Every 15 units (step values)
1-5Range
1,3,5List
@hourly, @daily / @midnight, @weekly, @monthly, @yearly / @annuallyPresets
info

Scheduled triggers currently invoke a function (function_path). To run a full workflow on a schedule, point the scheduled trigger at a small function that starts the flow via the flow API, or have the function perform the work directly.

Starting Flows Explicitly

For completeness, the explicit start paths:

ChannelHow
HTTPPOST /api/flows/{repo}/run with { "flow_path": "/flows/...", "input": {...} }
HTTP (test run)POST /api/flows/{repo}/test with an additional test_config (mocks, isolated branch)
SDKflows.run(path, input), flows.runAndWait(...), flows.runAndCollect(...)
Admin consoleRepository → Flows → Run dialog (JSON input + live event view)

Next Steps