flows

package
v0.3.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Overview

Package flows defines Ether's automation graph model, static validator, typed condition evaluator, safe template renderer, action/trigger registry contracts, durable runtime interfaces, and database migrations.

Index

Constants

View Source
const (
	// TopicSubscriptions carries leader-broadcast active event subscription patterns.
	TopicSubscriptions = "flows:subs"
	// TopicOutboxWake wakes the leader to drain events_outbox or claim newly created runs.
	TopicOutboxWake = "flows:outbox"
	// TopicFlowsChanged tells the leader that a flow definition changed on another node.
	TopicFlowsChanged = "flows:changed"
)

Cluster bus topics used to coordinate Flows across cluster nodes.

View Source
const (
	DefaultMaxNodes                = 100
	DefaultMaxEdges                = 250
	DefaultMaxGraphBytes           = 256 << 10
	DefaultMaxIDLen                = 64
	DefaultMaxSteps                = 100
	HardMaxSteps                   = 250
	DefaultRateLimitPerMin         = 60
	HardRateLimitPerMin            = 600
	DefaultConcurrency             = 4
	HardConcurrency                = 32
	MaxFlowDepth                   = 3
	DefaultConsecutiveFailureLimit = 10
	DefaultMaxRunDuration          = 7 * 24 * time.Hour
	HardMaxRunDuration             = 30 * 24 * time.Hour
	MaxActionTimeout               = 5 * time.Minute
	MaxDelayDuration               = 30 * 24 * time.Hour
	MaxWindowDuration              = 7 * 24 * time.Hour
	MaxRegexLen                    = 512
)

Graph and runtime safety bounds.

View Source
const (
	HandleNext       = "next"
	HandleError      = "error"
	HandleTrue       = "true"
	HandleFalse      = "false"
	HandleDefault    = "default"
	HandleMatched    = "matched"
	HandleTimeout    = "timeout"
	HandleReached    = "reached"
	HandleBelow      = "below"
	HandlePass       = "pass"
	HandleSuppressed = "suppressed"
)

Standard output handle names.

View Source
const SchemaVersion = 1

SchemaVersion is the current wire format version for Graph JSON.

Variables

View Source
var (
	ErrNotFound         = errors.New("flows: not found")
	ErrFlowDisabled     = errors.New("flows: flow is disabled")
	ErrRateLimited      = errors.New("flows: rate limit exceeded")
	ErrInvalidWebhook   = errors.New("flows: invalid webhook token")
	ErrNoManualTrigger  = errors.New("flows: flow has no manual trigger")
	ErrRunNotActive     = errors.New("flows: run is not active")
	ErrLoopDepthLimit   = errors.New("flows: event recursion depth limit reached")
	ErrValidationFailed = errors.New("flows: validation failed")
)

Common sentinel errors returned by Store and Runtime implementations.

View Source
var ErrDuplicateAction = errors.New("flows: action already registered")

ErrDuplicateAction is returned when registering an action type that already exists.

Functions

func DecodeConfig

func DecodeConfig[T any](n Node) (T, error)

DecodeConfig unmarshals n.Config into T.

func EventRunID

func EventRunID(flowID, triggerNodeID, eventID string) string

EventRunID derives a deterministic, replay-safe run ID for an event-triggered run.

func HasTemplateSyntax

func HasTemplateSyntax(s string) bool

HasTemplateSyntax reports whether s contains a "{{ ... }}" expression or block marker.

func HashWebhookToken

func HashWebhookToken(token string) string

HashWebhookToken returns the SHA-256 hex digest stored in flows_definitions.webhook_token_hash.

func IdempotencyKey

func IdempotencyKey(runID, nodeID string, attempt int) string

IdempotencyKey derives a deterministic, replay-safe action idempotency key for one step attempt inside a run.

func MustMarshalConfig

func MustMarshalConfig(v any) json.RawMessage

MustMarshalConfig encodes v as json.RawMessage for tests and template builders.

func NewFlowID

func NewFlowID() string

NewFlowID generates a random flow identifier ("flow_<16 hex>").

func NewRunID

func NewRunID() string

NewRunID generates a random run identifier ("run_<16 hex>").

func NewWaiterID

func NewWaiterID() string

NewWaiterID generates a random waiter identifier ("wait_<16 hex>").

func NextScheduleTime

func NextScheduleTime(cfg ScheduleTriggerConfig, after time.Time) (time.Time, error)

NextScheduleTime computes the next wall-clock UTC firing time strictly after after for cfg. Monotonic clock readings are stripped so sleep/resume or clock adjustments coalesce missed firings rather than creating a backlog storm.

func OperatorAllowedForField

func OperatorAllowedForField(t events.FieldType, op Operator) bool

OperatorAllowedForField reports whether op is valid for field type t.

func PluginActionType

func PluginActionType(pluginID, key string) string

PluginActionType formats a plugin-namespaced action type ("plugin:<pluginId>/<key>").

func RenderParams

func RenderParams(params map[string]any, ctx EvalContext) (map[string]any, error)

RenderParams recursively renders template strings inside an action params map. If a string value is strictly a single "{{ path }}" with no surrounding text, no block directive, and no filters, the resolved value preserves its native Go type (e.g. int/bool/slice).

func RenderTemplate

func RenderTemplate(tmpl string, ctx EvalContext) (string, error)

RenderTemplate evaluates all "{{ expr }}" placeholders and inline "{{#if ...}}" / "{{#unless ...}}" blocks inside tmpl against ctx.

func ResolvePath

func ResolvePath(path string, ctx EvalContext) (any, bool)

ResolvePath resolves a dotted path against ctx. Supported roots:

  • "payload.<path>" -> ctx.Payload
  • "event.<path>" -> ctx.Event (also supports "event.payload.<path>")
  • "correlation.<path>" -> ctx.Correlation
  • "vars.<path>" -> ctx.Vars
  • "steps.<nodeId>.<path>" -> ctx.Steps[nodeId]
  • "trigger.<path>" -> ctx.Trigger
  • bare "<path>" (no recognized root) -> ctx.Payload

func ScheduleRunID

func ScheduleRunID(flowID, nodeID string, slot time.Time) string

ScheduleRunID derives a deterministic run ID for one schedule firing slot.

func ValidateTemplate

func ValidateTemplate(tmpl string) error

ValidateTemplate checks that all "{{ ... }}" expressions and conditional blocks ({{#if ...}}...{{#else}}...{{/if}}, {{#unless ...}}...{{/unless}}) in tmpl are balanced, within nesting limits, and use only recognized filters and operators.

Types

type ActionContext

type ActionContext struct {
	FlowID         string
	RunID          string
	NodeID         string
	IdempotencyKey string
	DryRun         bool
	FlowDepth      int
	Event          events.Envelope
	Vars           map[string]any
	SetVar         func(key string, val any)
}

ActionContext provides execution metadata and variable mutation to ActionHandler.Execute.

type ActionFunc

type ActionFunc struct {
	ActionSpec ActionSpec
	Run        func(ctx context.Context, actx ActionContext, params map[string]any) (ActionResult, error)
}

ActionFunc adapts a Spec + function into an ActionHandler.

func (ActionFunc) Execute

func (f ActionFunc) Execute(ctx context.Context, actx ActionContext, params map[string]any) (ActionResult, error)

func (ActionFunc) Spec

func (f ActionFunc) Spec() ActionSpec

type ActionHandler

type ActionHandler interface {
	Spec() ActionSpec
	Execute(ctx context.Context, actx ActionContext, params map[string]any) (ActionResult, error)
}

ActionHandler implements one executable Flow action.

type ActionNodeConfig

type ActionNodeConfig struct {
	ActionType      string         `json:"actionType"`
	Params          map[string]any `json:"params,omitempty"`
	ContinueOnError bool           `json:"continueOnError,omitempty"`
	IdempotencyKey  string         `json:"idempotencyKey,omitempty"`
	Timeout         string         `json:"timeout,omitempty"`
}

ActionNodeConfig configures an action node.

type ActionRegistry

type ActionRegistry interface {
	Register(h ActionHandler) error
	MustRegister(h ActionHandler)
	ReplacePlugin(pluginID string, handlers []ActionHandler) error
	RemovePlugin(pluginID string)
	Get(actionType string) (ActionHandler, bool)
	Spec(actionType string) (ActionSpec, bool)
	List() []ActionSpec
}

ActionRegistry is the lookup and registration contract for built-in and plugin actions.

type ActionResult

type ActionResult struct {
	Output map[string]any `json:"output,omitempty"`
	Branch string         `json:"branch,omitempty"` // defaults to HandleNext
}

ActionResult is returned by an ActionHandler.Execute call.

type ActionSpec

type ActionSpec struct {
	Type        string               `json:"type"`
	Owner       string               `json:"owner"`
	Group       string               `json:"group"`
	Label       string               `json:"label"`
	Description string               `json:"description,omitempty"`
	Icon        string               `json:"icon,omitempty"`
	Idempotent  bool                 `json:"idempotent,omitempty"`
	SideEffect  bool                 `json:"sideEffect,omitempty"`
	Params      []ParamSchema        `json:"params,omitempty"`
	Outputs     []events.FieldSchema `json:"outputs,omitempty"`
}

ActionSpec describes one action available in the Flow editor and runtime.

func (ActionSpec) Param

func (s ActionSpec) Param(key string) (ParamSchema, bool)

Param looks up a parameter schema by key.

func (ActionSpec) Validate

func (s ActionSpec) Validate() error

Validate checks that s is well-formed.

type ConditionGroup

type ConditionGroup struct {
	Op     LogicOp          `json:"op,omitempty"`
	Negate bool             `json:"negate,omitempty"`
	Rules  []ConditionRule  `json:"rules,omitempty"`
	Groups []ConditionGroup `json:"groups,omitempty"`
}

ConditionGroup is a recursive AND/OR condition tree. An empty group matches true (or false when Negate is true).

func (ConditionGroup) EffectiveOp

func (g ConditionGroup) EffectiveOp() LogicOp

EffectiveOp returns g.Op, defaulting to LogicAnd.

func (ConditionGroup) IsEmpty

func (g ConditionGroup) IsEmpty() bool

IsEmpty reports whether g has no rules and no nested groups.

type ConditionNodeConfig

type ConditionNodeConfig struct {
	Condition ConditionGroup `json:"condition"`
}

ConditionNodeConfig configures a condition node.

type ConditionRule

type ConditionRule struct {
	Field         string   `json:"field"`
	Op            Operator `json:"op"`
	Value         any      `json:"value,omitempty"`
	CaseSensitive bool     `json:"caseSensitive,omitempty"`
}

ConditionRule compares a field path against an optional value.

type ConditionTrace

type ConditionTrace struct {
	Op      LogicOp          `json:"op"`
	Negate  bool             `json:"negate,omitempty"`
	Matched bool             `json:"matched"`
	Rules   []RuleTrace      `json:"rules,omitempty"`
	Groups  []ConditionTrace `json:"groups,omitempty"`
}

ConditionTrace records the recursive evaluation trace of a ConditionGroup.

func EvalConditionGroup

func EvalConditionGroup(g ConditionGroup, ctx EvalContext) (bool, ConditionTrace, error)

EvalConditionGroup evaluates g against ctx and returns the boolean verdict along with a structured trace of every rule and nested group.

type DedupeNodeConfig

type DedupeNodeConfig struct {
	KeyTemplate  string `json:"keyTemplate,omitempty"`
	Cooldown     string `json:"cooldown"`
	MaxPerWindow int    `json:"maxPerWindow,omitempty"` // 0 treated as 1
}

DedupeNodeConfig configures a logic.dedupe node (cooldown / throttle per key).

type DelayNodeConfig

type DelayNodeConfig struct {
	Duration      string `json:"duration,omitempty"`
	DurationField string `json:"durationField,omitempty"`
	Until         string `json:"until,omitempty"`
}

DelayNodeConfig configures a logic.delay node. Exactly one of Duration, DurationField, or Until must be set.

type Edge

type Edge struct {
	ID           string `json:"id"`
	Source       string `json:"source"`
	Target       string `json:"target"`
	SourceHandle string `json:"sourceHandle,omitempty"`
}

Edge connects one output handle of Source to Target.

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine is Ether's durable Flows Runtime implementation.

func NewEngine

func NewEngine(opts EngineOptions) *Engine

NewEngine constructs a Flows Engine. Call Start(ctx) to begin processing.

func (*Engine) Bridge

func (e *Engine) Bridge() *OutboxBridge

Bridge returns the follower->leader OutboxBridge attached to this Engine, if any.

func (*Engine) CancelRun

func (e *Engine) CancelRun(ctx context.Context, runID string) error

CancelRun cancels an active pending, running, or waiting run and any active waiters belonging to it.

func (*Engine) IsLeading

func (e *Engine) IsLeading() bool

IsLeading reports whether this Engine instance is currently executing leader duties.

func (*Engine) NotifyFlowsChanged

func (e *Engine) NotifyFlowsChanged(ctx context.Context, flowID string)

NotifyFlowsChanged refreshes the engine's compiled flow index, reconciles schedules, and broadcasts updated subscriptions across the cluster.

func (*Engine) ProcessPending

func (e *Engine) ProcessPending(ctx context.Context) error

ProcessPending performs one deterministic, synchronous sweep of the outbox, expired waiters, due schedules, and due runs on the caller's goroutine. It is primarily intended for deterministic tests without wall-clock sleeps.

func (*Engine) ReloadFlows

func (e *Engine) ReloadFlows(ctx context.Context) error

ReloadFlows loads all saved flows from Store and reconciles schedules for enabled flows.

func (*Engine) Start

func (e *Engine) Start(ctx context.Context) error

Start runs the Flows runtime until ctx is cancelled. In clustered mode, leader work executes exclusively inside cluster.RunAsLeader("flows", ...) while the follower->leader OutboxBridge runs for the lifetime of ctx.

func (*Engine) SubscribedEvents

func (e *Engine) SubscribedEvents(ctx context.Context) ([]string, error)

SubscribedEvents returns the sorted, deduplicated union of event patterns referenced by enabled flows and active flows_waiters rows.

func (*Engine) TestRun

func (e *Engine) TestRun(ctx context.Context, req TestRunRequest) (*TestRunResult, error)

TestRun synchronously executes a flow (or unsaved draft graph) in either dry mode (zero persistent side effects, ActionContext.DryRun=true) or live mode (real action execution, ActionContext.DryRun=false).

func (*Engine) TriggerManual

func (e *Engine) TriggerManual(ctx context.Context, flowID string, inputs map[string]any) (*Run, error)

TriggerManual creates a durable pending run for a flow's manual trigger node.

func (*Engine) TriggerWebhook

func (e *Engine) TriggerWebhook(ctx context.Context, token string, payload map[string]any, headers map[string]string) (*Run, error)

TriggerWebhook authenticates token against stored webhook hashes and creates a durable pending run for the matching flow's webhook trigger node.

type EngineOptions

type EngineOptions struct {
	Store      Store
	DB         *sql.DB
	Bus        *events.Bus
	Events     *events.Registry
	Actions    ActionRegistry
	Triggers   TriggerRegistry
	Cluster    cluster.Cluster
	ClusterBus clusterbus.Bus
	NodeID     string
	Logger     *slog.Logger
	Now        func() time.Time

	TickInterval  time.Duration
	LeaseDuration time.Duration
	MaxWorkers    int
	BusBuffer     int

	RetentionAge  time.Duration
	RetentionMax  int
	PruneInterval time.Duration

	BackoffThreshold int
	BackoffBase      time.Duration
	BackoffMax       time.Duration

	// EnableBridge forces the follower->leader OutboxBridge to run even when
	// Cluster is nil or Solo (useful in tests with simulated clusterbus.Hub).
	EnableBridge bool

	OnFlowsChanged  func(flowID string)
	OnRunUpdated    func(run Run)
	OnAutoDisable   func(flow Flow, run Run)
	OnLeaderStarted func()
}

EngineOptions configures a durable Flows Runtime.

type EvalContext

type EvalContext struct {
	Event       map[string]any
	Payload     map[string]any
	Correlation map[string]any
	Vars        map[string]any
	Steps       map[string]map[string]any
	Trigger     map[string]any
}

EvalContext is the read-only data view available to condition evaluation and template rendering during a flow run.

func NewEvalContext

func NewEvalContext(ev events.Envelope, vars map[string]any, steps map[string]map[string]any, trigger map[string]any) (EvalContext, error)

NewEvalContext builds an EvalContext from an event Envelope plus run state.

type EventTriggerConfig

type EventTriggerConfig struct {
	Events []string        `json:"events"`
	Filter *ConditionGroup `json:"filter,omitempty"`
}

EventTriggerConfig configures a trigger.event node.

type Flow

type Flow struct {
	ID                  string     `json:"id"`
	Name                string     `json:"name"`
	Description         string     `json:"description,omitempty"`
	Enabled             bool       `json:"enabled"`
	DisabledReason      string     `json:"disabledReason,omitempty"`
	Version             int        `json:"version"`
	Graph               Graph      `json:"graph"`
	Limits              FlowLimits `json:"limits,omitempty"`
	ConsecutiveFailures int        `json:"consecutiveFailures,omitempty"`
	TemplateID          string     `json:"templateId,omitempty"`
	Tags                []string   `json:"tags,omitempty"`
	CreatedAt           time.Time  `json:"createdAt"`
	UpdatedAt           time.Time  `json:"updatedAt"`
	LastRunAt           time.Time  `json:"lastRunAt,omitzero"`
	LastStatus          RunStatus  `json:"lastStatus,omitempty"`
}

Flow is a saved automation definition plus operational summary metadata.

type FlowLimits

type FlowLimits struct {
	RateLimitPerMin   int  `json:"rateLimitPerMin,omitempty"`
	MaxSteps          int  `json:"maxSteps,omitempty"`
	Concurrency       int  `json:"concurrency,omitempty"`
	OrderedByKey      bool `json:"orderedByKey,omitempty"`
	AutoDisableAfter  int  `json:"autoDisableAfter,omitempty"`
	MaxRunDurationSec int  `json:"maxRunDurationSec,omitempty"`
}

FlowLimits configures per-flow safety and scheduling guardrails. Zero values take package defaults; negative AutoDisableAfter disables the circuit breaker.

func (FlowLimits) Effective

func (l FlowLimits) Effective() FlowLimits

Effective returns l with defaults applied and values clamped to hard ceilings.

type Graph

type Graph struct {
	SchemaVersion int    `json:"schemaVersion"`
	Nodes         []Node `json:"nodes"`
	Edges         []Edge `json:"edges"`
}

Graph is the versioned DAG executed by the runtime and edited in the console.

func (Graph) SubscribedEventPatterns

func (g Graph) SubscribedEventPatterns() []string

SubscribedEventPatterns returns the distinct event patterns referenced by trigger.event and logic.wait_event nodes in g.

type InMemoryActionRegistry

type InMemoryActionRegistry struct {
	// contains filtered or unexported fields
}

InMemoryActionRegistry is the thread-safe default ActionRegistry implementation.

func NewActionRegistry

func NewActionRegistry() *InMemoryActionRegistry

NewActionRegistry returns an empty ActionRegistry.

func (*InMemoryActionRegistry) Get

func (r *InMemoryActionRegistry) Get(actionType string) (ActionHandler, bool)

func (*InMemoryActionRegistry) List

func (r *InMemoryActionRegistry) List() []ActionSpec

func (*InMemoryActionRegistry) MustRegister

func (r *InMemoryActionRegistry) MustRegister(h ActionHandler)

func (*InMemoryActionRegistry) Register

func (*InMemoryActionRegistry) RemovePlugin

func (r *InMemoryActionRegistry) RemovePlugin(pluginID string)

func (*InMemoryActionRegistry) ReplacePlugin

func (r *InMemoryActionRegistry) ReplacePlugin(pluginID string, handlers []ActionHandler) error

func (*InMemoryActionRegistry) Spec

func (r *InMemoryActionRegistry) Spec(actionType string) (ActionSpec, bool)

type InMemoryTriggerRegistry

type InMemoryTriggerRegistry struct {
	// contains filtered or unexported fields
}

InMemoryTriggerRegistry is the default thread-safe TriggerRegistry.

func NewTriggerRegistry

func NewTriggerRegistry() *InMemoryTriggerRegistry

NewTriggerRegistry creates a TriggerRegistry pre-populated with Ether's four built-in triggers (event, schedule, webhook, manual).

func (*InMemoryTriggerRegistry) Get

func (*InMemoryTriggerRegistry) List

func (*InMemoryTriggerRegistry) Register

func (r *InMemoryTriggerRegistry) Register(spec TriggerSpec) error

type LogicOp

type LogicOp string

LogicOp combines rules and sub-groups inside a ConditionGroup.

const (
	LogicAnd LogicOp = "and"
	LogicOr  LogicOp = "or"
)

type ManualTriggerConfig

type ManualTriggerConfig struct {
	Inputs          []ParamSchema `json:"inputs,omitempty"`
	SampleEventType string        `json:"sampleEventType,omitempty"`
}

ManualTriggerConfig configures a trigger.manual node.

type Node

type Node struct {
	ID       string          `json:"id"`
	Kind     NodeKind        `json:"kind"`
	Label    string          `json:"label,omitempty"`
	Position Position        `json:"position"`
	Config   json.RawMessage `json:"config,omitempty"`
	Disabled bool            `json:"disabled,omitempty"`
}

Node is one trigger, condition, logic step, or action in a Graph.

type NodeKind

type NodeKind string

NodeKind identifies the behaviour of one node in a flow graph.

const (
	NodeTriggerEvent    NodeKind = "trigger.event"
	NodeTriggerSchedule NodeKind = "trigger.schedule"
	NodeTriggerWebhook  NodeKind = "trigger.webhook"
	NodeTriggerManual   NodeKind = "trigger.manual"

	NodeCondition NodeKind = "condition"

	NodeLogicSwitch    NodeKind = "logic.switch"
	NodeLogicDelay     NodeKind = "logic.delay"
	NodeLogicWaitEvent NodeKind = "logic.wait_event"
	NodeLogicWindow    NodeKind = "logic.window"
	NodeLogicDedupe    NodeKind = "logic.dedupe"

	NodeAction NodeKind = "action"
)

func (NodeKind) Category

func (k NodeKind) Category() string

Category groups node kinds for console palettes and diagnostics.

func (NodeKind) IsTrigger

func (k NodeKind) IsTrigger() bool

IsTrigger reports whether k is an entry trigger node kind.

func (NodeKind) IsValid

func (k NodeKind) IsValid() bool

IsValid reports whether k is a recognized built-in NodeKind.

type Operator

type Operator string

Operator is one typed comparison inside a ConditionRule.

const (
	OpEq          Operator = "eq"
	OpNeq         Operator = "neq"
	OpGt          Operator = "gt"
	OpGte         Operator = "gte"
	OpLt          Operator = "lt"
	OpLte         Operator = "lte"
	OpContains    Operator = "contains"
	OpNotContains Operator = "not_contains"
	OpStartsWith  Operator = "starts_with"
	OpEndsWith    Operator = "ends_with"
	OpMatches     Operator = "matches"
	OpIn          Operator = "in"
	OpNotIn       Operator = "not_in"
	OpExists      Operator = "exists"
	OpNotExists   Operator = "not_exists"
	OpIsTrue      Operator = "is_true"
	OpIsFalse     Operator = "is_false"
	OpContainsAny Operator = "contains_any"
	OpContainsAll Operator = "contains_all"
)

func OperatorsForFieldType

func OperatorsForFieldType(t events.FieldType) []Operator

OperatorsForFieldType returns the valid operators for a schema FieldType, in console display order.

func (Operator) RequiresValue

func (o Operator) RequiresValue() bool

RequiresValue reports whether o expects a right-hand comparison Value.

func (Operator) Valid

func (o Operator) Valid() bool

Valid reports whether o is a supported condition operator.

type OutboxBridge

type OutboxBridge struct {
	// contains filtered or unexported fields
}

OutboxBridge subscribes to a node's local events.Bus and forwards only events matching the leader-broadcast subscription set (or Meta.Durable) to events_outbox + a clusterbus wake ping when this node is not leading. Events that no flow or waiter subscribes to cause zero database writes.

func NewOutboxBridge

func NewOutboxBridge(opts OutboxBridgeOptions) *OutboxBridge

NewOutboxBridge creates a follower→leader outbox bridge.

func (*OutboxBridge) Matches

func (b *OutboxBridge) Matches(eventType string) bool

Matches reports whether eventType matches any active subscription pattern.

func (*OutboxBridge) Patterns

func (b *OutboxBridge) Patterns() []string

Patterns returns a snapshot of the bridge's currently active subscription patterns.

func (*OutboxBridge) Ready

func (b *OutboxBridge) Ready() <-chan struct{}

Ready returns a channel closed once the bridge has subscribed to the bus and loaded its initial subscription set.

func (*OutboxBridge) Run

func (b *OutboxBridge) Run(ctx context.Context)

Run subscribes to clusterbus subscription updates and the local events.Bus, forwarding matching follower events into events_outbox until ctx ends.

func (*OutboxBridge) SetOnSubsUpdated

func (b *OutboxBridge) SetOnSubsUpdated(fn func(patterns []string))

SetOnSubsUpdated installs a callback invoked after the bridge commits a new subscription pattern set.

func (*OutboxBridge) SetPatterns

func (b *OutboxBridge) SetPatterns(patterns []string)

SetPatterns replaces the bridge's in-memory subscription pattern filter.

type OutboxBridgeOptions

type OutboxBridgeOptions struct {
	DB            *sql.DB
	Bus           *events.Bus
	ClusterBus    clusterbus.Bus
	NodeID        string
	IsLeader      func() bool
	LoadSubs      func(ctx context.Context) ([]string, error)
	Now           func() time.Time
	Logger        *slog.Logger
	BufferSize    int
	OnForwarded   func(ev events.Envelope)
	OnSubsUpdated func(patterns []string)
}

OutboxBridgeOptions configures a follower→leader events_outbox bridge.

type OutboxRow

type OutboxRow struct {
	ID        int64
	EventID   string
	EventType string
	Envelope  json.RawMessage
}

OutboxRow is one pending entry read from events_outbox.

type OutboxStore

type OutboxStore struct {
	// contains filtered or unexported fields
}

OutboxStore reads and writes the shared events_outbox table (events/1) across SQLite and PostgreSQL.

func NewOutboxStore

func NewOutboxStore(db *sql.DB, now func() time.Time) *OutboxStore

NewOutboxStore creates an OutboxStore over db.

func (*OutboxStore) Ack

func (o *OutboxStore) Ack(ctx context.Context, id int64, ackedAt time.Time) error

Ack marks one events_outbox row acknowledged.

func (*OutboxStore) Enqueue

func (o *OutboxStore) Enqueue(ctx context.Context, ev events.Envelope) (bool, error)

Enqueue persists ev into events_outbox idempotently (deduplicated by event_id).

func (*OutboxStore) ListPending

func (o *OutboxStore) ListPending(ctx context.Context, limit int) ([]OutboxRow, error)

ListPending returns up to limit unacknowledged rows ordered by id ascending.

func (*OutboxStore) PruneAcked

func (o *OutboxStore) PruneAcked(ctx context.Context, olderThan time.Time) (int64, error)

PruneAcked removes acknowledged events_outbox rows older than olderThan in batches.

type ParamSchema

type ParamSchema struct {
	Key         string              `json:"key"`
	Type        events.FieldType    `json:"type"`
	Label       string              `json:"label"`
	Description string              `json:"description,omitempty"`
	Required    bool                `json:"required,omitempty"`
	Secret      bool                `json:"secret,omitempty"`
	Template    bool                `json:"template,omitempty"`
	Default     any                 `json:"default,omitempty"`
	Enum        []events.EnumOption `json:"enum,omitempty"`
	Unit        string              `json:"unit,omitempty"`
	// Picker is an optional console editor hint ("channel", "viewer", "library",
	// "source", "event", "plugin").
	Picker string `json:"picker,omitempty"`
}

ParamSchema defines one configurable parameter of a Flow action or manual trigger.

func (ParamSchema) HasEnumValue

func (p ParamSchema) HasEnumValue(v string) bool

HasEnumValue reports whether v is one of p.Enum's values.

type Position

type Position struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
}

Position holds visual canvas coordinates for the console editor.

type RuleTrace

type RuleTrace struct {
	Field    string   `json:"field"`
	Op       Operator `json:"op"`
	Expected any      `json:"expected,omitempty"`
	Actual   any      `json:"actual,omitempty"`
	Found    bool     `json:"found"`
	Matched  bool     `json:"matched"`
}

RuleTrace records the evaluation details of a single ConditionRule for console inspection and dry-run debugging.

type Run

type Run struct {
	ID             string          `json:"id"`
	FlowID         string          `json:"flowId"`
	FlowName       string          `json:"flowName,omitempty"`
	FlowVersion    int             `json:"flowVersion"`
	TriggerKind    NodeKind        `json:"triggerKind"`
	EventID        string          `json:"eventId,omitempty"`
	EventType      string          `json:"eventType,omitempty"`
	CorrelationKey string          `json:"correlationKey,omitempty"`
	Status         RunStatus       `json:"status"`
	Attempt        int             `json:"attempt"`
	DryRun         bool            `json:"dryRun,omitempty"`
	Trigger        json.RawMessage `json:"trigger,omitempty"`
	Context        json.RawMessage `json:"context,omitempty"`
	Error          string          `json:"error,omitempty"`
	StepCount      int             `json:"stepCount"`
	FlowDepth      int             `json:"flowDepth,omitempty"`
	StartedAt      time.Time       `json:"startedAt"`
	UpdatedAt      time.Time       `json:"updatedAt"`
	FinishedAt     time.Time       `json:"finishedAt,omitzero"`
	WakeAt         time.Time       `json:"wakeAt,omitzero"`
	LeaseOwner     string          `json:"-"`
	LeaseUntil     time.Time       `json:"-"`
}

Run is one durable execution of a Flow.

type RunFilter

type RunFilter struct {
	FlowID    string
	Status    RunStatus
	EventType string
	Limit     int
	Cursor    string
}

RunFilter scopes Run listing queries for the console API.

type RunStatus

type RunStatus string

RunStatus tracks the durable lifecycle state of a single flow run.

const (
	RunPending   RunStatus = "pending"
	RunRunning   RunStatus = "running"
	RunWaiting   RunStatus = "waiting"
	RunCompleted RunStatus = "completed"
	RunFailed    RunStatus = "failed"
	RunCancelled RunStatus = "cancelled"
	RunThrottled RunStatus = "throttled"
)

func (RunStatus) Terminal

func (s RunStatus) Terminal() bool

Terminal reports whether s is a finished run state.

type RunStep

type RunStep struct {
	ID             int64           `json:"id"`
	RunID          string          `json:"runId"`
	Seq            int             `json:"seq"`
	NodeID         string          `json:"nodeId"`
	NodeKind       NodeKind        `json:"nodeKind"`
	Status         StepStatus      `json:"status"`
	IdempotencyKey string          `json:"idempotencyKey,omitempty"`
	Branch         string          `json:"branch,omitempty"`
	Input          json.RawMessage `json:"input,omitempty"`
	Output         json.RawMessage `json:"output,omitempty"`
	Error          string          `json:"error,omitempty"`
	StartedAt      time.Time       `json:"startedAt"`
	FinishedAt     time.Time       `json:"finishedAt,omitzero"`
	DurationMS     int64           `json:"durationMs"`
}

RunStep is one recorded node execution inside a Run.

type Runtime

type Runtime interface {
	Start(ctx context.Context) error
	TriggerManual(ctx context.Context, flowID string, inputs map[string]any) (*Run, error)
	TriggerWebhook(ctx context.Context, token string, payload map[string]any, headers map[string]string) (*Run, error)
	TestRun(ctx context.Context, req TestRunRequest) (*TestRunResult, error)
	CancelRun(ctx context.Context, runID string) error
	SubscribedEvents(ctx context.Context) ([]string, error)
}

Runtime drives event ingestion, schedules, durable step execution, restart recovery, and test runs. In clustered mode, Start runs inside cluster.RunAsLeader.

type SQLStore

type SQLStore struct {
	// contains filtered or unexported fields
}

SQLStore implements Store over *sql.DB (SQLite and PostgreSQL) using flows/1.

func NewSQLStore

func NewSQLStore(db *sql.DB, opts ...StoreOption) *SQLStore

NewSQLStore constructs a durable Store backed by db.

func (*SQLStore) ActiveWaiterEventPatterns

func (s *SQLStore) ActiveWaiterEventPatterns(ctx context.Context) ([]string, error)

ActiveWaiterEventPatterns returns distinct event patterns from active waiting rows.

func (*SQLStore) AddOnChange

func (s *SQLStore) AddOnChange(fn func(flowID string))

AddOnChange appends a callback invoked after a flow definition changes.

func (*SQLStore) AdvanceScheduleAndCreateRun

func (s *SQLStore) AdvanceScheduleAndCreateRun(ctx context.Context, flowID, nodeID string, expectedNext, lastRun, nextRun time.Time, run *Run) (bool, error)

AdvanceScheduleAndCreateRun atomically advances flows_schedules and inserts the scheduled run (if not already inserted for that slot).

func (*SQLStore) CancelFlowActiveRuns

func (s *SQLStore) CancelFlowActiveRuns(ctx context.Context, flowID string, now time.Time) (int64, error)

CancelFlowActiveRuns cancels all non-terminal runs and active waiters for flowID.

func (*SQLStore) CancelRun

func (s *SQLStore) CancelRun(ctx context.Context, runID string, now time.Time) error

CancelRun transitions an active run to cancelled and cancels any waiting waiters.

func (*SQLStore) CheckDedupe

func (s *SQLStore) CheckDedupe(ctx context.Context, flowID, nodeID, dedupeKey string, at time.Time, cooldown time.Duration, maxPerWindow int) (allowed bool, hits int, err error)

func (*SQLStore) ClaimDueRuns

func (s *SQLStore) ClaimDueRuns(ctx context.Context, owner string, now time.Time, lease time.Duration, limit int) ([]Run, error)

ClaimDueRuns atomically leases up to limit due runs (pending, delay-due waiting, or lease-expired running), respecting each flow's concurrency and orderedByKey limits.

func (*SQLStore) CommitOutboxEvent

func (s *SQLStore) CommitOutboxEvent(ctx context.Context, outboxID int64, ackedAt time.Time, runs []Run, waiters []WaiterMatchCommit) (runsCreated int, waitersMatched int, err error)

CommitOutboxEvent atomically inserts triggered runs (idempotently), resolves matched waiters, and marks the events_outbox row acknowledged in one transaction.

func (*SQLStore) CompleteStepAndAdvanceRun

func (s *SQLStore) CompleteStepAndAdvanceRun(ctx context.Context, step *RunStep, run Run, waiters []Waiter) error

CompleteStepAndAdvanceRun updates (or inserts if step.ID == 0) a step row, optionally inserts waiters, and updates the run row in one atomic transaction.

func (*SQLStore) CreateRun

func (s *SQLStore) CreateRun(ctx context.Context, run Run) error

func (*SQLStore) CreateRunIfAbsent

func (s *SQLStore) CreateRunIfAbsent(ctx context.Context, run Run) (bool, error)

CreateRunIfAbsent inserts run atomically and reports whether a new row was created. Duplicate run IDs (e.g. replayed events) return (false, nil).

func (*SQLStore) CreateWaiter

func (s *SQLStore) CreateWaiter(ctx context.Context, w Waiter) error

func (*SQLStore) DB

func (s *SQLStore) DB() *sql.DB

DB returns the underlying *sql.DB handle.

func (*SQLStore) DeleteFlow

func (s *SQLStore) DeleteFlow(ctx context.Context, id string) error

func (*SQLStore) ExpireWaiters

func (s *SQLStore) ExpireWaiters(ctx context.Context, now time.Time, limit int) ([]Waiter, error)

ExpireWaiters atomically marks up to limit timed-out waiters as timed_out (cancelling sibling waiters for the same run/node so each wait_event times out once) and returns the expired rows.

func (*SQLStore) FindFlowByWebhookHash

func (s *SQLStore) FindFlowByWebhookHash(ctx context.Context, tokenHash string) (*Flow, error)

func (*SQLStore) GetFlow

func (s *SQLStore) GetFlow(ctx context.Context, id string) (*Flow, error)

func (*SQLStore) GetRun

func (s *SQLStore) GetRun(ctx context.Context, runID string) (*Run, error)

func (*SQLStore) ListDueSchedules

func (s *SQLStore) ListDueSchedules(ctx context.Context, now time.Time, limit int) ([]ScheduleEntry, error)

ListDueSchedules returns enabled schedule entries whose next_run_ms <= now.

func (*SQLStore) ListFlows

func (s *SQLStore) ListFlows(ctx context.Context) ([]Flow, error)

func (*SQLStore) ListRunSteps

func (s *SQLStore) ListRunSteps(ctx context.Context, runID string) ([]RunStep, error)

func (*SQLStore) ListRuns

func (s *SQLStore) ListRuns(ctx context.Context, filter RunFilter) ([]Run, string, error)

func (*SQLStore) MatchWaiters

func (s *SQLStore) MatchWaiters(ctx context.Context, eventType, correlationKey string, now time.Time) ([]Waiter, error)

MatchWaiters returns active, non-expired waiters matching eventType (exact or wildcard pattern) and correlationKey (or empty waiter correlationKey).

func (*SQLStore) PruneHistory

func (s *SQLStore) PruneHistory(ctx context.Context, olderThan time.Time, maxRuns int) (int64, error)

func (*SQLStore) RecordFlowOutcome

func (s *SQLStore) RecordFlowOutcome(
	ctx context.Context,
	flowID string,
	status RunStatus,
	finishedAt time.Time,
	autoDisableAfter int,
	errMsg string,
) (streak int, autoDisabled bool, disabledReason string, err error)

RecordFlowOutcome updates last_run_at_ms, last_status, and consecutive_failures atomically, tripping auto-disable when consecutive_failures reaches autoDisableAfter.

func (*SQLStore) RecordStep

func (s *SQLStore) RecordStep(ctx context.Context, step RunStep) (int64, error)

func (*SQLStore) RecordWindowEvent

func (s *SQLStore) RecordWindowEvent(ctx context.Context, flowID, nodeID, groupKey string, at time.Time, window time.Duration, resetAt int) (count int, reached bool, err error)

func (*SQLStore) RenewRunLease

func (s *SQLStore) RenewRunLease(ctx context.Context, runID, owner string, until time.Time) (bool, error)

RenewRunLease extends the lease of a running run owned by owner.

func (*SQLStore) ResolveWaiterAndWakeRun

func (s *SQLStore) ResolveWaiterAndWakeRun(ctx context.Context, commit WaiterMatchCommit, now time.Time) (bool, error)

ResolveWaiterAndWakeRun atomically marks a waiting waiter as matched, cancels sibling waiters for (runID, nodeID), updates the waiting run's context, and transitions the run to pending so a worker claims it immediately.

func (*SQLStore) RunExists

func (s *SQLStore) RunExists(ctx context.Context, runID string) (bool, error)

RunExists reports whether a flows_runs row with id already exists.

func (*SQLStore) SaveFlow

func (s *SQLStore) SaveFlow(ctx context.Context, f Flow) (*Flow, error)

func (*SQLStore) SetFlowEnabled

func (s *SQLStore) SetFlowEnabled(ctx context.Context, id string, enabled bool, reason string) error

func (*SQLStore) SetWebhookTokenHash

func (s *SQLStore) SetWebhookTokenHash(ctx context.Context, flowID, tokenHash string) error

func (*SQLStore) SyncFlowSchedules

func (s *SQLStore) SyncFlowSchedules(ctx context.Context, f Flow, now time.Time) error

SyncFlowSchedules reconciles flows_schedules rows for f against f.Graph.

func (*SQLStore) UpdateRun

func (s *SQLStore) UpdateRun(ctx context.Context, run Run) error

func (*SQLStore) UpdateStep

func (s *SQLStore) UpdateStep(ctx context.Context, step RunStep) error

func (*SQLStore) WakeRunAfterTimeout

func (s *SQLStore) WakeRunAfterTimeout(ctx context.Context, runID string, mutate func(raw json.RawMessage) (json.RawMessage, error), now time.Time) (bool, error)

WakeRunAfterTimeout transitions a waiting run to pending with a timeout wait result.

type ScheduleEntry

type ScheduleEntry struct {
	FlowID  string
	NodeID  string
	NextRun time.Time
	LastRun time.Time
}

ScheduleEntry represents one persisted trigger.schedule row in flows_schedules.

type ScheduleTriggerConfig

type ScheduleTriggerConfig struct {
	Cron     string `json:"cron,omitempty"`
	Every    string `json:"every,omitempty"`
	Timezone string `json:"timezone,omitempty"`
}

ScheduleTriggerConfig configures a trigger.schedule node. Exactly one of Cron or Every must be provided.

type StepStatus

type StepStatus string

StepStatus tracks the outcome of one node execution inside a run.

const (
	StepPending   StepStatus = "pending"
	StepRunning   StepStatus = "running"
	StepCompleted StepStatus = "completed"
	StepFailed    StepStatus = "failed"
	StepSkipped   StepStatus = "skipped"
	// StepUncertain marks a non-idempotent side-effecting action whose node
	// crashed mid-execution so recovery never blindly double-executes it.
	StepUncertain StepStatus = "uncertain"
)

type Store

type Store interface {
	ListFlows(ctx context.Context) ([]Flow, error)
	GetFlow(ctx context.Context, id string) (*Flow, error)
	SaveFlow(ctx context.Context, f Flow) (*Flow, error)
	DeleteFlow(ctx context.Context, id string) error
	SetFlowEnabled(ctx context.Context, id string, enabled bool, reason string) error
	SetWebhookTokenHash(ctx context.Context, flowID, tokenHash string) error
	FindFlowByWebhookHash(ctx context.Context, tokenHash string) (*Flow, error)

	CreateRun(ctx context.Context, run Run) error
	UpdateRun(ctx context.Context, run Run) error
	GetRun(ctx context.Context, runID string) (*Run, error)
	ListRuns(ctx context.Context, filter RunFilter) ([]Run, string, error)
	RecordStep(ctx context.Context, step RunStep) (int64, error)
	UpdateStep(ctx context.Context, step RunStep) error
	ListRunSteps(ctx context.Context, runID string) ([]RunStep, error)

	ClaimDueRuns(ctx context.Context, owner string, now time.Time, lease time.Duration, limit int) ([]Run, error)
	CreateWaiter(ctx context.Context, w Waiter) error
	MatchWaiters(ctx context.Context, eventType, correlationKey string, now time.Time) ([]Waiter, error)
	ExpireWaiters(ctx context.Context, now time.Time, limit int) ([]Waiter, error)

	// RecordWindowEvent records one timestamp for logic.window and returns the
	// count of events inside [now-window, now].
	RecordWindowEvent(ctx context.Context, flowID, nodeID, groupKey string, at time.Time, window time.Duration, resetAt int) (count int, reached bool, err error)
	// CheckDedupe records/checks logic.dedupe state and reports whether this key passes.
	CheckDedupe(ctx context.Context, flowID, nodeID, dedupeKey string, at time.Time, cooldown time.Duration, maxPerWindow int) (allowed bool, hits int, err error)

	PruneHistory(ctx context.Context, olderThan time.Time, maxRuns int) (int64, error)
}

Store is the durable persistence contract shared by the Flow runtime and console HTTP API (implemented over SQLite and PostgreSQL using flows/1).

type StoreOption

type StoreOption func(*SQLStore)

StoreOption customizes a SQLStore.

func WithStoreNow

func WithStoreNow(now func() time.Time) StoreOption

WithStoreNow overrides the clock used by SQLStore (defaults to time.Now).

func WithStoreOnChange

func WithStoreOnChange(fn func(flowID string)) StoreOption

WithStoreOnChange registers a callback invoked after a flow definition is saved, deleted, or enabled/disabled.

type SwitchCase

type SwitchCase struct {
	Key       string         `json:"key"`
	Label     string         `json:"label,omitempty"`
	Condition ConditionGroup `json:"condition"`
}

SwitchCase is one named branch in a logic.switch node.

type SwitchNodeConfig

type SwitchNodeConfig struct {
	Cases    []SwitchCase `json:"cases"`
	MatchAll bool         `json:"matchAll,omitempty"`
}

SwitchNodeConfig configures a logic.switch node.

type Template

type Template struct {
	ID           string        `json:"id"`
	Name         string        `json:"name"`
	Description  string        `json:"description"`
	Category     string        `json:"category"`
	Icon         string        `json:"icon,omitempty"`
	NotifyPreset string        `json:"notifyPreset,omitempty"`
	Params       []ParamSchema `json:"params,omitempty"`
	Graph        Graph         `json:"graph"`
	Limits       FlowLimits    `json:"limits,omitempty"`
}

Template is a curated starter flow exposed in the console template gallery.

type TestRunRequest

type TestRunRequest struct {
	FlowID  string          `json:"flowId,omitempty"`
	Graph   *Graph          `json:"graph,omitempty"` // optional unsaved draft override
	DryRun  bool            `json:"dryRun"`
	Event   events.Envelope `json:"event,omitempty"`
	Inputs  map[string]any  `json:"inputs,omitempty"`
	Trigger NodeKind        `json:"trigger,omitempty"`
}

TestRunRequest configures POST /api/flows/{id}/test.

type TestRunResult

type TestRunResult struct {
	Run   Run       `json:"run"`
	Steps []RunStep `json:"steps"`
}

TestRunResult returns the complete trace of a synchronous test run.

type TriggerRegistry

type TriggerRegistry interface {
	Register(spec TriggerSpec) error
	Get(kind NodeKind) (TriggerSpec, bool)
	List() []TriggerSpec
}

TriggerRegistry lists supported trigger node kinds.

type TriggerSpec

type TriggerSpec struct {
	Kind        NodeKind `json:"kind"`
	Label       string   `json:"label"`
	Description string   `json:"description,omitempty"`
	Icon        string   `json:"icon,omitempty"`
}

TriggerSpec describes one trigger node kind for the console palette and validator.

func BuiltinTriggerSpecs

func BuiltinTriggerSpecs() []TriggerSpec

BuiltinTriggerSpecs returns Ether's four built-in trigger descriptors.

type ValidateOptions

type ValidateOptions struct {
	Events   *events.Registry
	Actions  ActionRegistry
	Triggers TriggerRegistry
	MaxNodes int
	MaxEdges int
	MaxBytes int
}

ValidateOptions injects live registries and optional overrides into validation.

type ValidationIssue

type ValidationIssue struct {
	Code    string `json:"code"`
	Path    string `json:"path,omitempty"`
	NodeID  string `json:"nodeId,omitempty"`
	EdgeID  string `json:"edgeId,omitempty"`
	Message string `json:"message"`
}

ValidationIssue is one structured error or warning produced by ValidateGraph/ValidateFlow.

type ValidationResult

type ValidationResult struct {
	Valid    bool              `json:"valid"`
	Errors   []ValidationIssue `json:"errors,omitempty"`
	Warnings []ValidationIssue `json:"warnings,omitempty"`
}

ValidationResult aggregates every error and non-fatal warning for a graph.

func ValidateFlow

func ValidateFlow(f Flow, opts ValidateOptions) ValidationResult

ValidateFlow validates a complete Flow definition including metadata, limits, and graph.

func ValidateGraph

func ValidateGraph(g Graph, opts ValidateOptions) ValidationResult

ValidateGraph statically checks structure, cycles, node configs, handles, templates, condition operators, event schemas, and action schemas.

func (ValidationResult) Error

func (r ValidationResult) Error() string

Error summarizes the first validation error, or empty when Valid.

type WaitEventNodeConfig

type WaitEventNodeConfig struct {
	EventTypes       []string        `json:"eventTypes"`
	MatchCorrelation bool            `json:"matchCorrelation,omitempty"`
	Filter           *ConditionGroup `json:"filter,omitempty"`
	Timeout          string          `json:"timeout"`
}

WaitEventNodeConfig configures a logic.wait_event node ("wait until event or timeout").

type Waiter

type Waiter struct {
	ID             string          `json:"id"`
	RunID          string          `json:"runId"`
	FlowID         string          `json:"flowId"`
	NodeID         string          `json:"nodeId"`
	EventType      string          `json:"eventType"`
	CorrelationKey string          `json:"correlationKey,omitempty"`
	Filter         json.RawMessage `json:"filter,omitempty"`
	TimeoutAt      time.Time       `json:"timeoutAt"`
	CreatedAt      time.Time       `json:"createdAt"`
	Status         string          `json:"status"` // waiting | matched | timed_out | cancelled
}

Waiter is a durable suspension created by a logic.wait_event node.

type WaiterMatchCommit

type WaiterMatchCommit struct {
	WaiterID      string
	RunID         string
	NodeID        string
	MutateContext func(raw json.RawMessage) (json.RawMessage, error)
}

WaiterMatchCommit describes an atomic waiter match + run wake transition.

type WebhookTriggerConfig

type WebhookTriggerConfig struct {
	SecretHeader   string   `json:"secretHeader,omitempty"`
	RequireAuth    bool     `json:"requireAuth,omitempty"`
	AllowedMethods []string `json:"allowedMethods,omitempty"`
}

WebhookTriggerConfig configures a trigger.webhook node.

type WindowNodeConfig

type WindowNodeConfig struct {
	KeyTemplate  string `json:"keyTemplate,omitempty"`
	Threshold    int    `json:"threshold"`
	Window       string `json:"window"`
	ResetOnReach bool   `json:"resetOnReach,omitempty"`
}

WindowNodeConfig configures a logic.window node ("N times in T", per key).

Directories

Path Synopsis
Package actions implements and registers all built-in Flow actions defined in docs/design/flows.md §4.4.
Package actions implements and registers all built-in Flow actions defined in docs/design/flows.md §4.4.
Package templates ships Ether's curated starter Flow templates: the five notification presets plus native power-user recipes (Tautulli & JBOPS parity without external scripts).
Package templates ships Ether's curated starter Flow templates: the five notification presets plus native power-user recipes (Tautulli & JBOPS parity without external scripts).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL