Skip to content

fix(platform): let a scheduled pack start from its own trigger - #3381

Merged
Israeltheminer merged 1 commit into
mainfrom
fix/scheduled-pack-trigger-inputs
Sep 15, 2026
Merged

Israeltheminer merged 1 commit into
mainfrom
fix/scheduled-pack-trigger-inputs

Conversation

@Israeltheminer

Copy link
Copy Markdown
Contributor

Closes #3377.

Every shipped pack that ships a schedule can start again. Since v0.5.17 each occurrence was refused before a run row existed, so no scheduled automation has run on any install on that release or later.

Why

The scheduler starts a run with the trigger wrapper, not bare workflow input:

Trigger Input Source
schedule { trigger: 'schedule', firedAt } triggers.ts:254
event { trigger: 'event', event, payload } triggers.ts:343
webhook { trigger: 'webhook', payload } triggers.ts:482

beginRunInTx validates that against the deployed version's inputs schema. All eight packs declared additionalProperties: false without trigger or firedAt, so the refusal was certain and permanent.

The wrapper is the documented contract — develop/webhooks states that a declared input schema must describe it — so the packs were wrong, not the validation.

What changed

  • The eight packs declare trigger and firedAt.
  • packs.test.ts gains a guard: a pack shipping a schedule must not close its inputs against the wrapper.
  • automations/builtin no longer presents the refusal as expected GitHub behaviour.
  • automations/triggers showed firedAt: "…", but the scheduler sends epoch-ms (triggers.ts:205). An author following that table would declare type: string and reintroduce the refusal as a type error.

Risk

The guard is deliberately narrow. It asserts only that the wrapper is not rejected as an unknown property, so the GitHub packs still refuse a scheduled start for the owner and repo they require. That refusal is an authoring choice and this does not change it; being closed against the wrapper is not a choice, it is the pack forbidding the only start its own trigger can perform.

The German and French doc edits follow CONVENTIONS.md — nonbreaking space before the French colon, typographic apostrophe, code literals identical across locales. Worth knowing when reviewing: the docs prose suite currently pins nearly every style check to report, including style-nbsp and style-apostrophes, so a green run is not evidence for those. These files produce no findings in either mode, which is the strongest signal the tooling offers.

Tests

packs.test.ts fails on all eight packs without the schema change, with expected [ 'trigger', 'firedAt' ] to deeply equal []. Suites: 60 automations tests, 22 docs prose tests, oxlint and oxfmt clean.

Scope

Fixes the shipped packs only. It does not reach an existing install: seedDefaultAutomationPacks skips any automation the organization already has (provisioning/service.ts:88), so an upgraded instance keeps its refused version and needs a schema edit and a newly deployed version. #3377 should not be closed on the strength of this alone.

Independent of #3376 — an install that takes both still ingests no email until that one lands too.

Every shipped pack that ships a schedule has been refused at start since
v0.5.17. The scheduler wraps a run input as `{ trigger, firedAt }`, and all
eight packs declared `additionalProperties: false` without those fields, so
each occurrence was refused before a run row existed. The trigger recorded
`start_refused` and nothing else surfaced.

The wrapper is the documented contract — `develop/webhooks` says a declared
input schema must describe it — so the packs are what was wrong, not the
validation. Each now declares `trigger` and `firedAt`.

A guard in packs.test.ts asserts that a pack shipping a schedule does not
close its inputs against the wrapper. It stays narrow on purpose: the GitHub
packs may still refuse a scheduled start for the `owner` and `repo` they
require, which is an authoring choice, while being closed against the wrapper
is the pack forbidding the only start its own trigger can perform.

Two documentation fixes follow from it. `automations/builtin` presented the
refusal as expected behaviour for the GitHub packs. `automations/triggers`
showed `firedAt` as a string when the scheduler sends epoch-ms, so an author
following the table would declare `type: string` and reintroduce the refusal
as a type error.
@Israeltheminer
Israeltheminer merged commit cce2532 into main Sep 15, 2026
56 checks passed
@Israeltheminer
Israeltheminer deleted the fix/scheduled-pack-trigger-inputs branch September 15, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Every shipped scheduled automation is refused at start since v0.5.17

1 participant