alibaba/spring-ai-alibaba · error · BizException

MISSING_PARAMS

MISSING_PARAMS

Error message

request or appId is null

What it means

WorkflowController.runDebugTask throws BizException with code MISSING_PARAMS when the POST /workflow/debug/run-task body is null or its appId field is blank. A debug task run must know which application to execute, so the request is rejected before resolving the app version; a monitor log records the failure.

Source

Thrown at spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/controller/WorkflowController.java:138

		this.workflowExecuteManager = workflowExecuteManager;
		this.workflowInnerService = workflowInnerService;
	}

	/**
	 * Executes a workflow task in debug mode. This endpoint allows running workflow tasks
	 * with debug capabilities, enabling step-by-step execution and detailed monitoring.
	 * @param request Task execution request containing: - appId: Application identifier -
	 * version: Application version (defaults to "latest") - inputs: Input parameters for
	 * the workflow - conversationId: Session identifier for tracking
	 * @return TaskRunResponse containing: - taskId: Unique identifier for the executed
	 * task - conversationId: Session identifier - requestId: Request tracking identifier
	 */
	@PostMapping(value = { "/workflow/debug/run-task" })
	public Result<TaskRunResponse> runDebugTask(@RequestBody TaskRunRequest request) {
		if (request == null || StringUtils.isBlank(request.getAppId())) {
			LogUtils.monitor("WorkflowService", "runTask", System.currentTimeMillis(), FAIL, request,
					"request or appId is null");
			throw new BizException(ErrorCode.MISSING_PARAMS.toError("request or appId is null"));
		}
		String version = request.getVersion();
		if (version == null) {
			version = "latest";
		}
		ApplicationVersion appVersion = appService.getAppVersion(request.getAppId(), version);
		WorkflowContext workflowContext = new WorkflowContext();
		workflowContext.setInvokeSource(InvokeSourceEnum.console.getCode());
		TaskRunResponse response = workflowExecuteManager.runTask(appVersion, request.getInputs(),
				request.getConversationId(), workflowContext);
		return Result.success(response);
	}

	/**
	 * Retrieves the current execution status of a workflow task. This endpoint provides
	 * detailed information about the task's progress, including node execution status and
	 * results.
	 * @param request Process status request containing: - taskId: Task identifier to

View on GitHub (pinned to f82da0b50f)

Solutions

  1. Send a JSON body containing a non-blank appId with Content-Type: application/json
  2. Ensure the workflow/app is saved so a valid appId exists before running the debug task
  3. Verify the field name matches TaskRunRequest.getAppId() in the client payload

Example fix

// before
{"graph": {...}} // appId missing
// after
{"appId":"app-123","graph":{...}}
Defensive patterns

Strategy: validation

Validate before calling

if (!request || !request.appId || !request.appId.trim()) throw new Error('appId is required to run a debug task');
await fetch('/workflow/debug/run-task', { method: 'POST', headers: {'Content-Type':'application/json'}, body: JSON.stringify(request) });

Type guard

function canRunTask(req) { return !!req && typeof req.appId === 'string' && req.appId.trim() !== ''; }

Try / catch

try { await runDebugTask(request); } catch (e) { if (e.code === 'MISSING_PARAMS') showError('Save the application before running debug'); else throw e; }

Prevention

When it happens

Trigger: POSTing to /workflow/debug/run-task with no body, a body lacking appId, or appId as an empty/whitespace string; also direct invocation with a null request.

Common situations: Debug runner invoked before an app is created/saved, JSON key mismatch (applicationId vs appId) deserializing to null, or missing Content-Type so the body is never bound.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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