Problem statement
Happier automations currently require a cron or interval schedule, so an automation cannot be armed solely for an external condition or event.
Examples include a remote machine becoming reachable, a CI job completing, a home-automation event, or a one-off scheduler deciding that a task is ready to run. This affects self-hosted users and integrations where condition evaluation intentionally belongs outside Happier.
Today these users must either configure an artificial schedule or bypass Automations and send a message directly to a session, leaving the trigger definition outside Happier and losing the first-class automation lifecycle: machine assignment, durable AutomationRun state, run history, and occurrence-level idempotency.
Proposed solution
Separate triggering from execution by allowing an automation with no automatic cron or interval schedule, for example through an external or manual trigger kind.
Provide a supported authenticated API and/or CLI operation that creates an immediate AutomationRun for such an automation. The request should accept a caller-provided occurrence ID or idempotency key so that an ambiguous request can be retried safely.
The run should use the existing automation pipeline: assignments, daemon claiming and leases, offline recovery, encrypted templates, existing/new session targets, and run history. The external system would decide whether its condition is true; Happier would only receive the signal that one occurrence is ready.
The existing run-now operation could be extended or a separate trigger operation could be introduced.
Acceptance criteria
Non-goals (optional)
- Building an arbitrary condition engine or trigger-provider plugin system inside Happier.
- Accepting arbitrary event payloads or overriding the stored automation template per occurrence.
- Adding an unauthenticated public webhook endpoint.
Priority (optional)
P3
Additional context (optional)
Problem statement
Happier automations currently require a cron or interval schedule, so an automation cannot be armed solely for an external condition or event.
Examples include a remote machine becoming reachable, a CI job completing, a home-automation event, or a one-off scheduler deciding that a task is ready to run. This affects self-hosted users and integrations where condition evaluation intentionally belongs outside Happier.
Today these users must either configure an artificial schedule or bypass Automations and send a message directly to a session, leaving the trigger definition outside Happier and losing the first-class automation lifecycle: machine assignment, durable
AutomationRunstate, run history, and occurrence-level idempotency.Proposed solution
Separate triggering from execution by allowing an automation with no automatic cron or interval schedule, for example through an
externalormanualtrigger kind.Provide a supported authenticated API and/or CLI operation that creates an immediate
AutomationRunfor such an automation. The request should accept a caller-provided occurrence ID or idempotency key so that an ambiguous request can be retried safely.The run should use the existing automation pipeline: assignments, daemon claiming and leases, offline recovery, encrypted templates, existing/new session targets, and run history. The external system would decide whether its condition is true; Happier would only receive the signal that one occurrence is ready.
The existing
run-nowoperation could be extended or a separate trigger operation could be introduced.Acceptance criteria
AutomationRunfor it.Non-goals (optional)
Priority (optional)
P3
Additional context (optional)
automationValidation.ts.registerAutomationCrudRoutes.ts.