Add validation to raise error when ChatMessageTrigger and entrypoint are both present #3448
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds validation to raise an error when serializing a workflow that has both a ChatMessageTrigger and an entrypoint node, since they are mutually exclusive.
Summary
CHAT_MESSAGEtoWorkflowTriggerTypeenumserialize()that raisesWorkflowValidationErrorwhen both ChatMessageTrigger and entrypoint nodes are present_serialize_workflow_trigger()to recognize it as a valid trigger typeReview & Testing Checklist for Human
has_chat_message_trigger and needs_entrypoint_node) correctly captures the mutual exclusivity requirement -needs_entrypoint_nodeis true when there's a ManualTrigger, no triggers at all, or non-trigger entrypoint nodes existNotes
The second test (
test_chat_message_trigger_without_entrypoint_does_not_raise_mutual_exclusivity_error) catches aValueErrorand passes - this is due to a pre-existing limitation whereChatMessageTrigger.messageattribute has a complex union type that can't be serialized byprimitive_type_to_vellum_variable_type. The test still validates that the mutual exclusivity error is not raised for valid ChatMessageTrigger-only workflows.