mirror of
https://github.com/langgenius/dify.git
synced 2026-05-09 21:28:25 +08:00
Co-authored-by: jyong <718720800@qq.com> Co-authored-by: Yansong Zhang <916125788@qq.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: hj24 <mambahj24@gmail.com> Co-authored-by: hj24 <huangjian@dify.ai> Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Co-authored-by: CodingOnStar <hanxujiang@dify.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
22 lines
845 B
Python
22 lines
845 B
Python
"""Shared snippet virtual Start-node identifiers and compatibility helpers.
|
|
|
|
Snippet workflows do not persist a real canvas Start node, so the backend
|
|
injects one at runtime. Existing workflow references commonly use the public
|
|
selector shape ``#start.<var>#``; keep that contract stable by treating the
|
|
runtime-only snippet Start node as compatible with the legacy ``start`` id.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
LEGACY_START_NODE_ID = "start"
|
|
SNIPPET_VIRTUAL_START_NODE_ID = "__snippet_virtual_start__"
|
|
|
|
|
|
def get_compatible_start_aliases(*, workflow_kind: str | None, root_node_id: str | None) -> tuple[str, ...]:
|
|
"""Return additional selector ids that should mirror snippet Start inputs."""
|
|
if workflow_kind == "snippet" and root_node_id == SNIPPET_VIRTUAL_START_NODE_ID:
|
|
return (LEGACY_START_NODE_ID,)
|
|
|
|
return ()
|