mirror of
https://github.com/run-llama/workflows-py.git
synced 2026-07-21 04:05:25 -04:00
[Bug]: WorkflowValidationError: "Step signature must have at least one parameter annotated as type Event" Despite Proper Event Annotations #8
Closed
opened 2026-02-16 02:16:03 -05:00 by yindo
·
5 comments
No Branch/Tag Specified
main
update-debugger-assets
changeset-release/main
adrianbot/mlflow-workflow-tracing-tests
adrianbot/child-workflows-recursive
adrianbot/cw-stack-3-alive-timeout
adrianbot/cw-stack-1-broker-tree
adrian/child-workflows-slim
adrian/llamactl-organizations-use
adrianbot/mlflow-dbos-e2e
adrian/child-workflows-runtime-compat
adrian/child-workflows-durable
adrian/child-workflows
adrian/child-workflow-prep-refactors
adrian/child-workflows-page
adrian/child-workflows-docs
adrian/fan-out-fan-in-l0
claude/centralize-instance-checks-y7ogi1
adrian/fan-out-async-iterator
adrianbot/statedb-go-binary
adrian/workflow-pressure-diagnostics
chore/fix-lint-594
adrian/llamactl-get-split
claude/simplify-mapreduce-syntax-2CPyP
claude/setup-python-311-env-3BfmE
claude/plan-operator-namespace-jzsmq
vasu/retryable_exceptions
chore/fix-lint-525
logan/error-handling
claude/fix-handler-idle-state-SCxQj
claude/organize-examples-KJFTa
clelia/agentcore-memory
adrian/issue-404
changeset-release/dev
adrian/multi-result
claude/fix-database-locked-tests-d2yrv
quickstart
claude/slack-feedback-notification-PehCn
claude/add-durable-workflow-example-YnY23
claude/add-runtime-decorator-abstractions-UJNsv
adrian/mcp
chore/fix-lint-330
adrian/server-decorator
chore/fix-lint-323
claude/test-precommit-fix-sACsb
adrian/store-interface
claude/resolve-package-conflicts-dV32a
claude/add-dbos-test-suite-v0yfb
adrian/wf-registry
claude/relative-workflow-paths-RGVg8
claude/refactor-workflows-server-package-hqICG
claude/release-idle-workflows-VaCpR
logan/child_workflows
logan/building_blocks
adrian/handler-id-quote-issue-53e3
cursor/LI-4612-implement-dedicated-stop-event-subtypes-for-failures-86ee
adrian/test-ctx
cursor/LI-4463-implement-lazy-file-reference-system-b1b3
copilot/sub-pr-202
cursor/LI-3952-generate-workflow-server-reference-docs-0107
cursor/LI-4105-update-wait-for-event-documentation-3bdd
clelia/golden-examples
cursor/LI-3867-refactor-event-api-for-consistency-and-flexibility-dc87
logan/attach_sequence_number_to_events
logan/handler_metadata
adrian/version-bump
cursor/LI-3715-stop-workflow-handler-and-cancel-tasks-807e
cursor/LI-3710-prevent-workflow-server-crash-on-invalid-reload-3421
cursor/LI-3716-filter-internal-events-in-workflow-consumer-eb17
massi/api-reference
clelia/gather-in-step-decorator
v1.3.1
logan/typed_state_poc
llama-agents-server@v0.6.4
llama-agents-server@0.6.4
llama-agents@0.12.5
llama-agents-control-plane@0.12.3
llama-agents-server@0.6.3
llama-agents-server@v0.6.3
llama-index-workflows@2.22.2
llama-agents-client@0.3.11
llama-agents-server@v0.6.2
llama-agents-client@0.3.10
llama-index-workflows@2.22.1
llama-agents-server@0.6.2
llama-agents-dbos@0.4.1
llama-agents-server@v0.6.1
llama-index-workflows@2.22.0
llama-agents-client@0.3.9
llama-agents-server@0.6.1
llama-index-utils-workflow@0.11.0
llamactl@0.10.3
llama-agents-server@0.6.0
llama-index-workflows@2.21.0
llama-agents-dbos@0.4.0
llama-agents-server@v0.6.0
llama-agents-appserver@0.11.5
llama-agents-agentcore@0.9.4
llama-agents@0.12.4
llama-agents-client@0.3.8
llamactl@0.10.2
llamactl@0.10.1
llamactl@0.10.0
llama-agents-control-plane@0.12.2
llama-agents-appserver@0.11.4
llama-agents@0.12.3
llama-agents-agentcore@0.9.3
llama-agents-core@0.10.2
llama-agents-dbos@0.3.1
llama-agents-dbos@0.3.0
llamactl@0.9.1
llama-agents-server@0.5.0
llama-agents-core@0.10.1
llamactl@0.9.0
llama-agents-control-plane@0.12.1
llama-agents-appserver@0.11.3
llama-agents-agentcore@0.9.2
llama-agents-server@v0.5.0
llama-agents@0.12.2
llama-agents-dbos@0.2.3
llama-agents@0.12.1
llama-agents-appserver@0.11.2
llama-agents-core@0.10.0
llama-agents-agentcore@0.9.1
llamactl@0.8.0
llama-agents-control-plane@0.12.0
llamactl@0.7.3
llama-index-workflows@2.20.0
llama-agents@0.12.0
llama-agents-server@v0.4.7
llama-agents-server@0.4.7
llama-agents-client@0.3.7
llamactl@0.7.2
llama-index-workflows@2.19.1
llama-agents-client@0.3.6
llama-agents-agentcore@0.9.0
llama-agents-appserver@0.11.1
llama-agents-server@v0.4.6
llama-agents-dbos@0.2.2
llama-agents-server@0.4.6
llama-agents@0.11.1
llama-agents-appserver@0.11.0
llama-agents-control-plane@0.11.1
llama-agents-agentcore@0.8.19
llamactl@0.7.1
llama-agents@0.11.0
llama-agents-operator@0.11.1
llama-agents-agentcore@0.8.18
llama-agents-crds@0.7.2
llama-agents@0.10.12
llama-agents-server@v0.4.5
llama-agents-client@0.3.5
llama-agents-server@0.4.5
llama-index-workflows@2.19.0
llamactl@0.7.0
llama-agents-core@0.9.0
llama-agents-appserver@0.10.5
llama-agents-server@0.4.4
llama-agents-control-plane@0.11.0
llama-agents-client@0.3.4
llama-index-workflows@2.18.0
llama-agents@0.10.11
llama-agents-agentcore@0.8.17
llama-agents-server@v0.4.4
llama-agents-agentcore@0.8.16
llama-agents-agentcore@0.8.15
llama-agents-server@0.4.3
llama-agents-server@v0.4.3
llama-agents-core@0.8.5
llamactl@0.6.9
llama-agents-control-plane@0.10.5
llama-agents-appserver@0.10.4
llama-agents-agentcore@0.8.14
llama-agents@0.10.10
llama-agents-server@0.4.2
llama-agents-agentcore@0.8.13
llama-agents-server@v0.4.2
llama-agents-appserver@0.10.3
llamactl@0.6.8
llama-agents@0.10.9
llama-agents-agentcore@0.8.12
llama-agents@0.10.8
llamactl@0.6.7
llama-agents-control-plane@0.10.4
llama-agents-agentcore@0.8.11
llama-agents-server@0.4.1
llama-agents-server@v0.4.1
llama-agents-agentcore@0.8.10
llama-agents-agentcore@0.8.9
llama-agents-agentcore@0.8.8
llama-index-workflows@2.17.3
llama-agents-server@0.4.0
llama-agents-client@0.3.3
llama-index-workflows@2.17.2
llama-agents-server@0.3.3
llama-agents-client@0.3.2
llama-agents-server@v0.3.2
llama-agents-server@0.3.2
llama-agents-dbos@0.2.1
llama-index-workflows@2.17.1
llama-agents-server@0.3.1
llama-agents-server@v0.3.1
llama-index-utils-workflow@0.10.1
llama-agents-client@0.3.1
llama-index-utils-workflow@0.10.0
llama-agents-dbos@0.2.0
llama-agents-client@0.3.0
llama-agents-server@v0.3.0
llama-agents-server@0.3.0
llama-index-workflows@2.17.0
llama-agents-server@v0.2.3
llama-agents-server@0.2.3
llama-agents-client@0.2.3
llama-index-workflows@2.16.1
llama-index-workflows@2.16.0
llama-index-utils-workflow@0.9.5
llama-agents-dbos@0.1.2
llama-agents-server@v0.2.2
llama-agents-client@0.2.2
llama-agents-server@0.2.2
llama-index-workflows@2.15.1
llama-agents-client@0.2.1
llama-agents-server@0.2.1
llama-agents-dbos@0.1.1
llama-index-utils-workflow@0.9.4
llama-agents-server@v0.2.1
llama-index-utils-workflow@0.9.3
llama-index-workflows@2.15.0
llama-agents-dbos@0.1.0
llama-agents-server@v0.2.0
llama-agents-server@0.2.0
llama-agents-client@0.2.0
llama-index-workflows@2.15.0-rc.1
llama-agents-client@0.2.0-rc.1
llama-index-utils-workflow@0.9.3-rc.1
llama-agents-server@0.2.0-rc.3
llama-agents-dbos@0.1.0-rc.1
llama-agents-server@0.1.3
llama-index-utils-workflow@0.9.2
llama-agents-server@v0.1.3
llama-agents-client@0.1.3
llama-index-workflows@2.14.2
llama-agents-server@0.2.0-rc.2
llama-agents-dbos@0.1.0-rc.0
llama-agents-server@0.2.0-rc.1
llama-agents-client@0.2.0-rc.0
llama-index-utils-workflow@0.9.2-rc.0
llama-index-workflows@2.15.0-rc.0
llama-agents-server@0.2.0-rc.0
llama-agents-server@v0.2.0-rc.0
llama-agents-client@0.1.2
llama-index-utils-workflow@0.9.1
llama-index-workflows@2.14.1
llama-agents-server@v0.1.2
llama-agents-server@0.1.2
llama-agents-server@v0.1.1
llama-index-utils-workflow@0.9.0
llama-agents-client@0.1.1
llama-agents-server@0.1.1
llama-index-workflows@2.14.0
llama-index-workflows@2.13.1
llama-index-workflows@v2.13.1
llama-index-workflows@2.13.0
llama-index-utils-workflow@0.8.0
llama-index-workflows@v2.13.0
llama-index-workflows@2.12.2
llama-index-workflows@v2.12.2
llama-index-utils-workflow@0.7.1
llama-index-workflows@v2.12.1
llama-index-workflows@2.12.1
llama-index-workflows@2.12.0
llama-index-utils-workflow@0.7.0
llama-index-workflows@v2.12.0
llama-index-utils-workflow@0.6.0
llama-index-workflows@v2.11.7
llama-index-workflows@2.11.7
llama-index-workflows@v2.11.6
llama-index-workflows@2.11.6
llama-index-utils-workflow@0.5.2
llama-index-workflows@2.11.5
llama-index-workflows@v2.11.5
llama-index-workflows@v2.11.4
llama-index-workflows@2.11.4
llama-index-utils-workflow@0.5.1
llama-index-workflows@2.11.3
llama-index-workflows@v2.11.3
llama-index-workflows@2.11.2
llama-index-utils-workflow@0.5.0
llama-index-workflows@v2.11.2
llama-index-workflows@v2.11.1
v2.11.1
v2.11.0
v2.10.3
v2.10.2
v2.10.1
v2.10.0
v2.9.1
v2.9.0
llama-index-utils-workflow@v0.5.0
v2.8.3
v2.8.2
v2.8.1
v2.8.0
v2.7.1
v2.7.0
v2.6.0
v2.5.0
v2.4.0
v2.3.0
v2.2.2
v2.2.1
v2.2.0
v2.1.0
v2.0.1
v2.0.0
v1.3.0
v1.2.0
v1.1.0
v1.0.1
v1.0.0
v0.2.2
v0.2.1
v0.2.0
v0.1.0
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: run-llama/workflows-py#8
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AnandUgale on GitHub (Jul 29, 2025).
Bug Description
I'm encountering a persistent WorkflowValidationError when defining a custom Workflow class in LlamaIndex. The error occurs during class definition when using the @step decorator on methods that accept custom Event subclasses as parameters. The validation complains that the step signature must have at least one parameter annotated as type Event, even though the parameters are correctly annotated with custom Events that inherit from Event.
This seems to happen regardless of whether I use Pydantic *Field *for event attributes or not. I've tried multiple variations based on the documentation and examples (e.g., ReAct agent workflow and Text-to-SQL workflow), but the issue persists.
Version
Steps to Reproduce
Relevant Logs/Tracbacks
@dosubot[bot] commented on GitHub (Jul 29, 2025):
This error is almost always caused by one of these issues: inconsistent imports of the Event base class (e.g., importing Event from different modules in your code and the framework), missing or incorrect type annotations on your step parameters, or a version limitation in LlamaIndex 0.12.14.
For your version, here’s what you need to check:
Here’s a minimal working pattern for step signatures in 0.12.x:
If you follow this pattern and still see the error, double-check that there are no duplicate Event definitions (e.g., from different llama_index modules or local copies) and that all type annotations are present and correct. If you need custom StopEvents, you’ll need to upgrade to llama-index-core 0.12.21 or later (see details).
Let me know if you want a more detailed example or want to troubleshoot a specific step signature!
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@AnandUgale commented on GitHub (Jul 29, 2025):
@dosu , I tried with minimal working pattern for step signatures in 0.12.x:, but still getting same error -
error -
code -
@dosubot[bot] commented on GitHub (Jul 29, 2025):
This error almost always means there’s an import mismatch or multiple versions of llama_index installed, causing the Event class in your code to differ from the one used by the framework’s validator—even if the code “looks” right. The validator checks the actual class object, not just the name or inheritance chain, so any difference in import path or environment will break it.
Here’s how to troubleshoot:
Check for multiple installs: Run
pip list | findstr llama(Windows) orpip list | grep llama(Linux/macOS) and make sure you only have one version of each llama_index package. Also check for stray copies or editable installs.Print Event class info: Add this to your script before defining your workflow:
Do the same for any Event import in your custom event classes, and compare. If the
idor__module__differs, you have an import mismatch.PYTHONPATH and shadowing: Make sure there are no local files or folders named
llama_indexorworkflowin your project directory that could shadow the installed package.Custom StopEvent: In 0.12.14, you cannot use custom StopEvent subclasses—only the built-in StopEvent is supported. If you need custom stop events, upgrade to llama-index-core >= 0.12.21 (see details).
If you find multiple versions or mismatched imports, uninstall all llama_index packages, delete any local copies, and reinstall a single version. This should resolve the validation error. The strictness of the validator is by design and is confirmed by the test suite and source code—matching import paths and class objects is required for step signature validation to pass.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@ZeyadAttia5 commented on GitHub (Jan 1, 2026):
This bug was already fixed in this repo
Root cause: When using
from __future__ import annotations, Python stores annotations as strings (postponed evaluation). The original validation code usedparam.annotationdirectly, which returned a string like"StartEvent"instead of the actual class. Theissubclass()check then failed becauseissubclass("StartEvent", Event)is invalid.Fix: Commit
e6bdef2(March 27, 2025) — PR #18225 "support postponed type hints in step signatures"The fix uses
get_type_hints(fn)to resolve string annotations into actual types before validation.Why you're still seeing this
Your traceback shows you're using
llama_index.core.workflow— the workflow module bundled withllama-index-core==0.12.14. This bundled version lags behind the standalonellama-index-workflowspackage and likely doesn't include this fix.Solution
Then change your imports:
I've verified that the current workflows-py package handles your exact scenario correctly (custom Event subclasses, Union return types, and from future import annotations).
This issue can likely be closed. If you need the fix in the bundled llama_index.core.workflow, that would need to be tracked in run-llama/llama_index.
@adrianlyjak commented on GitHub (Jan 7, 2026):
@AnandUgale if you're still seeing issues on the latest version of llama-index-workflows, feel free to re-open