Skip to content

feat: triggers without automation + flyte.run(trigger) to fire on demand - #1535

Merged
cosmicBboy merged 1 commit into
mainfrom
run-trigger
Sep 4, 2026
Merged

feat: triggers without automation + flyte.run(trigger) to fire on demand#1535
cosmicBboy merged 1 commit into
mainfrom
run-trigger

Conversation

@kumare3

@kumare3 kumare3 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Triggers no longer require an automation. A trigger without one is a named launch configuration (inputs, env vars, queue, notifications) that only fires on demand. flyte.run(trigger, ...) fires any deployed trigger from Python, as the trigger, so the run carries its registered config and is recorded as trigger-fired.

import flyte
import flyte.notify
import flyte.remote
from flyte.models import ActionPhase

env = flyte.TaskEnvironment(name="reports")

# No automation: nothing schedules this, it is fired on demand.
full_report = flyte.Trigger(
    name="full-report",
    inputs={"region": "all", "days": 30},
    env_vars={"REPORT_VERBOSE": "1"},
    notifications=flyte.notify.Email(on_phase=ActionPhase.SUCCEEDED, recipients=("me@example.com",)),
)

@env.task(triggers=(full_report,))
async def report(region: str = "all", days: int = 7) -> str:
    return f"report for {region!r} over {days} day(s)"

# Fire it programmatically, with the trigger's inputs / env vars / notifications.
trigger = flyte.remote.Trigger.get(name="full-report", task_name=report.name)
run = flyte.run(trigger)            # region="all", days=30
run = flyte.run(trigger, days=3)    # override one input, keep the rest

Also: flyte create trigger no longer requires --schedule. Examples in examples/triggers/manual.py and examples/triggers/programmatic.py.

- Trigger.automation is optional; a trigger with no automation serializes as
  TYPE_NONE and is a named launch configuration fired only on demand.
- flyte.run(trigger, **overrides) fires a deployed trigger as the trigger
  (CreateRunRequest.trigger_name) with its registered inputs, env vars, queue
  and notification rules; keyword args override individual inputs.
- flyte create trigger no longer requires --schedule.
- examples/triggers/manual.py and programmatic.py.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012RDaPuYm8oyFK8Ppuj874v
Signed-off-by: Ketan Umare <kumare3@users.noreply.github.com>
@cosmicBboy
cosmicBboy merged commit 9a98ecf into main Sep 4, 2026
63 checks passed
@cosmicBboy
cosmicBboy deleted the run-trigger branch September 4, 2026 17:01
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.

2 participants