{"record":{"id":"dc1a736f4d971e78","repo":"iflytek/astron-agent","slug":"workflow-import-dependency-unresolved","errorCode":"WORKFLOW_IMPORT_DEPENDENCY_UNRESOLVED","errorMessage":"ResponseEnum.WORKFLOW_IMPORT_DEPENDENCY_UNRESOLVED","messagePattern":"ResponseEnum\\.WORKFLOW_IMPORT_DEPENDENCY_UNRESOLVED","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowService.java","lineNumber":2544,"sourceCode":"                SpaceInfoUtil.getSpaceId());\n    }\n\n    void ensureNoUnresolvedImportDependencies(BizWorkflowData workflowData, String uid, Long spaceId) {\n        if (workflowData == null || workflowData.getNodes() == null) {\n            return;\n        }\n        if (StringUtils.isBlank(uid)) {\n            throw new BusinessException(ResponseEnum.UNAUTHORIZED);\n        }\n        ExecutionScope scope = loadExecutionScope(uid, spaceId);\n        ImportDependencyResources resources = loadImportDependencyResources(workflowData, scope);\n        boolean unresolved = workflowData.getNodes()\n                .stream()\n                .anyMatch(node -> hasActiveImportIssue(node, resources)\n                        || hasInvalidPluginBinding(node, resources)\n                        || hasInvalidResourceBinding(node, resources));\n        if (unresolved) {\n            throw new BusinessException(ResponseEnum.WORKFLOW_IMPORT_DEPENDENCY_UNRESOLVED);\n        }\n    }\n\n    /** Load every bound external resource in bounded authoritative batch queries. */\n    private ImportDependencyResources loadImportDependencyResources(\n            BizWorkflowData workflowData, ExecutionScope scope) {\n        Map<String, List<ToolBox>> executableTools = loadExecutableTools(workflowData);\n        Set<Long> databaseIds = new LinkedHashSet<>();\n        Set<String> workflowIds = new LinkedHashSet<>();\n        Set<String> repositoryIds = new LinkedHashSet<>();\n        for (BizWorkflowNode node : workflowData.getNodes()) {\n            collectBoundResourceIds(node, databaseIds, workflowIds, repositoryIds);\n        }\n        return new ImportDependencyResources(\n                executableTools,\n                loadExecutableDatabaseIds(databaseIds, scope),\n                loadExecutableWorkflowIds(workflowIds, scope),\n                loadExecutableRepositoryIds(repositoryIds, scope),","sourceCodeStart":2526,"sourceCodeEnd":2562,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowService.java#L2526-L2562","documentation":"Thrown after loading the caller's ExecutionScope and all externally bound resources when any node in the imported workflow references a plugin, model, or resource binding that cannot be resolved (hasActiveImportIssue / hasInvalidPluginBinding / hasInvalidResourceBinding). The import is rejected so users never save flows pointing at non-existent dependencies.","triggerScenarios":"Importing a workflow JSON whose nodes reference plugin IDs, model IDs, knowledge bases, or databases that do not exist (or are not executable) in the target space/user scope.","commonSituations":"Sharing workflow exports across environments where plugin/model IDs differ; deleted plugins referenced by an old export; importing into a space lacking the required knowledge base or database.","solutions":["Open the imported flow and re-bind each flagged node's plugin/model/database to resources existing in the target space","Install/enable the missing plugins or create the missing knowledge bases/databases before import","Re-export the workflow from an environment whose dependency IDs match the target","Check the unresolved-dependency details in logs to identify which node bindings failed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"boolean allBound = data.getNodes().stream().allMatch(n -> resolvers.keySet().containsAll(extractBindingIds(n)));","typeGuard":null,"tryCatchPattern":"try { workflowService.importWorkflow(req); } catch (BusinessException e) { if (\"WORKFLOW_IMPORT_DEPENDENCY_UNRESOLVED\".equals(e.getCode().name())) { /* re-bind flagged nodes */ } throw e; }","preventionTips":["Re-export workflows from environments matching the target's plugins/models","Install required plugins and create resources before import","Audit node bindings after cross-environment migration"],"tags":["import","dependency","validation"],"backgroundTag":"dependency-not-resolved","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}