alibaba/spring-ai-alibaba · error · BizException

MISSING_PARAMS

MISSING_PARAMS

Error message

request or appId is null

What it means

WorkflowExecuteManager.runTask validates that the resolved ApplicationVersion is non-null before initializing the workflow context. A null appVersion (no request context / no appId resolved) is rejected with MISSING_PARAMS; the log message hints the usual cause is a missing request or appId.

Source

Thrown at spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/workflow/runtime/WorkflowExecuteManager.java:130

		WorkflowContext context = workflowInnerService.getContextCache(requestContext.getWorkspaceId(), taskId);
		if (context == null) {
			return false;
		}

		context.setTaskStatus(NodeStatusEnum.STOP.getCode());
		context.setError(ErrorCode.WORKFLOW_RUN_CANCEL.toError("Manually terminated"));

		workflowInnerService.refreshContextCache(context);
		return true;
	}

	public TaskRunResponse runTask(ApplicationVersion appVersion, List<TaskRunParam> inputParams, String conversationId,
			WorkflowContext workflowContext) {
		RequestContext context = RequestContextHolder.getRequestContext();
		if (appVersion == null) {
			LogUtils.monitor("WorkflowExecuteManager", "runTask", System.currentTimeMillis(), FAIL, inputParams,
					"request or appId is null");
			throw new BizException(ErrorCode.MISSING_PARAMS.toError("request or appId is null"));
		}
		// Initialize context
		inputParams.forEach(input -> {
			String key = input.getKey();
			String source = input.getSource();
			if ("sys".equals(source)) {
				workflowContext.getSysMap()
					.put(key, VariableUtils.convertValueByType(input.getKey(), input.getType(), input.getValue()));
			}
			else {
				workflowContext.getUserMap()
					.put(key, VariableUtils.convertValueByType(input.getKey(), input.getType(), input.getValue()));
			}
		});

		conversationId = conversationId == null ? IdGenerator.uuid() : conversationId;

		workflowContext.setAppId(appVersion.getAppId());

View on GitHub (pinned to f82da0b50f)

Solutions

  1. Ensure the run request includes a valid appId that resolves to a published application version.
  2. Verify the RequestContext is populated (call through the normal HTTP path or set RequestContextHolder manually in tests/async tasks).
  3. Confirm the application exists and is published; re-publish if the version record is missing.
  4. Add an up-front null/empty check on appId in your client code before invoking the run API.

Example fix

// before
workflowExecuteManager.runTask(appId, params, conversationId, ctx); // appVersion unresolved
// after
if (appId == null || appId.isBlank()) throw new IllegalArgumentException("appId is required");
workflowExecuteManager.runTask(appService.getPublishedVersion(appId), params, conversationId, ctx);
Defensive patterns

Strategy: validation

Validate before calling

if (appId == null || appId.isBlank()) throw new IllegalArgumentException("appId is required");
ApplicationVersion v = appService.getPublishedVersion(appId);
if (v == null) throw new IllegalArgumentException("no published version for appId " + appId);

Try / catch

try {
    manager.runTask(appVersion, params, conversationId, ctx);
} catch (BizException e) {
    if ("MISSING_PARAMS".equals(e.getCode())) { /* missing/invalid appId in request */ }
}

Prevention

When it happens

Trigger: Calling runTask (directly or via the workflow run API) with appVersion == null — e.g. the RequestContext/RequestContextHolder had no appId, or the appId passed in does not resolve to a published application version.

Common situations: Calling the execution API without the appId parameter; referencing an app id that was deleted or never published; invoking runTask programmatically/async where RequestContextHolder is not populated; unauthenticated calls bypassing the request-context interceptor.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of alibaba/spring-ai-alibaba@f82da0b50f (2026-09-09). Data as JSON: /api/errors/098af971f95dfa60. Report an issue: GitHub.