<#7684 [V2][BUG] Pass trigger envvar into task pod...
# flyte-github
a
#7684 [V2][BUG] Pass trigger envvar into task pod Pull request opened by popojk Tracking issue Closes #7676 Why are the changes needed? We should pass trigger's env var into task pods while running What changes were proposed in this pull request? Fix run service code How was this patch tested? Test with this script
Copy code
import os
import flyte

env = flyte.TaskEnvironment("envdump", env_vars={"FROM_TASK_SPEC": "1"})


@env.task(
    triggers=flyte.Trigger(
        "envdump-minutely", automation=flyte.Cron("* * * * *"), env_vars={"FROM_TRIGGER": "1"}
    )
)
async def dump() -> str:
    return repr({k: v for k, v in os.environ.items() if k.startswith("FROM_TRIGGER")})

if __name__ == "__main__":
    flyte.init_from_config()
    flyte.deploy(env)
After the fix, we can see the trigger's env var now. Screenshot 2026-07-21 at 10 57 00 AM Labels Please add one or more of the following labels to categorize your PR: • added: For new features. • changed: For changes in existing functionality. • deprecated: For soon-to-be-removed features. • removed: For features being removed. • fixed: For any bug fixed. • security: In case of vulnerabilities This is important to improve the readability of release notes. Setup process Screenshots Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. Related PRs Stack If you do use
git town
to manage PR Stacks, the stack relevant to this PR will show below. Otherwise, you can ignore this section. Docs link flyteorg/flyte