Skip to content

Evaluate expressions before executing activities - #483

Draft
mrsimonemms wants to merge 1 commit into
mainfrom
sje/input-expression-evaluation
Draft

Evaluate expressions before executing activities#483
mrsimonemms wants to merge 1 commit into
mainfrom
sje/input-expression-evaluation

Conversation

@mrsimonemms

Copy link
Copy Markdown
Collaborator

Description

Related issue

Fixes #462

How to test

Checklist

  • This PR links to an issue using Fixes #..., Closes #... or Relates to #...
  • All tests pass
  • Tests have been added or updated where behaviour changed
  • Documentation has been updated where needed

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

🚀 Preview deployed
🔗 https://zigflow.dev/preview/sje-input-expression-evaluation

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codex PR Review

Medium: activity-state expressions can be evaluated too early

ExpressionReferencesActivityState only preserves direct $data.activity access where activity is the first suffix on $data. Equivalent jq forms such as ${ $data | .activity.attempt } or ${ $data as $d | $d.activity.attempt } are not detected, so ResolveActivityInput evaluates them workflow-side before AddActivityInfo exists. That turns the value into null instead of preserving it for activity-side evaluation. This is a correctness regression for HTTP with payloads that previously evaluated inside the activity.
activity_expressions.go, runtime_expressions.go

Concrete fix: broaden the preservation analysis to cover jq data-flow forms that derive from $data, or fail closed for any expression where $data is piped or aliased before an activity lookup. Add regression tests for pipeline and alias forms.

I could not run tests because the sandbox is read-only and Go could not create its module cache.

@mrsimonemms
mrsimonemms force-pushed the sje/input-expression-evaluation branch from a54b9f7 to 9e4685a Compare June 16, 2026 14:43
Signed-off-by: Simon Emms <simon@simonemms.com>
@mrsimonemms
mrsimonemms force-pushed the sje/input-expression-evaluation branch from 9e4685a to c523de7 Compare June 27, 2026 14:31
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.

Activity inputs should be expression-evaluated before scheduling activities

1 participant