Skip to content

Check what a workflow still needs in an environment

GET
/katara/v1/orgs/{org_id}/environments/{environment_id}/preflight
curl --request GET \
--url 'https://api.katara.com/katara/v1/orgs/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/environments/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/preflight?workflow=managed_runs' \
--cookie katara_session=<katara_session>

Reads, without writing, locking or spending anything, what stands between this environment and each workflow, or the one named in workflow: whether this deployment runs the service, whether the environment has access to each product it uses, which credentials may start it, the permissions it needs and which the caller lacks, which records it needs are present, whether its background workers report ready, and the steps left, each marked when only a person can take it. Needs org:read; a key answers for its own environment only. Queue depths and other customers’ load are never reported.

org_id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
environment_id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
workflow
Allowed values: managed_runs ingestion credential_execution schedules events evaluation image_description

Check one workflow instead of all of them. Any other query parameter is refused.

X-Katara-Account-ID
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/

Optional mounted-account binding for cookie reads. A supplied different account returns account_changed.

What each workflow still needs here.

Media typeapplication/json

A side-effect-free check of an environment for the caller who asked. Nothing is written, no record is locked and nothing is spent; present means present when it was read, and the operation that relies on a record checks it again. setup is the caller’s own setup under way, null for none and always null for a key.

object
org_id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
environment_id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
checked_at
required
string format: date-time
environment
required
object
mode
required
Allowed values: test live
state
required
Allowed values: active resetting suspended
reset_generation
required
integer
>= 1 <= 9007199254740991
caller
required

Who asked. fresh is whether the caller is a person’s session that may make the operations asking for one; a key has no sign-in and is never fresh. permissions are what the caller may do here, as the organization read reports them.

object
kind
required
Allowed values: session api_key service_account
role
required
Allowed values: owner admin builder operator reviewer viewer billing automation
fresh
required
boolean
permissions
required
Array
<= 64 items unique items
Allowed values: billing:read billing:write cortex:inference keys:write locus:actions:execute locus:actions:read locus:actions:reconcile locus:approvals:decide locus:audit:read locus:grants:delegate locus:grants:read locus:grants:write locus:policies:activate locus:policies:read locus:policies:write locus:tools:read locus:tools:write notifications:admin org:close org:environments:promote org:environments:reset org:federation:write org:holds:write org:members:write org:ownership:transfer org:read org:service_accounts:write synapse:agents:read synapse:agents:write synapse:evaluations:read synapse:evaluations:write synapse:event_sources:write synapse:memory:index synapse:memory:read synapse:memory:write synapse:promotions:write synapse:reviews:write synapse:runs:cancel synapse:runs:create synapse:runs:export synapse:runs:read synapse:runs:reconcile synapse:schedules:write
setup
required
Any of:

How far a setup has come and the request it was started with. A setup is done once its first run is admitted and discarded once its person gives it up; while running, starting again with the same request continues it.

object
org_id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
environment_id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
starter
required
Allowed values: assistant summarizer blank
request
required

The starter agent to set up. A blank agent also carries the instructions and first task the person wrote; the other starters carry neither.

object
starter
required
Allowed values: assistant summarizer blank
instructions
string
>= 1 characters <= 32768 characters
first_task
string
>= 1 characters <= 4000 characters
state
required
Allowed values: running done discarded
steps
required
Array<object>
>= 9 items <= 9 items

One step of a setup and whether it has finished.

object
name
required
Allowed values: agent storage policy documents budget grants agent_version content_access first_run
done
required
boolean
agent_id
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
run_id
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
started_at
required
string format: date-time
workflows
required
Array<object>
>= 1 items <= 7 items

What stands between the environment and one workflow. available is false when this deployment does not run the service, and message then says so in the words its operations’ feature_unavailable reply uses. For image_description it is also false when no model in the model catalog accepts images, or when the catalog could not be read; message says which. ready is true only when the service is available, the caller may start the workflow with this credential and holds every permission it needs, every product is granted, every item is present and every worker reports ready. A worker that has never reported is unknown, which is not ready.

object
workflow
required

A workflow a preflight checks: managed runs, document ingestion, tools that act with a connected credential, schedules, signed events, funded evaluation, and image descriptions in managed runs.

Allowed values: managed_runs ingestion credential_execution schedules events evaluation image_description
ready
required
boolean
available
required
boolean
message
string
>= 1 characters <= 500 characters
product_access
required
Array<object>
<= 3 items
object
product
required
Allowed values: synapse locus cortex
granted
required
boolean
action
Allowed values: fund
credentials
required
Array
>= 1 items <= 3 items unique items
Allowed values: session api_key service_account
permissions
required
object
required
required
Array
>= 1 items <= 64 items unique items
Allowed values: billing:read billing:write cortex:inference keys:write locus:actions:execute locus:actions:read locus:actions:reconcile locus:approvals:decide locus:audit:read locus:grants:delegate locus:grants:read locus:grants:write locus:policies:activate locus:policies:read locus:policies:write locus:tools:read locus:tools:write notifications:admin org:close org:environments:promote org:environments:reset org:federation:write org:holds:write org:members:write org:ownership:transfer org:read org:service_accounts:write synapse:agents:read synapse:agents:write synapse:evaluations:read synapse:evaluations:write synapse:event_sources:write synapse:memory:index synapse:memory:read synapse:memory:write synapse:promotions:write synapse:reviews:write synapse:runs:cancel synapse:runs:create synapse:runs:export synapse:runs:read synapse:runs:reconcile synapse:schedules:write
missing
required
Array
<= 64 items unique items
Allowed values: billing:read billing:write cortex:inference keys:write locus:actions:execute locus:actions:read locus:actions:reconcile locus:approvals:decide locus:audit:read locus:grants:delegate locus:grants:read locus:grants:write locus:policies:activate locus:policies:read locus:policies:write locus:tools:read locus:tools:write notifications:admin org:close org:environments:promote org:environments:reset org:federation:write org:holds:write org:members:write org:ownership:transfer org:read org:service_accounts:write synapse:agents:read synapse:agents:write synapse:evaluations:read synapse:evaluations:write synapse:event_sources:write synapse:memory:index synapse:memory:read synapse:memory:write synapse:promotions:write synapse:reviews:write synapse:runs:cancel synapse:runs:create synapse:runs:export synapse:runs:read synapse:runs:reconcile synapse:schedules:write
items
required
Array<object>
<= 11 items
object
item
required

A record a workflow needs in the environment. The first eight are the setup flow’s steps of the same names. Product access is granted by Katara rather than made by an operation.

Allowed values: agent storage policy documents budget grants agent_version content_access payer_consent credential_connection product_access
present
required
boolean
workers
required
Array<object>
<= 6 items
object
worker
required

Background work, named for what it does: starting and advancing runs, carrying out run steps, reading documents, starting scheduled runs, admitting events and delivering notices.

Allowed values: runs run_steps document_reading schedules events notifications
state
required
Allowed values: ready not_ready unknown
next_actions
required
Array<object>
<= 32 items

One step left. action uses the words an error’s action does. A step about a record names it in item, the operation that makes it in operation and the permission that operation needs in permissions. requires_human is true when an API key or service account cannot take the step: only a signed-in person, or someone holding authority the caller lacks, can.

object
action
required
Allowed values: sign_in reauthenticate request_access review fund retry support
item

A record a workflow needs in the environment. The first eight are the setup flow’s steps of the same names. Product access is granted by Katara rather than made by an operation.

Allowed values: agent storage policy documents budget grants agent_version content_access payer_consent credential_connection product_access
worker

Background work, named for what it does: starting and advancing runs, carrying out run steps, reading documents, starting scheduled runs, admitting events and delivering notices.

Allowed values: runs run_steps document_reading schedules events notifications
operation
string
/^[a-z][A-Za-z]{1,99}$/
permissions
Array
>= 1 items <= 64 items unique items
Allowed values: billing:read billing:write cortex:inference keys:write locus:actions:execute locus:actions:read locus:actions:reconcile locus:approvals:decide locus:audit:read locus:grants:delegate locus:grants:read locus:grants:write locus:policies:activate locus:policies:read locus:policies:write locus:tools:read locus:tools:write notifications:admin org:close org:environments:promote org:environments:reset org:federation:write org:holds:write org:members:write org:ownership:transfer org:read org:service_accounts:write synapse:agents:read synapse:agents:write synapse:evaluations:read synapse:evaluations:write synapse:event_sources:write synapse:memory:index synapse:memory:read synapse:memory:write synapse:promotions:write synapse:reviews:write synapse:runs:cancel synapse:runs:create synapse:runs:export synapse:runs:read synapse:runs:reconcile synapse:schedules:write
requires_human
required
boolean
message
required
string
>= 1 characters <= 500 characters
Example
{
"environment": {
"mode": "test",
"state": "active"
},
"caller": {
"kind": "session",
"role": "owner",
"permissions": [
"billing:read"
]
},
"setup": {
"starter": "assistant",
"request": {
"starter": "assistant"
},
"state": "running",
"steps": [
{
"name": "agent"
}
]
},
"workflows": [
{
"workflow": "managed_runs",
"product_access": [
{
"product": "synapse",
"action": "fund"
}
],
"credentials": [
"session"
],
"permissions": {
"required": [
"billing:read"
],
"missing": [
"billing:read"
]
},
"items": [
{
"item": "agent"
}
],
"workers": [
{
"worker": "runs",
"state": "ready"
}
],
"next_actions": [
{
"action": "sign_in",
"item": "agent",
"worker": "runs",
"permissions": [
"billing:read"
]
}
]
}
]
}

Request rejected or unavailable.

Media typeapplication/json
object
error
required
object
message
required
string
>= 1 characters <= 500 characters
type
required
string
>= 1 characters <= 100 characters
code
required

Stable; branch on it. Any operation can answer invalid_request, with param naming the refused field when there is one; human_session_required, when an API key, service account or workload calls an operation only a signed-in person may perform; reauthentication_required, when a person’s sign-in is too old for the operation; permission_denied; route_not_found and method_not_allowed, when no operation matches the path or method; and feature_unavailable, when the operation’s service is not enabled on this deployment.

string
>= 1 characters <= 100 characters
param
required

The request field a refusal is about, such as the agent_id or run_id query parameter; null when the refusal is not about one field.

string | null
request_id
required
string
>= 1 characters <= 100 characters
upstream_status
required
integer | null
action
Allowed values: sign_in reauthenticate request_access review fund retry reconcile refresh support
operation_id
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
snapshot_ref
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
Example
{
"error": {
"action": "sign_in"
}
}