Workflow candidates and test resources

These APIs test projects by task, submit candidates, confirm proposals, and read or restore history. Candidate submission, user acceptance, application publication, and business-job completion are four distinct outcomes.

Identity and variables

Scenario

Endpoint and variables

Identity conditions

Project-file testing and submission

MOI_ENDPOINT, MOI_API_KEY, MOI_WORKSPACE_ID, MOI_RUNTIME_AUTHORIZATION

Retain task-injected configuration and pass the task authorization header unchanged. A regular personal token cannot submit a project branch.

Acceptance, rejection, history, and recovery

Examples use public /v5, AI_STUDIO_API_KEY, and WORKSPACE_ID

Personal access token with workflow operation privileges for the target workspace; tasks, proposals, and artifacts from the same environment.

Test resource preparation, observation, and reset

Examples use the current task environment

Scope derived from verified task identity. Regular Product identity branches exist but require explicit complete scope and resource authorization/task-state conditions.

TASK_ID, ARTIFACT_ID, and PROPOSAL_ID must come from the same current server candidate. ACCEPT_KEY stably identifies user confirmation. History uses WORKFLOW_CONTEXT_ID. During recovery, retain RESTORE_REQUEST_ID, RESTORE_TASK_ID, and RESTORE_ARTIFACT_ID. Retain identifiers and selection when results are unknown; use a new identifier when changing source.

Project file mapping

Collect server-writable regular files under the current task project’s workflow/, operators/, and tests/ into a JSON object: keys are project-relative paths and values are Base64-encoded bytes. Save its file path as PROJECT_FILES_JSON for request examples. Do not encode filenames, directories, or the entire JSON object as Base64 again. Do not upload platform evidence or reference materials.

Complete regular-file collection and directory/symlink checks follow the Go/Python examples in the developer guide “Test and submit a workflow project”. This internal working set does not duplicate or invent path rules. Test and submission use the same snapshot; retest after project changes.

Acceptance, recovery, and version handoff

Acceptance responses include complete candidate_ref, accepted_at, and candidate. Candidates may include workflow graphs, forms, layouts, custom operator snapshots, summaries, diagnostics, sources, content digests, and other server fields. Retain the full response rather than rewriting the candidate. During deployment, the server retrieves the accepted snapshot by reference again.

If a candidate is bound to an existing workflow, publication reuses that target. Omitting an application ID does not guarantee creation; a mismatched explicit ID conflicts. History recovery retains the source proposal’s target binding but does not accept, publish, or overwrite a saved application.

History current is the most recently accepted plan; saved_workflow is an optional saved workflow/version reference. Read them separately: they may differ if an accepted plan is unpublished or another conversation updated the same workflow. Lists paginate by task. Do not confuse total_tasks with the number of items.

Test resource side effects

Both preparation and observation may create databases and input/output volumes. Observation is not a read-only probe. Returned files and rows are samples; inspect truncated. Reset deletes task-tracked test knowledge bases, volumes, and databases. The task associated with an existing lease must still be working. Server lifecycle cleanup after task completion differs from this reset operation.

Errors and environments

Operation

Verified error boundary

Handling

History and recovery

400 WORKFLOW_HISTORY_INVALID_REQUEST;404 WORKFLOW_HISTORY_NOT_FOUND;409 WORKFLOW_HISTORY_CONFLICT; other service exceptions503 WORKFLOW_HISTORY_UNAVAILABLE

Retain context/source references, correct pagination, or read current proposal state. Authentication, authorization, and decoding may fail earlier; these four business codes do not cover every failure.

Acceptance

Original task incomplete, invalid artifact, proposal mismatch, not pending, expired, or confirmation-key conflict

Check the original task and retain the confirmation key; do not switch candidates to retry. Same-key replay of an accepted proposal differs from a new acceptance request.

Rejection

Only pending may be rejected; repeated rejection is not idempotent

Read history first if the result is unknown. This does not roll back accepted or saved applications.

Test resources

Scope mismatch, unavailable Catalog, lease-binding conflict, disallowed task state, or cleanup dependency failure

Retain the original task and error. Do not bypass by switching user or task.

Genesis /v1 and Billing remain independent. Never reuse authorization, workspace, task, proposal, candidate, or idempotency keys across environments.

Last updated on