iflytek/astron-agent · warning

Generate workflow template cover failed, workflowId=

Error message

Generate workflow template cover failed, workflowId={}

What it means

generateTemplateCover calls an AI model asynchronously to generate a cover image for a workflow template being exported. If any step of that async generation (or cover upload) throws, the method logs a warning with the workflow ID and returns a static fallbackCover so template export still succeeds. This is a deliberate degraded-mode path, not a thrown exception.

Solutions

  1. Check the stack trace logged at warn level for the root cause (connect/timeout/auth) and fix the AI service connectivity or credentials
  2. Verify the image generation model is configured and healthy for the space the bot belongs to
  3. Confirm the fallback cover is acceptable UX; if export must fail when no cover is generated, change this to rethrow
  4. Retry the export once the AI service is available so a real cover is produced
Defensive patterns

Strategy: fallback

Validate before calling

// caller-side pre-check before export
if (!aiServiceHealthCheck()) {
    log.info("AI service unavailable, export will use fallback cover");
}

Type guard

if (coverUrl == null || coverUrl.isBlank() || AI_AVATAR_FALLBACK.equals(coverUrl)) { return fallbackCover; }

Try / catch

try {
    String url = generateCoverAsync(workflow).orTimeout(30, TimeUnit.SECONDS).join();
    return StringUtils.isNotBlank(url) && !AI_AVATAR_FALLBACK.equals(url) ? url : fallbackCover;
} catch (Exception e) {
    log.warn("Generate workflow template cover failed, workflowId={}", workflow.getId(), e);
    return fallbackCover;
}

Prevention

When it happens

Trigger: exportTemplate -> generateTemplateCover when the remote AI image-generation call throws (model unavailable, timeout, auth failure), the CompletableFuture join() wraps an exception, or the returned cover URL is blank or equals the AI_AVATAR_FALLBACK sentinel after a successful call.

Common situations: AI model service down or rate-limited during template export; slow generation exceeding the join timeout; image upload endpoint misconfigured; model returns the fallback sentinel meaning generation was rejected.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/46cbb2a8a9d6408b. Report an issue: GitHub.

Appendix: source

Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/workflow/impl/BotMaasServiceImpl.java:361

            log.error("Export workflow template snapshot failed, workflowId={}", workflow.getId(), e);
            throw new BusinessException(ResponseEnum.WORKFLOW_EXPORT_FAILED);
        }
    }

    private String generateTemplateCover(String uid, Workflow workflow) {
        String fallbackCover = workflow.getAvatarIcon();
        try {
            String coverUrl = CompletableFuture
                    .supplyAsync(() -> botAIService.generateAvatar(uid, workflow.getName(), workflow.getDescription()))
                    .orTimeout(TEMPLATE_COVER_TIMEOUT_SECONDS, TimeUnit.SECONDS)
                    .exceptionally(ex -> null)
                    .join();
            if (StringUtils.isBlank(coverUrl) || AI_AVATAR_FALLBACK.equals(coverUrl)) {
                return fallbackCover;
            }
            return coverUrl;
        } catch (Exception e) {
            log.warn("Generate workflow template cover failed, workflowId={}", workflow.getId(), e);
            return fallbackCover;
        }
    }

    private LambdaQueryWrapper<ExportedWorkflowTemplate> withSpaceScope(LambdaQueryWrapper<ExportedWorkflowTemplate> queryWrapper) {
        Long spaceId = SpaceInfoUtil.getSpaceId();
        if (spaceId == null) {
            queryWrapper.isNull(ExportedWorkflowTemplate::getSpaceId);
        } else {
            queryWrapper.eq(ExportedWorkflowTemplate::getSpaceId, spaceId);
        }
        return queryWrapper;
    }
}

View on GitHub (pinned to 5e758547a8)