OrbitSpaceDocs
Developer guides

Multi-iteration Goals and Workflows

Use Goal Experience for iterative work, independent evaluation, acceptance and delivery instead of creating unrelated application tasks repeatedly.

Choose execution mode

Omitting workflow_reference selects adaptive coordination. An exact Workflow Registry reference additionally requires candidate_step_key and all matching workspace bindings.

Both modes need an active default coordinator and independent reviewer/evaluator/QA binding. RELEASED completion also needs a CD binding and an authorized real release destination. A Registry URI does not install missing content or create roles.

Create the Goal

Replace the workspace and objective in goal.json. It requests EVALUATED completion and starts as a draft for inspection.

bash
curl --fail-with-body https://api.orbitspace.dev/api/v1/goal-experiences \
  -H "Authorization: Bearer $ORBITSPACE_ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  --data-binary @goal.json

Creation uses project tasks:write; reads use tasks:read. Approval and Artifact capabilities need their own permissions. The lower-level /api/v1/goals management API is distinct, and goals.read/goals.write are not supported scopes.

The example is a self-contained objective, not an automatic business-file attachment. Configure the selected workflow's supported data source for files/repositories rather than inventing request fields.

Present the experience

The response includes goal, snapshot, phase, last_event_sequence, deep_link and event_stream_url. Store the Goal ID in your business job and use the returned projection/control information. Model rounds alone are not business progress.

Resolve a relative event stream against the API origin. Resolve a relative Console deep link against the reviewed Console origin, not automatically against the API. Validate allowed destinations; use reviewed absolute links when returned.

SDK watchGoalExperience() uses the API origin. Its goalExperienceDeepLink() also resolves relative paths against the client's origin, so applications with separate API/Console domains must handle this distinction explicitly.

Control and extend

Use POST /api/v1/goal-experiences/{id}:control:

json
{
  "expected_state_version": "CURRENT_GOAL_VERSION",
  "action": "GOAL_EXPERIENCE_CONTROL_ACTION_START"
}

START, PAUSE, RESUME and CANCEL use the latest goal.state_version. Resuming an iteration-limit-exhausted Goal requires explicit additional_iterations; history and usage are retained.

:addRequirement accepts the current version and a new requirement. Use the Goal-specific approval decision endpoint for its approvals; see human interaction.

Acceptance and authority

acceptance_contract evaluates candidate results. It does not let a candidate self-assert independent review, merge or production release. Completion target, evaluation, release evidence and authorization determine the outcome.

Configure token/cost/compute ceilings and deadlines according to policy. A zero at one layer adds no limit there but does not bypass another quota or authority boundary. Unbounded automatic retries do not repair invalid configuration or uncertain outcomes.

Separate from service invocation

Invocation calls a versioned capability; Goal Experience tracks a durable multi-iteration outcome. They are distinct contracts, not modes switched by adding goal=true to an Invocation request.