Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
feat: add draft trigger detection to app model and UI (#28163)
zhsamab86022c64ad1
diff --git a/api/controllers/console/app/app.py b/api/controllers/console/app/app.pyindex 037f13d2972..0724a6355df 100644--- a/api/controllers/console/app/app.py+++ b/api/controllers/console/app/app.py@@ -15,11 +15,12 @@ from controllers.console.wraps import (setup_required,)from core.ops.ops_trace_manager import OpsTraceManager+from core.workflow.enums import NodeTypefrom extensions.ext_database import dbfrom fields.app_fields import app_detail_fields, app_detail_fields_with_site, app_pagination_fieldsfrom libs.login import current_account_with_tenant, login_requiredfrom libs.validators import validate_description_length-from models import App+from models import App, Workflowfrom services.app_dsl_service import AppDslService, ImportModefrom services.app_service import AppServicefrom services.enterprise.enterprise_service import EnterpriseService@@ -106,6 +107,35 @@ class AppListApi(Resource):if str(app.id) in res:app.access_mode = res[str(app.id)].access_mode+ workflow_capable_app_ids = [+ str(app.id) for app in app_pagination.items if app.mode in {"workflow", "advanced-chat"}+ ]+ draft_trigger_app_ids: set[str] = set()+ if workflow_capable_app_ids:+ draft_workflows = (+ db.session.execute(+ select(Workflow).where(+ Workflow.version == Workflow.VERSION_DRAFT,+ Workflow.app_id.in_(workflow_capable_app_ids),+ )+ )+ .scalars()+ .all()+ )+ trigger_node_types = {+ NodeType.TRIGGER_WEBHOOK,+ NodeType.TRIGGER_SCHEDULE,+ NodeType.TRIGGER_PLUGIN,+ }+ for workflow in draft_workflows:+ for _, node_data in workflow.walk_nodes():+ if node_data.get("type") in trigger_node_types:+ draft_trigger_app_ids.add(str(workflow.app_id))+ break++ for app in app_pagination.items:+ app.has_draft_trigger = str(app.id) in draft_trigger_app_ids+return marshal(app_pagination, app_pagination_fields), 200@api.doc("create_app")diff --git a/api/fields/app_fields.py b/api/fields/app_fields.pyindex 1f14d663b86..7191933eede 100644--- a/api/fields/app_fields.py+++ b/api/fields/app_fields.py@@ -116,6 +116,7 @@ app_partial_fields = {"access_mode": fields.String,"create_user_name": fields.String,"author_name": fields.String,+ "has_draft_trigger": fields.Boolean,}diff --git a/web/app/components/apps/app-card.tsx b/web/app/components/apps/app-card.tsxindex 564eb493e56..8356cfd31c4 100644--- a/web/app/components/apps/app-card.tsx+++ b/web/app/components/apps/app-card.tsx@@ -282,21 +282,23 @@ const AppCard = ({ app, onRefresh }: AppCardProps) => {</>)}{- (!systemFeatures.webapp_auth.enabled)- ? <>- <Divider className="my-1" />- <button type="button" className='mx-1 flex h-8 cursor-pointer items-center gap-2 rounded-lg px-3 hover:bg-state-base-hover' onClick={onClickInstalledApp}>- <span className='system-sm-regular text-text-secondary'>{t('app.openInExplore')}</span>- </button>- </>- : !(isGettingUserCanAccessApp || !userCanAccessApp?.result) && (- <>+ !app.has_draft_trigger && (+ (!systemFeatures.webapp_auth.enabled)+ ? <><Divider className="my-1" /><button type="button" className='mx-1 flex h-8 cursor-pointer items-center gap-2 rounded-lg px-3 hover:bg-state-base-hover' onClick={onClickInstalledApp}><span className='system-sm-regular text-text-secondary'>{t('app.openInExplore')}</span></button></>- )+ : !(isGettingUserCanAccessApp || !userCanAccessApp?.result) && (+ <>+ <Divider className="my-1" />+ <button type="button" className='mx-1 flex h-8 cursor-pointer items-center gap-2 rounded-lg px-3 hover:bg-state-base-hover' onClick={onClickInstalledApp}>+ <span className='system-sm-regular text-text-secondary'>{t('app.openInExplore')}</span>+ </button>+ </>+ )+ )}<Divider className="my-1" />{diff --git a/web/types/app.ts b/web/types/app.tsindex b7a7f6a48dc..73e11d396a8 100644--- a/web/types/app.ts+++ b/web/types/app.ts@@ -379,6 +379,8 @@ export type App = {/** access control */access_mode: AccessModemax_active_requests?: number | null+ /** whether workflow trigger has un-published draft */+ has_draft_trigger?: boolean}export type AppSSO = {