-
Notifications
You must be signed in to change notification settings - Fork 18
[APO-2321] Make entrypoint node optional in Python SDK serialization #3346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@codex review |
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @dataclass | ||
| class WorkflowMetaDisplay: | ||
| entrypoint_node_id: UUID | ||
| entrypoint_node_source_handle_id: UUID | ||
| entrypoint_node_display: NodeDisplayData = Field(default_factory=NodeDisplayData) | ||
| entrypoint_node_id: Optional[UUID] = None | ||
| entrypoint_node_source_handle_id: Optional[UUID] = None | ||
| entrypoint_node_display: Optional[NodeDisplayData] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backfill entrypoint defaults when overrides omit IDs
The entrypoint metadata on WorkflowMetaDisplay is now optional (lines 52‑54), but _generate_workflow_meta_display still copies user overrides verbatim while serialize() only builds an ENTRYPOINT node when both IDs are set (base_workflow_display.py:299‑305). For a triggerless workflow that overrides only the viewport, e.g. workflow_display = WorkflowMetaDisplay(display_data=…), the IDs default to None, the guard skips node creation, and the serialized workflow ends up missing the required ENTRYPOINT node. This newly breaks serialization for workflows without triggers whenever partial overrides are supplied.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks legit
530f9c0 to
6937d60
Compare
| @dataclass | ||
| class WorkflowMetaDisplay: | ||
| entrypoint_node_id: UUID | ||
| entrypoint_node_source_handle_id: UUID | ||
| entrypoint_node_display: NodeDisplayData = Field(default_factory=NodeDisplayData) | ||
| entrypoint_node_id: Optional[UUID] = None | ||
| entrypoint_node_source_handle_id: Optional[UUID] = None | ||
| entrypoint_node_display: Optional[NodeDisplayData] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks legit
…y workflows - Backfill entrypoint IDs in _generate_workflow_meta_display when overrides omit them - Skip ENTRYPOINT node when all graph branches are sourced from triggers - Update tests to match new spec for IntegrationTrigger-only workflows Co-Authored-By: [email protected] <[email protected]>
2e3aa2f to
6d159a3
Compare
Co-Authored-By: [email protected] <[email protected]>
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
vellum-python-sdks/ee/vellum_ee/workflows/display/workflows/base_workflow_display.py
Lines 499 to 503 in 2f157d9
| trigger_edge_dict: Dict[str, Json] = { | |
| "id": str(stable_edge_id) if stable_edge_id else str(target_entrypoint_display.edge_display.id), | |
| "source_node_id": str(source_node_id), | |
| "source_handle_id": str(source_handle_id), | |
| "target_node_id": str(target_node_display.node_id), |
When all branches are trigger-sourced the ENTRYPOINT node is skipped, but trigger edges still fall back to target_entrypoint_display.edge_display.id when no metadata mapping exists. That edge display ID is generated once per target node (using the workflow display’s entrypoint UUID), so multiple non-manual triggers feeding the same node will serialize distinct edges with identical id values (e.g., two IntegrationTriggers pointing at one process node). Clients typically treat edge IDs as unique keys, so these duplicates can collapse edges or hide triggers whenever metadata.json lacks explicit IDs.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Summary
Makes the ENTRYPOINT node optional in workflow serialization. When all graph branches originate from triggers (IntegrationTrigger/ScheduleTrigger), no ENTRYPOINT node is created. For triggerless workflows with partial
WorkflowMetaDisplayoverrides (e.g., onlydisplay_dataset), the backfill logic in_generate_workflow_meta_displayensures proper entrypoint IDs are generated by merging overrides with defaults.Also fixes duplicate edge IDs when multiple non-manual triggers target the same node - each trigger edge now gets a unique deterministic ID based on
workflow_id|trigger_edge|trigger_id|target_node_id.This is the Python SDK counterpart to the codegen changes in #3345.
Review & Testing Checklist for Human
simple_manual_trigger_workflow)WorkflowMetaDisplayoverrides (onlydisplay_dataset) still create ENTRYPOINT nodes with valid IDsvellum pushon workflows with triggersTest Plan:
WorkflowMetaDisplay(display_data=...)- verify ENTRYPOINT node existsNotes
test_partial_workflow_meta_display_override.py,test_two_integration_triggers_same_node_unique_edge_ids