Workflow operator screens
Queue UI Designer
Release preview: not yet available in production. Describe how an existing workflow's queue should look and compare saved previews. Approve the exact version through human web review or an explicitly authorized system key, then publish it through the regular Marketplace API or MCP.
Start with an eligible workflow.
Discover targets before starting a design. A workflow that is still a Planner build, has no entity queue, is Git-managed, or is outside your effective workflow permissions is not a live-editing target. Organization membership alone does not make it eligible.
export XY_API_BASE='https://api.xy.ai/api/v1'
: "${XY_API_KEY:?Use an authorized personal or system key with queue_ui:read}"
curl --fail-with-body \
--header "Authorization: Bearer ${XY_API_KEY}" \
"${XY_API_BASE}/queue-designs/targets"Queue UI Designer changes supported presentation configuration: column order and labels, existing safe fields, sorting, and detail layout. It cannot introduce arbitrary React, custom code, new backend actions, new data fields, or new workflow behavior. Existing data access rules still apply. Git-managed queues require their engineering review and deployment process.
Creating the prerequisite workflow is a separate authorization flow. Personal access with planner:read and planner:write can author and follow the build. For API keys, planner:promote requires a system key; personal MCP OAuth has separate grants that can include promotion. After promotion, use personal or system access with Queue UI scopes and the appropriate workflow authorization. The planner:promotescope does not grant Queue UI approval or publication, and promoting a workflow does neither. See workflow promotion.
Choose the credential for each stage.
| Operation | Personal key / personal MCP OAuth | System key / API-key-authenticated MCP |
|---|---|---|
| Create and follow a Planner build | Supported with planner:read and planner:write; personal ownership rules apply. | Supported with the relevant Planner scopes and organization access. |
| Promote a Planner build | Personal API key: unavailable. Personal MCP OAuth: requires its own planner:promote grant and the build's promotion checks. | Requires planner:promote and the accepted build's promotion checks. |
| Design an existing Queue UI | Requires queue_ui:read and queue_ui:write, feature access, and explicit workflow access/configure permission. | Requires queue_ui:read and queue_ui:write, organization feature access, and an eligible workflow in that organization. |
| Approve Queue UI through REST or MCP | Not available. A person can approve in the signed-in web review page instead. | Requires the system-only queue_ui:approve scope, an exact design version and hash, and the expected live publication receipt. Recorded as system approval. |
| Publish or roll back Queue UI | Requires queue_ui:publish and workflow permission. Publication requires an already approved design. | Requires queue_ui:publish, organization authorization, and an eligible app-managed Planner queue. Approval remains a separate operation and scope. |
Personal API keys and personal MCP OAuth are separate authorization choices. An OAuth grant can include Planner promotion even though a personal API key cannot. Neither allows queue_ui:approve. Check the grant and workflow permissions for the credential you actually use; do not infer them from another key or connection.
System approval is an automated organization decision, not human review and not approval by the person who created the key. Publication cannot create approval. Keep approval authority separate from design authoring unless your automation is explicitly authorized for both; giving a personal key more scopes cannot turn it into a system key.
With the required scopes and workflow permissions, a personal key or MCP connection can open and continue your own public designs and public designs created by your organization's system identity. This does not expose another person's private design sessions. A system-created design can also be reviewed by an authorized person in the web app; approval and publication still require their separate permissions.
Personal or SYSTEM Planner keys with planner:write can bind a known, eligible service-owned public credential reference without credentials:read. Binding does not grant credential management or return secret values, and user-created UI vault entries are not automatically public references. Review the separate credential ownership boundary before designing a workflow that needs a saved password or API token.
- Personal author, human review
- Use personal read/write access to generate the design. Open the review link and approve the exact version in the web app. A personal or system key with publish authority can then publish the approved version.
- Personal author, system release
- Use personal read/write access for design work. Give the authorized organization automation the session and design version IDs. Its system key needs read, approve, and publish scopes to inspect the version, approve its exact hash, and publish in separate calls.
- System-managed design and release
- Use a system key explicitly granted all four Queue UI scopes. Generate, inspect, approve, and publish as separate stages. Creating and promoting a prerequisite Planner workflow additionally needs the relevant Planner scopes; Queue UI scopes do not grant them.
Compose scope grants with workflow access.
- An authorized administrator enables Queue UI Designer and API-key or interactive MCP access for the organization and grants the user the relevant scopes in the organization's access management UI. API-key access and MCP OAuth access have separate scope grants. The user also needs access to the Queue UI Designer feature.
- For REST, the user opens Organization settings, API Keys, chooses Personal, and selects a subset of their granted scopes. For MCP OAuth, the user connects to
https://mcp.xy.ai/mcp, signs in, and consents to the organization and effective scopes. Granting API-key scopes does not automatically extend an OAuth grant. - The user must also have explicit workflow access and configure permission on the selected target when using personal access. XY checks current membership, effective scope authority, and workflow permissions on requests. Removing access can make an existing key or session unusable.
For organization automation, an authorized administrator creates a System key in API Keys and selects explicitly granted scopes. A delegated administrator also needsapi_keys:manage_service and authority to issue the selected scopes. System requests use the organization's access to eligible workflows, not the key creator's personal workflow permissions. The organization must have Queue UI Designer and API-key access enabled. To use this system key through MCP, configure API-key authentication; signing in through personal OAuth does not create system access.
| Scope | Allows | Limit |
|---|---|---|
queue_ui:read | Targets, sessions, versions, validation, previews, and events. | Only authorized resources. |
queue_ui:write | Start or revise designs, cancel generation, and complete sessions by cleaning up previews. | Does not publish or approve. |
queue_ui:approve | Approve an exact design version and hash, guarded by the expected live publication receipt. | System keys only. Audited as system approval; does not publish. |
queue_ui:publish | Publish approved designs and restore retained publications or the captured baseline. | Separate privileged scope; does not approve. |
All four Queue UI scopes are excluded from the default partner scope set. Each must be explicitly granted; partner status or enabling the feature does not add them to an existing key or OAuth grant.
Select read and write for an author who needs to follow their work. Add publish only for an identity allowed to change the live queue, and approve only for authorized system decision-making. The scopes are separate: write, approve, or publish does not implicitly include read. Workflow-promotion or analytics scopes do not substitute for Queue UI scopes.
Delegation is bounded by the grantor's current effective scopes and permitted role hierarchy. An authorized partner can delegate only within that ceiling to regular organization users; they cannot grant themselves additional authority or promote a recipient above that ceiling. Revoking an upstream grant narrows dependent access. Key selection and OAuth consent can narrow access further, never enlarge it.
API keys and authenticationDescribe, preview, review, publish.
- Find the workflow with
queue_ui_list_targetsand start a session withqueue_ui_start_design. - Poll
queue_ui_get_designandqueue_ui_get_eventsusing the returned session and run identifiers. - Compare immutable versions with
queue_ui_list_versionsandqueue_ui_get_version. Open the selected version's preview and inspect its validation. - Send specific feedback with
queue_ui_send_messageto generate another version. Each revision needs its own review. - For human review, open
/queue-designs/qds_<cuid>?version=<design_version>in the web app and approve that exact version and hash. For authorized automation, use the separate system-onlyqueue_ui_approveoperation described below. - After approval, call
queue_ui_publishwith that design version ID and the current publication receipt ID you expect to replace, or explicit null initially. Read the result, retain the new live receipt ID, and open the returned live link. - When the session is finished, call
queue_ui_cleanup_previews. This closes the session before removing previews. Further messages and publishing require a new design session; rollback to a previous publication remains available.
: "${WORKFLOW_DEFINITION_ID:?Choose an eligible workflow from targets}"
: "${QUEUE_DESIGN_ATTEMPT_ID:?Keep a stable unique key for this design request}"
if ! DESIGN="$(jq -n --arg workflow_definition_id "${WORKFLOW_DEFINITION_ID}" \
'{workflow_definition_id: $workflow_definition_id,
prompt: "Show record ID, status, and updated time. Put the newest records first and keep the detail view compact."}' |
curl --fail-with-body --request POST \
--header "Authorization: Bearer ${XY_API_KEY}" \
--header "Idempotency-Key: ${QUEUE_DESIGN_ATTEMPT_ID}" \
--header "Content-Type: application/json" \
--data-binary @- \
"${XY_API_BASE}/queue-designs")"; then
printf '%s\n' "${DESIGN}" >&2
exit 1
fi
printf '%s\n' "${DESIGN}"
# Retain this public ID and the response's run ID and review_url.
QUEUE_DESIGN_ID="$(printf '%s' "${DESIGN}" | jq -er '.id')"Public design IDs use qds_<cuid>. Pass the returnedid to REST and MCP operations. The web review route also accepts the public session ID. Follow the returned review_url to open the correct application and environment; use the selected version's preview link with ?version= to review that exact design version. The public API base remains https://api.xy.ai/api/v1.
: "${QUEUE_DESIGN_ID:?Use the returned qds_ session ID}"
# Read the current durable state. Repeat reads at a bounded polling interval.
curl --fail-with-body \
--header "Authorization: Bearer ${XY_API_KEY}" \
"${XY_API_BASE}/queue-designs/${QUEUE_DESIGN_ID}"
# Start at zero; persist the last processed event seq before reconnecting.
curl --fail-with-body \
--header "Authorization: Bearer ${XY_API_KEY}" \
"${XY_API_BASE}/queue-designs/${QUEUE_DESIGN_ID}/events?after_seq=${LAST_EVENT_SEQ:-0}&limit=100"
curl --fail-with-body \
--header "Authorization: Bearer ${XY_API_KEY}" \
"${XY_API_BASE}/queue-designs/${QUEUE_DESIGN_ID}/versions": "${QUEUE_DESIGN_ID:?Use the returned public design ID}"
: "${QUEUE_MESSAGE_ATTEMPT_ID:?Use a new stable key for this revision request}"
curl --fail-with-body --request POST \
--header "Authorization: Bearer ${XY_API_KEY}" \
--header "Idempotency-Key: ${QUEUE_MESSAGE_ATTEMPT_ID}" \
--header "Content-Type: application/json" \
"${XY_API_BASE}/queue-designs/${QUEUE_DESIGN_ID}/messages" \
--data '{"prompt":"Rename the Updated column to Last activity and move it next to Status."}'Ask for an operator view in plain language.
- Make daily work easier to scan
- "For our promoted reconciliation workflow, show record ID, status, and last updated time. Put the newest records first and make the detail view compact. Give me a preview to review."
- Refine a saved preview
- "In this design session, move Status next to Record ID and rename Updated to Last activity. Keep the existing status meanings. Generate a new version and send me the review link."
- Publish after web review
- "I approved design B in the web review page. Publish that exact design, provided the live publication receipt is still P1. Stop and report a conflict if someone has changed the live queue."
- Release through authorized system automation
- "Inspect design B and its validation. If it meets our release policy, use our authorized system approval operation for B and its returned hash while P1 is still live. Then publish B with the same expected receipt. Record this as a system decision, not human review. Stop on a conflict."
- Restore an earlier operator screen
- "Restore the configuration saved in publication receipt P1, replacing P2 only if P2 is still live. Return the new live receipt and keep workflow records and execution state intact."
- Restore the original queue
- "Restore the baseline captured before our first Queue UI publication. Use its baseline receipt as the rollback target and stop if the live receipt has changed."
- Complete the design session
- "We are finished with this session. Close it and remove its temporary previews. Preserve the saved versions, publication history, and live workflow. I will start a new session for future design changes."
B is a design label; P1 and P2 are publication receipt labels. Use actual returned IDs in tool arguments. The server verifies approval even when the person says they have approved a version.
Choose human review or system approval.
For human approval, a person with the required workflow access opens the returned review link in the web app and approves the selected version. An API prompt claiming that a person approved it is not evidence of approval.
For automated approval, use a system key with queue_ui:approveand call POST /queue-designs/{session_id}/approveor queue_ui_approve. Supply the design's version_id, its exact returned resolved_yaml_hash, and the observed live publication receipt as expected_live_version_id. The returned hash is 16 lowercase hexadecimal characters; pass it unchanged, not a hash of the response JSON or the live queue. Use explicit null only when publication state reports no receipt.
# System approval only. This does not record human review or make the queue live.
: "${XY_QUEUE_SYSTEM_KEY:?Use a system key with queue_ui:approve}"
: "${QUEUE_DESIGN_ID:?Use the returned public design ID}"
: "${DESIGN_VERSION_ID:?Use the exact DESIGN version ID selected for approval}"
: "${DESIGN_RESOLVED_YAML_HASH:?Use the selected version resolved_yaml_hash unchanged}"
: "${EXPECTED_LIVE_RECEIPT_JSON:?Supply the observed PUBLICATION receipt as JSON, or explicit null}"
jq -n --arg version_id "${DESIGN_VERSION_ID}" \
--arg resolved_yaml_hash "${DESIGN_RESOLVED_YAML_HASH}" \
--argjson expected_live_version_id "${EXPECTED_LIVE_RECEIPT_JSON}" \
'{version_id: $version_id, resolved_yaml_hash: $resolved_yaml_hash,
expected_live_version_id: $expected_live_version_id}' |
curl --fail-with-body --request POST \
--header "Authorization: Bearer ${XY_QUEUE_SYSTEM_KEY}" \
--header "Content-Type: application/json" \
--data-binary @- \
"${XY_API_BASE}/queue-designs/${QUEUE_DESIGN_ID}/approve"After an uncertain approval response, read the saved design state before taking another action. For publication, use an authorized key with queue_ui:publish; approval scope does not include publication scope.
Publish the exact approved revision.
| Argument | ID to supply | Read it from |
|---|---|---|
Publish: version_id | The exact approved design version ID. | The selected saved version's id. |
System approval, publish, or rollback: expected_live_version_id | Current publication receipt ID, or explicit null before first publication. | session.publication.live_version_id. |
Rollback: to_version_id | A retained publication receipt ID, including the captured baseline. | session.publication.history receipt IDs or session.publication.baseline_version_id. |
Read the session's publication state before deciding what to replace. Supply its live receipt ID explicitly as expected_live_version_id. The server compares it with the current live receipt to prevent overwriting a newer activation. Supply JSON null only for a confirmed first publication; missing or unreadable state is not evidence that no live receipt exists. The initial null means no Queue UI publication has happened yet; the workflow already has a queue. This is a body-level comparison, not the Planner build's If-Match header.
# Run only after exact human web approval or authorized system approval.
: "${QUEUE_DESIGN_ID:?Use the returned public design ID}"
: "${APPROVED_DESIGN_VERSION_ID:?Use the exact approved DESIGN version ID}"
# Use a JSON string containing session.publication.live_version_id, a receipt ID.
# Use literal JSON null only when that field explicitly reports null.
: "${EXPECTED_LIVE_RECEIPT_JSON:?Supply the observed PUBLICATION receipt as JSON, or explicit null}"
if ! PUBLISH_RESPONSE="$(jq -n \
--arg version_id "${APPROVED_DESIGN_VERSION_ID}" \
--argjson expected_live_version_id "${EXPECTED_LIVE_RECEIPT_JSON}" \
'{version_id: $version_id, expected_live_version_id: $expected_live_version_id}' |
curl --fail-with-body --request POST \
--header "Authorization: Bearer ${XY_API_KEY}" \
--header "Content-Type: application/json" \
--data-binary @- \
"${XY_API_BASE}/queue-designs/${QUEUE_DESIGN_ID}/publish")"; then
printf '%s\n' "${PUBLISH_RESPONSE}" >&2
exit 1
fi
printf '%s\n' "${PUBLISH_RESPONSE}"A conflict requires a new decision. Refresh the publication state, compare the changes, and return to review if the candidate or approval is stale. Do not automatically substitute the newest live receipt and retry the write.
On first publication, XY captures the existing queue as a baseline receipt and exposesbaseline_version_id. Rollback accepts that receipt or another retained publication receipt as to_version_id. A design version ID is not a rollback target. The baseline is a snapshot of the original queue, not an unapproved draft. Restoring it does not undo workflow runs or business-data changes.
# Choose a receipt from session.publication.history, or baseline_version_id.
# Do not use a design version ID as the rollback target.
: "${QUEUE_DESIGN_ID:?Use the returned public design ID}"
: "${RETAINED_PUBLICATION_ID:?Choose a retained PUBLICATION receipt or baseline receipt ID}"
: "${EXPECTED_LIVE_RECEIPT_JSON:?Supply session.publication.live_version_id as JSON}"
jq -n --arg to_version_id "${RETAINED_PUBLICATION_ID}" \
--argjson expected_live_version_id "${EXPECTED_LIVE_RECEIPT_JSON}" \
'{to_version_id: $to_version_id, expected_live_version_id: $expected_live_version_id}' |
curl --fail-with-body --request POST \
--header "Authorization: Bearer ${XY_API_KEY}" \
--header "Content-Type: application/json" \
--data-binary @- \
"${XY_API_BASE}/queue-designs/${QUEUE_DESIGN_ID}/rollback"Every activation, including rollback, issues a fresh live publication receipt. Restoring an old configuration does not restore its old live token. Read and retain the resultingpublication.live_version_id before another change. An exact replay may return transitioned: false without a new activation.
| Action | Expected live receipt | Result |
|---|---|---|
| Publish approved design A | null | Live P1; baseline receipt P0 is captured. |
| Publish approved design B | P1 | Live P2. |
| Roll back to receipt P1 | P2 | Live P3, containing the configuration saved in P1. |
| Roll back to baseline receipt P0 | P3 | Live P4, containing the original queue configuration. |
A, B, and P0 through P4 are explanatory labels, not literal request IDs.
Follow durable state without blind retries.
- Persist the public session ID, run ID, request key, and last processed event sequence. Poll the same session after a disconnect; opening a new session repeats authoring work.
- Use
after_seqto resume events, optionally selectingrun_id. Advance the cursor after processing events; do not reset it to zero on every poll. Queue UI events are paged JSON reads, not the Planner build event stream. - Poll with a bounded interval and deadline, and honor
Retry-Afterwhen returned. A client timeout stops waiting locally; it does not cancel durable generation. - After generation completes, inspect the selected version's validation and preview readiness. Resolve validation findings and unsupported frontend changes before human review or system approval.
- Keep preview-ready, approved, and published as separate states. A newer generated version does not inherit an older version's approval.
Start and message calls require Idempotency-Key in REST andidempotency_key in MCP. Use one stable key for one logical request and keep its payload unchanged on retry. If a response is lost, check the session or list saved designs first. Do not create a new key merely because the client timed out. A new revision request gets a new key.
For an uncertain publish or rollback result, read the session's publication state and its current live receipt before taking another action. An HTTP failure alone is not proof that the live configuration was unchanged.
| Response | Next action |
|---|---|
400 / INVALID_QUEUE_DESIGN_REQUEST | Correct the request, identifiers, cursor, or required idempotency key using the live schema. Repeating unchanged invalid input will not help. |
401 / unauthenticated | Check the API key or reconnect the OAuth client in the correct organization and environment. |
403 / QUEUE_DESIGN_IDENTITY_REQUIRED, QUEUE_DESIGN_FORBIDDEN, or missing scope | Check credential type, feature access, scope grants, and workflow authorization. API approval requires a system key with queue_ui:approve; personal access also requires explicit workflow permissions. |
404 / QUEUE_DESIGN_NOT_FOUND | Refresh authorized targets or saved designs. Do not guess another organization's identifiers. |
409 / QUEUE_DESIGN_CONFLICT | Read current run, version, approval, and live publication state. Resolve the conflict before issuing another change. |
429 / QUEUE_DESIGN_QUOTA_EXCEEDED | Honor Retry-After when supplied, inspect active work, and wait for capacity before another request. |
503 / QUEUE_DESIGN_UNAVAILABLE | Check the session before retrying a change. The generation or publication may already have been accepted. |
Cancel with queue_ui_cancel_run when generation should stop; specify the run ID to avoid cancelling a newer run. Cancellation retains saved versions and previews.
Preview cleanup is explicit session completion. Callqueue_ui_cleanup_previews orDELETE /queue-designs/{session_id}/previews when finished. XY closes the external session before removing previews, preventing new work from starting during cleanup. Version history, publication history, and the live workflow are preserved.
A closed session accepts no further messages or publishing. Start a new design session for additional design work. Rollback to a previous publication remains possible from the closed session, using its retained publication receipt and the current live receipt comparison.
If cleanup is interrupted, retry the same session's cleanup operation. Retries resume the recorded cleanup; they do not reopen the session. RetainX-Request-ID for support without sharing bearer credentials.
REST routes and MCP tools.
| REST | MCP tool / scope | Use |
|---|---|---|
GET /queue-designs/targets | queue_ui_list_targetsqueue_ui:read | Find eligible workflows you can configure. |
GET /queue-designs | queue_ui_list_designsqueue_ui:read | Find saved design sessions. |
POST /queue-designs | queue_ui_start_designqueue_ui:write | Start a design for an existing workflow with a prompt and an idempotency key. |
GET /queue-designs/{session_id} | queue_ui_get_designqueue_ui:read | Read durable run, review, and publication state. |
GET /queue-designs/{session_id}/versions | queue_ui_list_versionsqueue_ui:read | Compare immutable saved versions. |
GET /queue-designs/{session_id}/versions/{version_id} | queue_ui_get_versionqueue_ui:read | Inspect an exact version, its validation, hash, and preview links. |
GET /queue-designs/{session_id}/events | queue_ui_get_eventsqueue_ui:read | Poll saved progress using after_seq and, optionally, run_id. |
POST /queue-designs/{session_id}/messages | queue_ui_send_messagequeue_ui:write | Request a revised version with a prompt and an idempotency key. |
POST /queue-designs/{session_id}/cancel | queue_ui_cancel_runqueue_ui:write | Cancel the selected or current generation run; retain saved versions and previews. |
POST /queue-designs/{session_id}/approve | queue_ui_approvequeue_ui:approve | System keys only: approve an exact design version and returned hash while comparing the expected live publication receipt. Audited as system approval, not human review. Does not publish. |
POST /queue-designs/{session_id}/publish | queue_ui_publishqueue_ui:publish | Publish an approved design version ID, comparing the expected live publication receipt ID. |
POST /queue-designs/{session_id}/rollback | queue_ui_rollbackqueue_ui:publish | Restore a retained publication or baseline receipt ID, comparing the expected live receipt. Activation returns a fresh receipt. |
DELETE /queue-designs/{session_id}/previews | queue_ui_cleanup_previewsqueue_ui:write | Complete the session: close it before removing previews. Preserve history and the live workflow; disallow further messages and publishing. Rollback remains available. Retries resume recorded cleanup. |
The backend-generated OpenAPI document is the canonical contract for request bodies, response fields, errors, and pagination. The live MCP catalog supplies tool input schemas; authenticated tool discovery is limited by effective scopes. If Queue UI routes or tools are absent from your environment's live references, verify release availability and access before attempting the workflow.