Submit a task project candidate

Compile the current task’s project snapshot to produce a candidate for user review. See Shared information for objects, variables, and environment boundaries.

POST https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-candidates/submit

Before you call this API

Retain injected service URLs, credentials, Workspace, and short-lived authorization in the current generation task environment. Use complete original authorization header values. Install jq and set the example variables.

Request body

jq -n --slurpfile files "$PROJECT_FILES_JSON" '{project_files:$files[0]}' > request.json
curl -X POST "${MOI_ENDPOINT%/}/workflow/v2/workflow-candidates/submit" \
  -H "X-API-Key: $MOI_API_KEY" \
  -H "X-Workspace-ID: $MOI_WORKSPACE_ID" \
  -H "X-MOI-Runtime-Authorization: $MOI_RUNTIME_AUTHORIZATION" \
  -H 'Content-Type: application/json' \
  --data-binary @request.json

Supply only server-writable regular files under workflow/, operators/, and tests/. Do not upload platform evidence or use local absolute paths as server paths. source, summary, catalog_revision, intent, test_status, and test_result cannot be supplied simultaneously. Fully test the same snapshot first, then submit it. An ordinary PAT cannot use this project branch. After submission, wait for task completion and candidate artifact publication before user confirmation. The old source branch requires separate review; these parameters do not apply to it.

Field

Type

Required

Description

project_files

object

Required in this branch

Map from project-relative paths to Base64 file bytes, read from the current task working directory.

scope

object

No

Task scope for submission. When omitted, derived from the validated current task identity.

scope.task_id

string

No

When supplied, must match the current task.

scope.context_id

string

No

When supplied, must match the current generation conversation.

Successful response

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "ok": false,
    "message": "项目未形成可用候选"
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

Response information.

data

object

Result of this operation.

data.ok

boolean

Whether a usable compiled candidate was obtained; not proof that all tests passed or that it was accepted.

data.candidate_id

string

Compiled candidate identifier. Read artifact_id for confirmation after task artifact publication.

data.proposal_id

string

Corresponding confirmation proposal when present. Save it with the candidate and its task.

data.diagnostics

object[]

Compilation or validation diagnostics. Troubleshoot using message, stage, path, line, and column.

data.test_status

string

Server-side test projection for the current snapshot. Clients must not claim it passed themselves.

data.test_result

object

Associated test evidence when present, corresponding to the current executable snapshot.

Error responses

Handle HTTP status and business fields. Historical queries and recovery have dedicated error codes; see Errors and environments. Retain identity, source references, and operation identifiers first, then check state before acting. Do not automatically change Workspace, candidate, or confirmation keys.

Last updated on