Skip to main content
A trigger policy decides when a node fires. It can be set on the CLI via --policy SPEC (on node create and node modify) or in source via a #[cerulion_node(...)] attribute. Trigger policy lives only on the macro side; graph YAML carries no policy block.

--policy SPEC grammar

Accepted forms:
There is no default policy keyword β€” --policy default errors with β€œunknown policy spec”. A 100 ms period must be written --policy period_ms=100.
There is no deadline_ms policy spec β€” --policy deadline_ms=N errors with β€œunknown policy spec deadline_ms”. To watch for late data on a trigger input, use #[input(trigger, expect_within_ms = N)] in your node source.

Macro-attribute equivalents

Each --policy SPEC has an equivalent #[cerulion_node(...)] attribute. See Node macro reference for full attribute semantics. The unbounded_sync, tick_within_ms = N, and throttle_ms = N attributes have no --policy SPEC equivalent; they are macro-only.

Defaulting matrix

When --policy is omitted, node create resolves the policy from the declared inputs (resolve_create_policy):
The engine convenience wrapper node_cmd::node_create (used by tests/TUI scaffolding) supplies Period { period_ms: 100 } when called with policy = None. The CLI path uses the strict node_create_with_options, which enforces the 0-inputs-error rule. The β€œ100 ms default” is a convenience-API behavior, not the CLI default.

Policy short labels

node list and node info print a short policy label via format_policy_short: