Skip to content

Conversation

@MTarek165
Copy link
Contributor

@MTarek165 MTarek165 commented Jan 1, 2026

closes #13807

Problem

  • When trigger starts evaluation a new execution created at SchedulableExecutionFactory where rendering inputs occur there but since pebble engine needs to resolve labels keys sent and they are missing in Run Variables, an IllegalVariableEvaluationException occur
  • In trigger evaluation phase no execution is created yet so labels wasn't loaded yet as a Run variable into run context so pebble engine can't recognize it

Solution

  • Labels must be loaded earlier at evaluation phase before rendering inputs to avoid this issue
  • Instead of adding them to SchedulableExecutionFactory which is late , RunContextInitializer is suitable for adding all labels in case of scheduled trigger since in this place we attach variables to scheduled run context
  • Then at SchedulableExecutionFactory read labels from run context and attach them to execution and then when rendering inputs it would find them at run context without need to load from execution at the first time

Testing

  • Create schedule evaluation test passing inputs from trigger having labels, labels should be resolved correctly by the pebble engine giving created execution with all labels types passed

Notes

  • I found that the same problem occur with other label types such as system labels, trigger labels and backfill labels for the same reason, now the fix covers all labels

@MilosPaunovic MilosPaunovic added area/backend Needs backend code changes kind/external Pull requests raised by community contributors labels Jan 2, 2026
- inject all labels earlier than ScheduledExecutionFactory which is useful for input rendering using labels
- flow labels and system.from label should be added earlier at RunVariables
- trigger, backfill and system.correlationId would be postponed a little bit into RunContextInitializer for rendering and triggerExecutionId existence
- resolved labels from run context should be the same attached to execution at ScheduledExecutionFactory
@MTarek165
Copy link
Contributor Author

@loicmathieu I wonder also if we can create new run context of new execution after adding labels and use it for rendering inputs, this is a simpler fix but I feel that it is not clean as there is no way to inject RunContextFactory into ScheduledExecutionFactory without making some undesired changes in evaluate() method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/backend Needs backend code changes kind/external Pull requests raised by community contributors

Projects

Status: To review

Development

Successfully merging this pull request may close these issues.

IllegalVariableEvaluationException thrown when labels are referenced within triggers

2 participants